A production-ready Node.js backend template built with Clean Architecture principles to keep your codebase:
- Maintainable
- Scalable
- Testable
- Framework-independent
Inspired by industry best practices and Uncle Bob’s Clean Architecture.
API Routes / Page Routes
│
▼
Controllers
│
▼
Use Cases
│
▼
Domain Services
│
▼
Repositories
│
▼
Database(s)
This project follows a layered design ensuring clear separation of concerns:
Routes, Controllers, Middleware, Serializers
Use Cases, Orchestration, Business Flow
Entities, Business Rules, Core Services, Interfaces
Repositories, Databases, External Integrations
Business logic does not depend on Express, databases, or external services.
Use the same use cases in API, CLI, background workers, jobs, etc.
Easily swap:
- Express → Fastify / Nest
- MongoDB → PostgreSQL / MySQL
- Redis / S3 / Firebase without touching core logic.
Clean structure supports large applications and microservice evolution.
Clear conventions = easy onboarding and long-term health.
Core
- Node.js
- Express.js
Databases
- Sequelize (SQL)
- Mongoose (MongoDB)
Security
- Passport.js
- JWT
- CSRF
- Rate limiting
Extras
- Multer file upload
- Socket support
- Redis cache
- Bootstrap frontend support
- Mocha tests
- Node.js 14+
- MongoDB
- MySQL
- Redis
git clone https://github.com/waiphyo285/nodejs-template.git
cd nodejs-template
npm install
cp .env.example .env
npm run dev
Visit:
http://localhost:8765
Contributions, issues, and feature requests are welcome.
MIT License
