A prototype designed for use in user research for testing out different charts and the data they display
- Node.js ≥ v22
- npm ≥ v9
It's recommended to use nvm to manage Node.js versions.
To use the correct version of Node.js for this application, via nvm:
cd cff-chart-prototype
nvm useBy default, the service uses in-memory caching for local development. If your application requires a shared session cache between instances or persistence across restarts, you can integrate Redis by setting the SESSION_CACHE_ENGINE environment variable to redis. For local development without Redis, ensure that SESSION_CACHE_ENGINE is set to memory.
The application is configured to use a forward proxy by default. To utilize this proxy in your HTTP requests, you can set up the dispatcher as follows:
import { ProxyAgent } from 'undici';
const agent = new ProxyAgent({ uri: process.env.PROXY_URL });
const response = await fetch(url, { dispatcher: agent });Ensure that PROXY_URL is set in your environment variables.
Install application dependencies:
npm installTo run the application in development mode:
npm run devTo run the application in production mode locally:
npm startTo view all available npm scripts:
npm runTo update dependencies using npm-check-updates:
npx npm-check-updates -u
npm installEnsure consistent code formatting:
npm run formatIf you encounter issues with line endings on Windows, update your global git config:
git config --global core.autocrlf falseBuild the development image:
docker build --target development --no-cache --tag cff-chart-prototype:development .Run the development container:
docker run -p 3000:3000 cff-chart-prototype:developmentBuild the production image:
docker build --no-cache --tag cff-chart-prototype .Run the production container:
docker run -p 3000:3000 cff-chart-prototypeTo set up a local environment with the necessary services:
docker compose up --build -dTo enable Dependabot for automatic dependency updates, rename the example configuration file:
mv .github/example.dependabot.yml .github/dependabot.ymlFor code quality and security analysis, configure SonarCloud by setting up the sonar-project.properties file as per the instructions provided.
This project is licensed under the Open Government Licence v3.0. See the LICENSE file for more details.