๐ฎ๐ฉ Baca versi Bahasa Indonesia
๐ 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.
๐ 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.