- db contains all the db models. A global overview can be found here
- routers contains all the api routers which map urls to the service.
- services contains all business logic for the routes.
- handlers contains all request and response management.
- middleware contains all the middleware that is used in the routers before the code reaches the service.
- modules contains all voting models implemented in the forum backend.
- types contains all the zod types that are needed for validation.
- install nodejs v20.14.0
- On WSL (Windows Subsystems for Linux) install
node.js v20
as follows:
1. curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - 2. sudo apt install -y nodejs
- On WSL (Windows Subsystems for Linux) install
- install pnpm
- update .env with custom values
- start services needed to run backend
make docker-run
pnpm install
pnpm build
only required on the first runpnpm dev
- you can test you have set everything up correctly by running
pnpm test
- It is possible to visualize the database. Run:
pnpm db:studio
- It is possible to fill the database with random data. Run:
pnpm db:seed
- It is possible to delete all entries from the database. Run:
pnpm db:seed:cleanup
- create a file in the db with the new table schema
- run
pnpm db:generate
- restart server and migrations should auto run