This is a REST api that allows authenticated users to save their favorite bookmarks in the app's database. Users can register and sign in then proceed to add their favorite online links. Authentication and authorization are handled using signed JWT. The project uses the Nest.js framework and PostgreSQL database along with Prisma as an ORM for the backend. Automated e2e tests are made using Jest and Pactum.
- Before you get started, make sure that you have yarn package manager enabled. If not, then kindly follow the official docs here.
- Also make sure that you have Docker installed so that you can get a local database.
- First clone the repo
gh repo clone maxlar01/bookmarks-api-nestjs
- Navigate to the root directory and install project dependencies
yarn install
- Start the database container
yarn db:dev:up
-
Create ".env" and ".env.test" files and add the environment variables: DATABASE_URL and JWT_SECRET. For the DATABASE_URL, grab the user and password from the docker-compose.yml file. The JWT_SECRET can be any random string. For the ".env.test", make sure to use the test database port which is specified in the docker-compose.yml file.
-
Run the app
yarn start:dev
- To run e2e automated tests
yarn test:e2e
- You can test the API endpoints manually using Insomnia, Postman or any other similar tool you prefer.
You can read more about it here.