create-express-app-starter
v1.2.3
Published
CLI tool to quickly bootstrap an Express.js server template with MongoDB Mongoose setup
Maintainers
Readme
create-express-app-starter
A lightweight, zero-config CLI tool to instantly bootstrap production-ready Node.js + Express + MongoDB (Mongoose) REST APIs with ES Modules.
✨ Features
- 🚀 Zero-Config Generation: Bootstrap a complete Express boilerplate in seconds.
- 🧹 Automatic Fail-Safe Cleanup: If installation fails, created files are automatically rolled back.
- 📦 ES Modules Native: Native
import/exportsupport ("type": "module"). - 🗄️ MongoDB & Database Name Config: Specify custom
DB_NAMEalongsideMONGO_URIin.env. - 📁 Clean & Detailed Architecture: Pre-configured MVC layout (
controllers/,models/,routes/,Database/). - ⚡ Optimized Fast Setup: Fast dependency installation with
oraprogress spinners. - 💻 Cross-Platform: Fully compatible with Windows, macOS, and Linux.
🚀 Quick Start
Run inside any empty directory:
mkdir my-api
cd my-api
npm create express-app-starterOr using npx:
npx create-express-app-starter⚙️ Environment Configuration (.env)
PORT=3000
MONGO_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net
DB_NAME=my_express_dbThe database connection in Database/db.js automatically consumes DB_NAME from your .env configuration.
🏃 Running Your Application
npm startServer starts automatically with nodemon at http://localhost:3000.
📂 Project Structure
my-api/
├── Database/
│ └── db.js # Mongoose connection with DB_NAME setup
├── controllers/
│ └── controller.js # Detailed async sample controller
├── models/
│ └── model.js # Detailed sample Mongoose schema
├── routes/
│ └── route.js # Express router (/api/sample)
├── .env # Environment variables (PORT, MONGO_URI, DB_NAME)
├── .gitignore # Ignores node_modules and .env
├── index.js # Express app entry point
├── package.json # Dependencies & scripts
└── README.md # Generated documentation📄 License
Distributed under the MIT License. See LICENSE for more information.
