Skip to content

SelenKockar/Node.js-Express-Prisma-Boilerplate

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published