Prerequisites
- node version 20.9.0
- docker
The backend is in folder api/notifications-api.
-
Rename "env.example" file to ".env" and set POSTGRES_USER, POSTGRES_PASSWORD. The last variable sets the password for the "test" user for authentication purposes.
-
Run docker compose up to start the database:
docker compose up -d- Install dependencies:
npm install- Run the migrations (ensure database is up before running):
npm run migration:up- Seed the database with the 3 categories mentioned in the challenge and 2 users suscribed to different categories and channels for testing purposes (ensure the database is up and migrations have been run):
npm run seed- To run the app:
$ npm run start# unit tests
$ npm run testDocumentation of the API entpoints can be found at /api/v1/docs (http://localhost:3000/api/v1/docs)
I have used Nest framework.
The frontend is in folder ui
-
Rename "env.example" file to ".env" and ensure VITE_API_URL has the correct URL to the backend API.
-
Install dependencies:
npm install- To run the app:
$ npm run dev