@herambinamke/mung-dal-js
v1.0.1
Published
MERN stack boilerplate generator with complete backend structure
Maintainers
Readme
mung-dal
Mung Dal - MERN Stack Boilerplate Generator
🚀 Quickly scaffold a production-ready MERN stack backend with authentication, user management, and best practices built-in.
Features
- ✅ Complete Express.js backend structure
- ✅ MongoDB integration with Mongoose
- ✅ JWT authentication with refresh tokens
- ✅ Role-based access control
- ✅ Input validation with Joi
- ✅ Error handling middleware
- ✅ Rate limiting
- ✅ Security best practices
- ✅ Logging with Winston
- ✅ Well-organized folder structure
Quick Start
# Using npx (recommended)
npx mung-dal my-project
# Or install globally
npm install -g mung-dal
mung-dal my-projectThis will create a my-project directory with a complete backend setup.
What's Included
my-project/
└── server/
├── config/ # Database and environment config
├── models/ # Mongoose models (User, Session)
├── routes/ # API routes
├── controllers/ # Route handlers
├── services/ # Business logic
├── middlewares/ # Custom middlewares
├── validators/ # Joi validation schemas
├── utils/ # Utility functions
├── tests/ # Test structure
├── server.js # Entry point
└── .env.example # Environment templateAfter Installation
- Navigate to your project:
cd my-project/server- Set up environment variables:
cp .env.example .env
# Edit .env with your MongoDB URI and secrets- Start the development server:
npm run devYour server will be running on http://localhost:5000
API Endpoints
Authentication
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/refresh- Refresh access tokenPOST /api/auth/logout- LogoutGET /api/auth/profile- Get profile (protected)
Users
GET /api/users- Get all users (admin only)GET /api/users/:id- Get user by ID (admin only)PUT /api/users/:id- Update user (admin only)DELETE /api/users/:id- Delete user (admin only)PUT /api/users/profile- Update own profile (protected)
Health
GET /api/health- Health check
Requirements
- Node.js 14+
- MongoDB (local or Atlas)
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository: https://github.com/HerambInamke/mung-dal
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
