Welcome to CodeJam!
- client (frontend)
- server (backend)
- db (postgres database)
- nginx (api gateway)
First make sur the Docker engine (daemon) is running in the background by opening Docker Desktop.
Then, run the following command to start the project in development mode:
docker compose up --build
Finally open a browser and visit the URL: http://localhost:8080
To stop the containers, run:
docker compose down
or simply press Ctrl+C for a graceful stop.
To run backend unit & integration tests:
cd backend
pnpm run test:db
Note: Due to the use of
tsx
to run TS files in Node and the use of ESM syntax ("type": "module"
inpackage.json
), the optionNODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules"
need to be added to thepnpm
script to activate ESM support with JEST tests (cf. documentation).
To run frontend unit & integration tests:
-
in single-run mode:
cd frontend pnpm run test
-
in watch mode:
cd frontend pnpm run test:watch
-
Stop the container (see step #1).
-
Cleanup unused data (stopper containers, unused networks, dangling (not tagged nor referenced) images, unused images, and build cache), unused volumes (execept names ones) skipping confirmation prompts:
docker system prune --volumes -af
- Then, manually delete the Docker named volume:
docker volume ls
docker volume rm codejam_dbdata
- Initialize the database from a SQL dump file (see next section).
-
First, make sure the application is up and running (see Run the application).
-
Initialize the database from a SQL dump file:
cd ./backend
pnpm run seed:db