MERN Project Generator CLI
Generate a complete MERN stack project with a single command! 🚀
MERN Project Generator CLI is a powerful command-line tool designed to jumpstart your MERN (MongoDB, Express, React, Node.js) stack projects. With just one command, you can scaffold a complete project structure for both backend and frontend, following best practices and including essential configurations.
Key Features
- Full MERN Stack Setup: Generate both backend and frontend projects in one go.
- Best Practices Built-in: The generated projects follow industry-standard best practices for MERN stack development.
- Customizable: Easy to extend and customize to fit your specific project needs.
- Instant Development Ready: Start coding your application logic immediately after generation.
Installation
To install the CLI globally, use npm
:
npm install -g mern-project-cli
Usage
To create a new MERN project, run:
mern-project-cli your-project-name
Replace your-project-name
with your desired project name.
Generated Project Structure
The CLI generates the following structure:
your-project-name/
├── backend/
│ ├── controllers/
│ ├── db/
│ ├── middlewares/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ ├── .env.example
│ ├── .gitignore
│ ├── constants.js
│ ├── package.json
│ ├── README.md
│ └── server.js
└── frontend/
├── (Create React App structure)
└── .env.example
Features
Backend
- Express.js server setup
- MongoDB connection ready (using Mongoose)
- Environment variable configuration
- Basic error handling
- Modular architecture
Frontend
- Create React App setup
- Environment variable configuration
Getting Started
After generating your project:
-
Navigate to the backend directory:
cd your-project-name/backend
-
Create a .env
file based on .env.example
and configure your environment variables.
-
Start the backend server:
npm run dev
-
In a new terminal, navigate to the frontend directory:
cd your-project-name/frontend
-
Start the React development server:
npm start
Customization
Feel free to modify the generated files to fit your specific project requirements. The structure is designed to be easily extendable.
Requirements
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.