Skip to content

conraaad/node-ts-prisma-template

Repository files navigation

Node.js + TypeScript + Prisma Boilerplate

This is a production-ready project template designed to jumpstart your backend development. It comes pre-configured with a robust authentication system and a modern development workflow.

🛠 Tech Stack

  • Runtime: Node.js
  • Language: TypeScript
  • ORM: Prisma
  • Database: PostgreSQL (via Docker)
  • Testing: Jest
  • Auth: JWT (AccessToken + RefreshToken logic)

⚙️ Setup Instructions

  1. Environment Configuration: Clone .env.template and create a new .env file with your local credentials.

  2. Install Dependencies:

    npm i
    
  3. Start Local Database: Launch the database services defined in the docker configuration:

    docker compose up -d
    
  4. Database Migrations: If this is your first time setting up the project or if there are schema changes:

    npm run prisma:migrate:prod
    
  5. Seed the Database: Populate the database with initial test data (Admin, Users, and Todos).

    Note: The script will prompt you in the terminal to confirm if you want to wipe the existing database records before seeding.

    npm run seed
    

🧪 Testing

The project uses Jest for unit and integration testing. To run the tests, execute:

npm test

⚠️ WARNING: Shared Database for Dev & Testing

Currently, the project is configured to use the same database for both Development and Testing.

  • Future Improvement: Ideally, a separate .env.test should be created to point to a dedicated testing database to avoid accidental data loss during development workflows. If so, Jest configuration must be updated to use this separate environment file.

About

Node.js + TS + Prisma starter with built-in Auth

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors