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.
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
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.
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
To run the tests, execute the following command:
npm test
A Postman collection for this project is available here
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. |
Database: PostgreSQL
Server: Node, Express, Prisma