1.0.10 ⢠Published 6 months ago
@ranjit099/create-express-app-backend v1.0.10
š create-express-app-backend
A simple, production-ready CLI tool to scaffold a complete Express.js backend project with just one command.
š¦ Installation
1 npx create-express-app-backend my-backend
2 cd my-backend
3 npm install
4 npm start
⨠Features
ā
Production-ready folder structure
ā
Built-in MongoDB connection with Mongoose
ā
Environment variable support with .env & .env.example
ā
Sample route, controller, model, and middleware included
ā
EJS templating setup in views/
ā
Static files served from public/ (with default CSS & JS)
ā
Logging middleware sample
ā
Ready-to-use utility file
ā
Git-friendly: Includes .gitignore for user projects
ā
Works via npx or global install
š Folder Structure
my-backend-app/
āāā app.js # Main entry point
āāā .env # Your environment config
āāā .gitignore # Common ignored files
āāā config/
ā āāā db.js # MongoDB connection setup
āāā controllers/
ā āāā sampleController.js # Sample controller logic
āāā middlewares/
ā āāā logger.js # Example middleware
āāā models/
ā āāā Sample.js # Mongoose schema example
āāā public/
ā āāā css/
ā ā āāā style.css # Sample CSS
ā āāā js/
ā āāā script.js # Sample JS
āāā routes/
ā āāā sampleRoutes.js # Example Express route
āāā utils/
ā āāā helper.js # Sample utility function
āāā views/
ā āāā index.ejs # EJS template
āāā package.json # Project config
āļø Technologies Used
1 Node.js
2 Express.js
3 Mongoose
4 EJS
5 dotenv
š§ How It Works
---------------------
When you run:--
bash
Copy code
npx create-express-app-backend my-backend-app
This CLI will:
1 Copy the project template to my-backend-app/
2 Initialize it with its own package.json
3 Add basic files like .gitignore, .env, and starter code
4 Set you up for success with a clean structure.
š¤ Contributing
-----------------------------
@ Contributions, ideas, and improvements are
welcome!
1 Fork the repo
2 Make your changes
3 Submit a pull request
š License
NSEC Ā© rj-web-dev
Git :- https://github.com/ranjit800/create-express-app-backend