For the minimum Node / NPM versions, see package.json engines, and also .nvmrc.
To switch to the required version of Node, ensure you have nvm installed, and then run:
nvm use
Install application dependencies:
npm installTo run the application with local AWS services (S3, SQS), Redis and MongoDB:
docker compose up --build -dThe compose/01-start-localstack.sh script runs automatically on container startup to create the S3 buckets and SQS queues required by the CDP uploader.
To run the application in development mode run:
npm run devFor most cases, using development mode as above is easiest.
To mimic the application running in production mode locally run:
npm startSwagger UI is available at /docs when the server is running.
The OpenAPI spec is generated from @openapi JSDoc annotations in the route and controller files.
An AI (Claude Code) skill is provided to audit and fix the @openapi annotations so they match the actual endpoint implementations.
Run it from the project root with:
/sync-swaggerThe boundary check result page uses @defra/interactive-map with MapLibre GL to display uploaded red line boundaries. The map client code is in src/client/javascripts/boundary-map.js.
- UMD builds via CopyPlugin — the ESM distribution has its own webpack runtime which conflicts with ours. The UMD builds are copied to
.public/interactive-map/instead (seeCopyPlugininwebpack.config.js). Core and MapLibre provider go in separate subdirectories because both ship anindex.js. - Separate webpack entry point —
boundary-map.jsis its own entry so map code is only loaded on pages that need it. - Server-side coordinate projection — the impact assessor API defaults to returning geometry in WGS84 (EPSG:4326), which MapLibre requires. No client-side reprojection is needed.
- CSP — map
<script>tags must includenonce="{{ nonce }}"(Blankie). MapLibre needsworkerSrc/childSrcset to['self', 'blob:']for web workers, and theMAP_STYLE_URLorigin is added toconnectSrcautomatically. MAP_STYLE_URL— set this env var to a Mapbox Style Spec URL (e.g. OS Maps). Defaults to MapLibre demo tiles for local dev.