Skip to content

CRUD REST API with end-to-end tests using modern web development techniques. A bookmarks API from scratch using NestJs, Docker, PostgreSQL, Passport.js, Prisma, Pactum and dotenv.

Notifications You must be signed in to change notification settings

ArditZubaku/NestJS-Bookmarks-API

Repository files navigation

NestJS Bookmarks API

Nest Logo

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.

Features

  • User Authentication: The API utilizes JWT-based authentication powered by @nestjs/jwt and passport-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.

Installation

  1. Clone this repository to your local machine.
  2. Install the required dependencies by running:
$ yarn install

or

$ npm install

Configuration

Before running the application, ensure that you have set up the required configuration:

  1. 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.

  2. JWT Secret: Update the .env file with a secure JWT secret for token generation and validation.

Database Setup

To set up the database and run migrations, execute the following commands:

$ yarn db:dev:restart        # start postgres in docker and push migrations

Running the API

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.

Testing

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

About

CRUD REST API with end-to-end tests using modern web development techniques. A bookmarks API from scratch using NestJs, Docker, PostgreSQL, Passport.js, Prisma, Pactum and dotenv.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published