This repository contains a powerful and efficient Bookmarks API built using NestJS, a progressive Node.js framework. The API allows users to manage bookmarks with ease and provides various features to enhance the bookmarking experience.
-
User Authentication: The API utilizes JWT-based authentication powered by
@nestjs/jwt
andpassport-jwt
. Users can register, log in, and access their personalized bookmarks securely. -
Bookmark Management: Users can perform CRUD operations on their bookmarks. The API employs
@nestjs/common
for routing and controllers, making it easy to handle bookmark operations. -
Prisma ORM Integration: Database operations are efficiently managed with the help of
@prisma/client
, which provides a type-safe ORM layer.
- Clone this repository to your local machine.
- Install the required dependencies by running:
$ yarn install
or
$ npm install
Before running the application, ensure that you have set up the required configuration:
-
Database Configuration: The API uses Prisma as an ORM, so you need to set up the database configuration. Rename the
.env.example
file to.env
and update it with your database credentials. -
JWT Secret: Update the
.env
file with a secure JWT secret for token generation and validation.
To set up the database and run migrations, execute the following commands:
$ yarn db:dev:restart # start postgres in docker and push migrations
Start the API in development mode by running:
# watch mode
$ yarn start:dev
or
# watch mode
$ npm run start:dev
The API will be accessible at http://localhost:3333
.
The API is thoroughly tested using Jest. To run the test suite, use the following command:
$ yarn test:e2e # will setup the test database too