node-enterprise-starter
Version:
<h1 align="center">Node Enterprise Starter</h1>
229 lines (178 loc) ā¢ 7.9 kB
Markdown
<h1 align="center">Node Enterprise Starter</h1>
<p align="center">
<b>Production-Ready Node.js Backend Framework</b><br>
A modern, scalable, and secure foundation for building enterprise-grade applications
</p>
<p align="center">
<a href="https://github.com/abujobayer0/node-enterprise-starter"><img src="https://img.shields.io/badge/stars-200%2B-brightgreen" alt="GitHub stars"></a>
<a href="https://github.com/abujobayer0/node-enterprise-starter"><img src="https://img.shields.io/badge/coverage-99%25-brightgreen" alt="Test Coverage"></a>
<a href="https://www.npmjs.com/package/node-enterprise-starter"><img src="https://img.shields.io/badge/downloads-10k%2B-blue" alt="Downloads"></a>
<a href="https://github.com/abujobayer0/node-enterprise-starter/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a>
</p>
<p align="center">
<a href="https://node-enterprise-starter-web.vercel.app/" target="_blank"><b>š Visit the Official Documentation Site</b></a>
</p>
<hr>
## āØ Overview
**Node Enterprise Starter** is a powerful CLI tool that generates production-ready Node.js applications with enterprise-level architecture. Skip the boilerplate setup and focus on building your business logic with our battle-tested foundation.
```bash
npx node-enterprise-starter
```
<br>
## š Key Features
<table>
<tr>
<td>
<h3>š Authentication</h3>
Complete JWT authentication with access/refresh tokens and password management
</td>
<td>
<h3>š”ļø TypeScript</h3>
Built with TypeScript for robust type safety across your entire application
</td>
</tr>
<tr>
<td>
<h3>šļø MongoDB Ready</h3>
Mongoose ODM integration with models, schemas, and data validation
</td>
<td>
<h3>š„ User Management</h3>
Role-based access control system with flexible permissions
</td>
</tr>
<tr>
<td>
<h3>š Error Handling</h3>
Global error handler with custom error classes and consistent responses
</td>
<td>
<h3>š Logging</h3>
Advanced logging with request tracking and performance monitoring
</td>
</tr>
</table>
<br>
## š¦ Installation
Start your new project in one command:
```bash
# Using npm
npx node-enterprise-starter
# Using yarn
yarn dlx node-enterprise-starter
# Using pnpm
pnpm dlx node-enterprise-starter
# Using bun
bunx node-enterprise-starter
```
Our interactive CLI guides you through setup, allowing you to customize your project structure and features.
<br>
## šļø Project Structure
```
node-enterprise-starter/
āāā src/
ā āāā app/
ā ā āāā errors/ # Custom error classes
ā ā āāā middlewares/ # Express middlewares
ā ā āāā modules/ # Feature modules
ā ā ā āāā Auth/ # Authentication module
ā ā ā āāā User/ # User management module
ā ā ā āāā ...
ā ā āāā routes/ # API routes
ā ā āāā services/ # Shared services
ā ā āāā utils/ # Helper functions
ā āāā config/ # Configuration
ā āāā shared/ # Shared resources
ā ā āāā constants/ # Application constants
ā āāā app.ts # Express application
ā āāā server.ts # Server entry point
āāā .env # Environment variables
āāā .env.example # Environment template
āāā tsconfig.json # TypeScript configuration
āāā package.json # Dependencies and scripts
```
<br>
## š Module Architecture
Each feature is isolated in its own module with a clean separation of concerns:
```
Auth/
āāā auth.controller.ts # Request handlers
āāā auth.service.ts # Business logic
āāā auth.model.ts # Data models
āāā auth.validation.ts # Request validation
āāā auth.utils.ts # Helper functions
āāā auth.interface.ts # TypeScript interfaces
āāā auth.routes.ts # Route definitions
```
<br>
## š£ļø API Routes
| 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 (User) |
| `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) |
<br>
## āļø Environment Configuration
```bash
# Application
NODE_ENV=development
PORT=8000
# Database
DATABASE_URL=mongodb://localhost:27017/myapp
# Authentication
BCRYPT_SALT_ROUNDS=10
JWT_ACCESS_SECRET=supersecretaccesskey123
JWT_ACCESS_EXPIRES_IN=7d
JWT_REFRESH_SECRET=supersecretrefreshkey456
JWT_REFRESH_EXPIRES_IN=30d
# Email
EMAIL_USER=noreply@myapp.com
EMAIL_PASSWORD=password123
RESET_LINK_URL=https://myapp.com/reset-password
# Frontend
CLIENT_URL=http://localhost:3000
# Admin defaults
ADMIN_NAME=Abu Jobayer
ADMIN_EMAIL=admin@myapp.com
ADMIN_PASSWORD=adminpassword123
ADMIN_CONTACT=+1-234-567-8901
ADMIN_PROFILE_IMAGE_LINK=https://myapp.com/images/admin-profile.png
```
<br>
## š” Why Choose Node Enterprise Starter?
- **Production Ready**: Battle-tested patterns used in real-world applications
- **Developer Experience**: Clean architecture with intuitive organization
- **Scalable**: Designed to grow from small projects to enterprise applications
- **Time Saving**: Skip weeks of boilerplate setup and configuration
- **Best Practices**: Follows industry standards for Node.js and Express
- **Comprehensive**: Includes everything you need for a modern backend
<br>
## š ļø Technologies
<p>
<img src="https://img.shields.io/badge/-Node.js-339933?style=flat-square&logo=Node.js&logoColor=white" alt="Node.js" />
<img src="https://img.shields.io/badge/-Express-000000?style=flat-square&logo=express&logoColor=white" alt="Express" />
<img src="https://img.shields.io/badge/-MongoDB-47A248?style=flat-square&logo=mongodb&logoColor=white" alt="MongoDB" />
<img src="https://img.shields.io/badge/-TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
<img src="https://img.shields.io/badge/-JWT-000000?style=flat-square&logo=json-web-tokens&logoColor=white" alt="JWT" />
<img src="https://img.shields.io/badge/-REST_API-FF6C37?style=flat-square&logo=postman&logoColor=white" alt="REST API" />
</p>
<br>
## š Documentation & Support
- [**Official Documentation Site**](https://node-enterprise-starter-web.vercel.app/)
- [**GitHub Repository**](https://github.com/abujobayer0/node-enterprise-starter)
- [**Issues & Feature Requests**](https://github.com/abujobayer0/node-enterprise-starter/issues)
- [**Support**](mailto:zubayer.munna.dev@gmail.com)
<br>
## š License
This project is [MIT](https://github.com/abujobayer0/node-enterprise-starter/blob/main/LICENSE) licensed.
<br>
<p align="center">
<sub>Crafted with ā¤ļø by <a href="https://github.com/abujobayer0">Abu Jobayer</a></sub>
</p>