Skip to content

Latest commit

 

History

History
85 lines (51 loc) · 2.07 KB

File metadata and controls

85 lines (51 loc) · 2.07 KB

Node.js-Express-Prisma-Boilerplate

This is a backend project developed for a Botanalytics case study, featuring secure user authentication with registration, login, logout, bcrypt encryption, and JWT token authentication, complemented by comprehensive unit tests.

Getting Started

Clone the Project:

  git clone https://github.com/SelenKockar/Node.js-Express-Prisma-Boilerplate.git

Navigate to the Project Directory:

  cd Node.js-Express-Prisma-Boilerplate

Enviroment Variables

To run this project, you need to configure the required environment variables by renaming the .env.example file. Simply remove the .example extension to create your .env file with your specific settings.

Installation

Install Dependencies:

  npm install

Build, Fetch, and Run Docker Containers:

  docker-compose up -d

Generate the Prisma Client:

  npm run db:generate

Migrate Database with Prisma:

  npm run db:migrate:dev

Start the Server:

  npm run start

Unit testing

To run the tests, execute the following command:

  npm test

Postman

A Postman collection for this project is available here

Endpoints

Method URL Description
POST /auth/signup Registers a new user account.
POST /auth/login Authenticates and logs in a user.
POST /auth/logout Logs out a currently authenticated user.
GET /auth/protected Validates user authentication status.

Technologies Used

Database: PostgreSQL

Server: Node, Express, Prisma