Backend assets
You should be inside apps/backend directory to build assets.
cd apps/backendMake 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:
nvm useDevelopment 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 buildBuild backend production assets bundle.
make watchRun 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:
IN_URL="<URL_TO_ENDPOINT>" OUT_FILE="<PATH_TO_FILE>" npm run api:generate-schemaPlease review that autogenerated file, correct eventual mistakes and add it to repository.
To generate TypeScript interfaces file from JSON Schema document do:
IN_FILE="<PATH_TO_SCHEMA_FILE>" OUT_FILE="<PATH_TO_FILE>" npm run api:generate-ts-interfaceAs with JSON Schema files, review those generated by the command and add it to repository after that.