ameen-mvc
Version:
Windows-compatible MERN stack generator with MVC architecture
175 lines (120 loc) ⢠4.25 kB
Markdown
<div align="center">
# š ameen-mvc - A Modern MERN Stack CLI Generator
<p align="center">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome" />
<img src="https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square" alt="License" />
<img src="https://img.shields.io/badge/MERN-Stack-blue.svg?style=flat-square" alt="MERN Stack" />
</p>
A CLI tool to generate a modern, Windows-compatible MERN stack project with MVC architecture.
</div>
## š Overview
**ameen-mvc** is a simple and efficient CLI tool to generate a MERN (MongoDB, Express.js, React, Node.js) stack project with a clean MVC architecture. It helps developers set up a full-stack project within seconds.
## ⨠Features
ā
**MERN Stack Ready** - Generates a full-stack project with backend and frontend.
ā
**MVC Architecture** - Organized file structure for scalability.
ā
**Windows-Compatible** - Ensures smooth setup on Windows.
ā
**Pre-configured Scripts** - Includes development, production, and deployment scripts.
ā
**Authentication Middleware** - JWT-based authentication setup included.
ā
**MongoDB Configuration** - Pre-set for database connection with `.env` support.
ā
**Git Initialization** - Initializes a Git repository for easy version control.
## š ļø Installation
To install the CLI globally on your system, run:
```sh
npm install -g ameen-mvc
```
## š Usage
To create a new MERN project, run:
```sh
ameen-mvc myProject
```
This will:
ā Create a new `myProject/` directory.
ā Generate a MERN MVC folder structure.
ā Install backend dependencies.
ā Initialize Git.
ā Create a React frontend inside `client/`.
## š Project Structure
```bash
myProject/
āāā client/ # React frontend (Generated using create-react-app)
āāā controllers/ # Business logic (MVC)
āāā models/ # Mongoose schemas
āāā routes/ # Express routes
āāā middleware/ # JWT authentication, logging, etc.
āāā config/ # Database connection
āāā utils/ # Helper functions
āāā tests/ # Test cases
āāā .gitignore # Ignoring unnecessary files
āāā .env # Environment variables
āāā package.json # Project metadata & scripts
āāā server.js # Express server entry point
āāā README.md # Project documentation
```
## š Available Scripts
Inside your generated project, you can run:
š¹ **Start Backend Server**
```sh
npm start
```
š¹ **Start React Frontend**
```sh
cd client
npm start
```
š¹ **Run Both Backend & Frontend Together**
```sh
npm run dev
```
š¹ **Install Frontend Dependencies**
```sh
npm run install-client
```
š¹ **Build Frontend for Production**
```sh
npm run build
```
## ā Configuration
Before running the project, configure your `.env` file:
```ini
MONGODB_URI=mongodb://localhost:27017/your-database
JWT_SECRET=your-secret-key
PORT=5000
```
## š Dependencies
### **Backend**
- Express.js
- Mongoose
- Morgan
- Helmet
- Compression
- Cors
- Dotenv
- JWT Authentication
### **Development Tools**
- Nodemon
- Concurrently
## š Contributing
Contributions are welcome! Follow these steps:
1. Fork this repository.
2. Create a feature branch:
```sh
git checkout -b feature-newFeature
```
3. Commit your changes:
```sh
git commit -m "feat: add new feature"
```
4. Push to your branch:
```sh
git push origin feature-newFeature
```
5. Open a Pull Request.
## š License
This project is licensed under the MIT License - feel free to use and modify it!
## ā Show Some Love
If you found this tool useful, please ā star this repository on GitHub! š
š **GitHub Repo**: [ameen-mvc](https://github.com/Muhammed-Ameen-T/ameen-mvc-npm-package))
š **NPM Package**: [ameen-mvc](https://www.npmjs.com/package/ameen-mvc/))
<div align="center">
**Thank you for using ameen-mvc! š**
</div>