Skip to content

Backend assets

You should be inside apps/backend directory to build assets.

shell
cd apps/backend

Make sure you use the right node and npm / pnpm environment. We use nvm for managing and .nvmrc for sharing node version requirements.

Before doing anything with the JS codebase, just run the following command, making sure you have nvm installed:

shell
nvm use

Development workflow

Please use Makefile targets to build assets as they contain important checks you might forget about.

Every Makefile target here makes sure you always have actual required node_modules packages versions.

  • make build

    Build backend production assets bundle.

  • make watch

    Run webpack hot-reload server. It will perform incremental build on every modification and send delta to your browser.

API Schema

To generate JSON Schema document for given API endpoint perform command:

shell
IN_URL="<URL_TO_ENDPOINT>" OUT_FILE="<PATH_TO_FILE>" npm run api:generate-schema

Please review that autogenerated file, correct eventual mistakes and add it to repository.

To generate TypeScript interfaces file from JSON Schema document do:

shell
IN_FILE="<PATH_TO_SCHEMA_FILE>" OUT_FILE="<PATH_TO_FILE>" npm run api:generate-ts-interface

As with JSON Schema files, review those generated by the command and add it to repository after that.