UNPKG

ameen-mvc

Version:

Windows-compatible MERN stack generator with MVC architecture

175 lines (120 loc) • 4.25 kB
<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>