Comprehensive documentation to help you build scalable Node.js applications with our enterprise-ready boilerplate
Choose your package manager:
npx node-enterprise-starter
1. Enter your project name
2. Select your package manager
3. Wait for the setup to complete
4. cd node-enterprise-starter
5. npm run dev
User-friendly command line interface that guides you through the setup process step by step.
Get your development server up and running in seconds with all dependencies pre-configured.
No complex configuration required. Just install and start building your application logic.
NODE_ENV | development | Application environment |
PORT | 8000 | Server port |
DATABASE_URL | mongodb://localhost:27017/myapp | MongoDB connection string |
BCRYPT_SALT_ROUNDS | 10 | Password hashing strength |
JWT_ACCESS_SECRET | supersecretaccesskey123 | JWT access token secret key |
JWT_ACCESS_EXPIRES_IN | 7d | JWT access token expiry |
JWT_REFRESH_SECRET | supersecretrefreshkey456 | JWT refresh token secret key |
JWT_REFRESH_EXPIRES_IN | 30d | JWT refresh token expiry |
EMAIL_USER | noreply@myapp.com | Email service username |
EMAIL_PASSWORD | password123 | Email service password |
RESET_LINK_URL | https://myapp.com/reset-password | Password reset link URL |
CLIENT_URL | http://localhost:3000 | Frontend application URL |
ADMIN_PROFILE_IMAGE_LINK | https://myapp.com/images/admin-profile.png | Default admin profile image |
ADMIN_CONTACT | +1-234-567-8901 | Admin contact information |
ADMIN_PASSWORD | adminpassword123 | Admin default password |
ADMIN_EMAIL | admin@myapp.com | Admin email address |
ADMIN_NAME | Abu Jobayer | Admin display name |
Rename .env.example > .env
Configure your MongoDB connection string in DATABASE_URL
Set secure values for JWT secrets and admin credentials
Configure email settings if you plan to use password reset functionality
After connecting to the MongoDB server, the admin user will be auto-seeded
node-enterprise-starter/ ├── src/ │ ├── app/ │ │ ├── errors/ │ │ ├── middlewares/ │ │ ├── modules/ │ │ │ ├── Auth/ │ │ │ ├── User/ │ │ │ └── ... │ │ ├── routes/ │ │ └── services/ │ │ ├── utils/ │ ├── config/ │ ├── shared/ │ │ ├── constants/ | ├── app.ts │ └── server.ts ├── .env ├── .env.example ├── tsconfig.json └── package.json
Auth/ └── auth.controller.ts └── auth.service.ts └── auth.model.ts └── auth.validation.ts └── auth.utils.ts └── auth.interface.ts └── auth.routes.ts User/ └── user.controller.ts └── user.service.ts └── user.model.ts └── user.validation.ts └── user.utils.ts └── user.interface.ts └── user.routes.ts
Each feature is isolated in its own module with a clean separation of concerns between controllers, services, and data models.
Built with TypeScript to ensure type safety across your entire application with interface definitions for all models.
Follows enterprise patterns that allow your application to scale from small projects to large, complex systems.
Method | Route | Description | Auth Required |
---|---|---|---|
POST | /api/v1/auth/login | User login | No |
POST | /api/v1/auth/register | User registration | No |
POST | /api/v1/auth/forgot-password | Request password reset | No |
POST | /api/v1/auth/reset-password | Reset password | No |
POST | /api/v1/auth/change-password | Change password | Yes |
GET | /api/v1/users | Get all users | Yes (Admin) |
GET | /api/v1/users/profile | Get current user profile | Yes |
GET | /api/v1/users/:id | Get user by ID | Yes |
PATCH | /api/v1/users/:id | Update user | Yes |
DELETE | /api/users/:id | Delete user | Yes (Admin) |
Complete JWT authentication with access and refresh tokens, password reset, and account management.
Mongoose ODM setup with models, schemas, and data validation for MongoDB interaction.
Zod schema validation to ensure all API requests match expected data formats and types.
User roles and permissions system with middleware for protecting routes based on user roles.
Global error handler with custom error classes and consistent API error responses.
Environment-based configuration system for managing different deployment environments.
Swagger UI integration for interactive API documentation and testing endpoints.
Advanced logging system with request tracking, error logging, and performance monitoring.