All Projects
Side Project

Nest-Zero Template

Year Built

2025

Tech Stack

NestJSPrismaMySQLPassportZod

๐Ÿ‡ฎ๐Ÿ‡ฉ Baca versi Bahasa Indonesia Nest Zero Logo

๐Ÿš€ Nest Zero

A modular starter project built with NestJS + Prisma ORM featuring a clean and extensible architecture. Perfect for developing modern APIs with local & OAuth authentication, validation, logging, and production-ready setups.

NestJS Prisma License


๐Ÿ“Œ Features

โœ… User registration and login with local authentication (email + password)
โœ… OAuth login support (Google, Github, etc.) with extensible strategy
โœ… Prisma ORM (PostgreSQL/SQLite)
โœ… Request validation using Zod
โœ… Structured logging with Winston
โœ… Clean and modular architecture (clean architecture)
โœ… Test service to support e2e testing


๐Ÿ—‚๏ธ Folder Structure


src/
โ”œโ”€โ”€ auth/           # Endpoints and authentication logic
โ”œโ”€โ”€ user/           # Endpoints and user logic
โ”œโ”€โ”€ common/         # Shared services such as Prisma & Validation
โ”œโ”€โ”€ model/          # DTOs and response models
โ””โ”€โ”€ app.module.ts


โš™๏ธ How to Run the Project

1๏ธโƒฃ Install dependencies

npm install

2๏ธโƒฃ Generate Prisma Client

npx prisma generate

3๏ธโƒฃ Run database migrations (optional, if using schema migrations)

npx prisma migrate dev

4๏ธโƒฃ Start the development server

npm run start:dev

๐Ÿงช Testing

Run all unit & e2e tests:

npm run test

๐Ÿ“ฌ Main Endpoints

  • POST /api/user/register โ†’ Register a new user.
  • POST /api/auth/login โ†’ Login using email & password.
  • POST /api/auth/oauth โ†’ Login using a token from an OAuth provider (Google, Github, etc.).

๐Ÿ—๏ธ Main Modules

  • AuthModule: local & OAuth authentication
  • UserModule: user registration and management
  • CommonModule: PrismaService, ValidationService, global logger
  • Model: DTO and response definitions

๐Ÿ›ก๏ธ Security

  • Passwords are stored hashed with bcrypt.
  • Access tokens use JWT with configurable expiry.
  • Rate limiting, helmet, and CORS can be added for production requirements.

๐Ÿ“ˆ Contribution

Contributions are very welcome! Feel free to fork this project, create a new branch for your feature/bugfix, and submit a pull request.


๐Ÿ“„ License

This project is released under the MIT License ยฉ 2025 Kikuk Afandi.

End of Project Documentation. Explore other works.