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.
- Runtime: Node.js
- Language: TypeScript
- ORM: Prisma
- Database: PostgreSQL (via Docker)
- Testing: Jest
- Auth: JWT (AccessToken + RefreshToken logic)
-
Environment Configuration: Clone
.env.templateand create a new.envfile with your local credentials. -
Install Dependencies:
npm i -
Start Local Database: Launch the database services defined in the docker configuration:
docker compose up -d -
Database Migrations: If this is your first time setting up the project or if there are schema changes:
npm run prisma:migrate:prod -
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
The project uses Jest for unit and integration testing. To run the tests, execute:
npm test
Currently, the project is configured to use the same database for both Development and Testing.
- Future Improvement: Ideally, a separate
.env.testshould 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.