ad-ex-start
v1.0.4
Published
A CLI tool to create Express.js + MongoDB projects with modern setup and utilities
Maintainers
Readme
🚀 ad-ex-start
A CLI tool to create Express.js + MongoDB backend projects with modern setup and best practices.
✨ Features
- Express.js with modern middleware setup
- MongoDB connection with Mongoose
- CORS enabled for frontend integration
- Morgan logging for development
- Environment variables configuration
- Modular structure (routes, controllers, db)
- ES6 Modules support
🚀 Quick Start
Create a new backend project:
npx ad-ex-start my-backend-api
cd my-backend-api
npm run devOr install globally:
npm install -g ad-ex-start
ad-ex-start my-backend-api📁 Generated Project Structure
my-backend-api/
├── server.js # Main Express server
├── routes/
│ └── firstRoute.js # Example API route
├── controllers/ # Business logic (empty, ready for your code)
├── db/
│ └── connectDB.js # MongoDB connection setup
├── .env # Environment variables
├── .gitignore # Git ignore rules
└── package.json # Dependencies and scripts🛠️ What's Included
Server Setup
// Auto-configured Express server with:
- CORS for cross-origin requests
- JSON body parsing
- Morgan request logging
- MongoDB connection
- Environment variables supportDatabase Configuration
// MongoDB setup with Mongoose
- Auto-connection on server start
- Error handling
- Custom database namingDevelopment Ready
- Hot reload with nodemon
- Environment variables with dotenv
- Request logging for debugging
- Error handling setup
📝 Environment Variables
Your generated project includes:
MONGODB_URI=mongodb://localhost:27017
PORT=8000🔗 Default API Endpoints
- GET
/api/v1/- Test endpoint that returns "Hello World"
📋 Prerequisites
- Node.js (v14 or higher)
- MongoDB running locally or connection string
🎯 Perfect For
- REST APIs
- Backend services
- Microservices
- CRUD applications
- MongoDB-based projects
📚 Learn More
🤝 Contributing
Feel free to submit issues and enhancement requests!
📄 License
MIT License - see LICENSE file for details.
