Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ MERN Projects Hub πŸ’» πŸ”₯

πŸ’» πŸ”₯ Hub for full-stack MERN applications & experiments! ⚑ Powered by MongoDB, Express, React & Node.js πŸ› οΈ Featuring CRUD operations, REST APIs πŸ”—, state management πŸ“Š & responsive UI 🎨. Real-time features ⚑, clean architecture πŸ—οΈ & live deployments 🌐!

Welcome to the ultimate MERN Projects Hub! ⚑ This repository serves as a central collection for building, experimenting with, and deploying full-stack web applications powered by the MERN Stack (MongoDB, Express.js, React.js, Node.js).

From fundamental CRUD operations to advanced real-time applications, this space is dedicated to showcasing scalable, modern web architecture, clean code practices, and production-ready implementations.


πŸ› οΈ Key Technologies & Core Concepts

  • Frontend Architecture: Built with React (useState, useEffect), utilizing Axios for async HTTP calls (GET, POST, PUT, DELETE), react-router-dom for dynamic routing (useParams, useNavigate), and Bootstrap for responsive styling.
  • Backend Infrastructure: Modular RESTful APIs engineered with Node.js & Express.js, structured using Express Routers, custom middlewares, and controller logic.
  • Database Persistence: Scalable document modeling via MongoDB & Mongoose, implementing queries like findById, findByIdAndUpdate, and findByIdAndDelete.
  • Full-Stack REST Architecture: Seamless integration between React frontend and Express backend with cross-origin communication handled via CORS.
  • DevOps & Environment Setup: Secure configuration using dotenv environment variables, clean project architecture, and production-ready code structure.

πŸ’‘ What's Inside This Repository?

This workspace continuously expands to include diverse full-stack solutions and modular components:

  • πŸ”— Full-Stack Applications: End-to-end integration of React frontends with Express/Node APIs.
  • βš™οΈ CRUD Systems: Complete Create, Read, Update, and Delete data operations.
  • πŸ“Š State & Data Management: Optimized state persistence and API data fetching.
  • 🎨 Responsive UI/UX: Clean, accessible layouts designed for desktop, tablet, and mobile views.

πŸ’» Projects Included

πŸ‘₯ MERN CRUD User Management System

Main Folder: CRUD_Project/

Subfolders: backend/ (Node/Express API) & frontend/ (React SPA)

A full-stack user management module built on the MERN stack, offering dynamic record operations, MongoDB Atlas persistence, and instant UI state synchronization.

  • Features:
    • Fetch and render all stored user records on the main dashboard (GET /api).
    • Add new user entries via form inputs with built-in validation (POST /api/create).
    • Pre-populate dynamic user data for inline profile modifications (GET /api/getuser/:id & PUT /api/update/:id).
    • Delete user entries instantly with direct MongoDB sync and state re-rendering (DELETE /api/delete/:id).
    • Serverless architecture support with configured route rewrites for cloud deployments (vercel.json).
  • Concepts: Modular Express Routing, Mongoose Schema Modeling, Axios relative paths, React Hooks (useState, useEffect, useParams, useNavigate), Client-side Routing (react-router-dom), Bootstrap 5 Layouts.

✨ Features

  • πŸ›οΈ Monorepo / Multi-Project Ecosystem – Centralized repository housing scalable MERN modules, CRUD applications, and expanding backend services.
  • πŸ—οΈ Full-Stack MERN Architecture – End-to-end integration connecting decoupled React single-page applications with Node.js & Express RESTful APIs.
  • ⚑ Axios API Integration – Asynchronous client-side HTTP request handling utilizing normalized paths for real-time frontend-backend communication.
  • πŸ”„ Real-Time CRUD Operations – Instant UI updates and client state re-rendering on User Creation, Retrieval, Updates, and Deletions.
  • πŸ—„οΈ MongoDB & Mongoose Schema Design – Structured document schemas, explicit data validation, and persistent cloud data management via MongoDB Atlas.
  • 🌐 Dynamic Client-Side Routing – Multi-view navigation and parameter matching managed via React Router DOM.
  • 🎨 Responsive UI Layer – Dynamic dark-themed views, adaptive table layouts, and interactive forms styled with Bootstrap 5.
  • πŸš€ Production-Ready Serverless Deployment – Cloud deployment configurations utilizing custom vercel.json rewrites and serverless function entry points.
  • βš™οΈ Centralized Environment Vault – Secure handling of environment configurations (MONGO_URL, PORT) via .env integration across modules.
  • ⚑ Optimized Developer Workflow – Rapid frontend development powered by Vite combined with backend hot-reloading tooling.

πŸ› οΈ Tech Stack & Dependencies

Tool / Library Type Purpose
Node.js Runtime Server-side JavaScript execution environment
Express.js Backend Framework Web framework for handling RESTful API routes & HTTP requests
React.js Frontend Library Declarative UI library for building component-based client views
MongoDB Atlas Database Cloud-hosted NoSQL document database for user data storage
Mongoose Backend ODM Schema-based data modeling and async queries for MongoDB
Axios Frontend HTTP Client Promise-based client for sending HTTP requests to backend endpoints
React Router DOM Client Routing Declarative routing for single-page dynamic view navigation
Bootstrap 5 Frontend Styling Responsive component layout, tables, forms, and dark-theme views
Vite Frontend Tooling High-performance build tool and hot-reloading dev server
Nodemon Dev Dependency Automatically restarts Node app when server-side file changes occur
dotenv Utility Loads environment variables from .env file into process.env
CORS Backend Middleware Enables cross-origin resource sharing between React and Express
Vercel Hosting / Serverless Platform for deploying frontend SPA and serverless backend API functions
Postman API Client Manual testing tool for REST endpoints (GET, POST, PUT, DELETE)

πŸ“‚ Project Directory Structure

Generated: 8/7/2026, 4:55:19 PM Root Path: workspace\MERN_Projects

πŸ“ MERN_Projects
β”œβ”€β”€ πŸ“‚ CRUD_Project
β”‚   β”œβ”€β”€ πŸ“„ vercel.json
β”‚   β”œβ”€β”€ ⚑ backend
β”‚   └── πŸ’» frontend
β”œβ”€β”€ πŸ“„ LICENSE
β”œβ”€β”€ πŸ™ˆ .gitignore
└── πŸ“ README.md

🌐 Deployment & Environment Setup

1. MongoDB Atlas Configuration

Before deploying, ensure your database access is open to Vercel:

  1. Go to MongoDB Atlas.
  2. Navigate to Network Access under Security.
  3. Click Add IP Address and select Allow Access from Anywhere (0.0.0.0/0).
  4. Save changes.

2. Environment Variables on Vercel

Set up your environment variables in Vercel before or after deployment:

  1. In your Vercel Project Dashboard, go to Settings βž” Environment Variables.
  2. Add your environment key-value pairs (e.g., MONGO_URL, JWT_SECRET, PORT).
  3. ⚠️ Important Requirement:
    • Ensure Production, Preview, and Development targets are ALL CHECKED.
    • DO NOT toggle on the "Sensitive" option for MONGO_URL to prevent variable save/sync issues.

3. Deploy to Vercel

  1. Push your latest code to GitHub.
  2. Go to vercel.com and log in.
  3. Click "New Project".
  4. Connect your GitHub repository.
  5. Select/Connect the exact project root folder containing package.json (to avoid nested directory deployment issues).
  6. Configure Build Settings:
    • Vercel automatically detects Vite/Node settings.
    • Toggle the "Build Command" switch and manually type npm run build to override it (if using a build step).
  7. Ensure all Environment Variables (MONGO_URL, etc.) are added under the project settings.
  8. Click "Deploy".

πŸ’‘ Note: If you edit or update any Environment Variable after deploying, always go to the Deployments tab, click the three dots (...) on the latest deployment, and select Redeploy to apply changes! & Make sure your project structure strictly follows the root layout:

Project_Folder/
β”œβ”€β”€ backend/
β”œβ”€β”€ frontend/
└── vercel.json

πŸ“¦ MERN Stack: Frontend Architecture Setup Guide

This documentation provides a step-by-step guide to setting up a production-ready Frontend Workspace for a MERN stack application using React + Vite. It covers project initialization, dependency configuration, and local setupβ€”preparing the UI layer to seamlessly connect with an Express/Node.js backend.

1. Initialize Vite Project

Run the following command in your terminal:

npm init vite

During the prompt configuration, fill out the selections exactly like this:

Proceed? y

Project Name: name

Package Name: name

Select a framework: React

Select a variant: JavaScript

Select oxlintrc? Yes

Install with npm? Yes


πŸ’» How to Run the frontend of the MERN Project Locally

If you want to pull this project and run it again locally, simply execute these commands:

# Navigate to the project folder
cd Project_dir

# create node_modules folder by running this command  
npm i

# Start the local development server
npm run dev

2. Installing Core Dependencies for MERN Stack Backend

Run this command inside your project directory to install npm pakages in pakages.json file:

npm i axios
npm i react-router-dom
npm i bootstrap

It automatically Create package.json if not exists. Like

{
  "name": "frontend",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "oxlint",
    "preview": "vite preview"
  },
  "dependencies": {
    "axios": "^1.19.0",
    "bootstrap": "^5.3.8",
    "react": "^19.2.8",
    "react-dom": "^19.2.8",
    "react-router-dom": "^7.18.2"
  },
  "devDependencies": {
    "@types/react": "^19.2.17",
    "@types/react-dom": "^19.2.3",
    "@vitejs/plugin-react": "^6.0.4",
    "oxlint": "^1.75.0",
    "vite": "^8.2.0"
  }
}

Note: Install packages when needed


πŸ“¦ MERN Stack: Backend Architecture Setup Guide

1. Installing Node.js & NPM

Download and install the LTS version from Node.js Official Site. Verify installation in your terminal:

node -v
npm -v

2. Installing MongoDB Community Server & Mongosh

  1. Download MongoDB Community Server from MongoDB Download Center.
  2. Download MongoDB Shell (mongosh) to run CLI database operations.
  3. Start the local server daemon:
# Verify connection using mongosh CLI
mongosh

3. Setting Up package.json with ES Modules

Initialize your Node project inside any project directory:

npm init

During the prompt configuration, fill out the selections like this:

package name: (name)

version: (1.0.0)

description: may add ​ entry point: (app.js)​

test command: just enter​

git repository: (https://github.com/username/repo_name.git)

keywords: may add

author: may add

license: (ISC) may be MIT for open source

type: (commonjs) recommended module

Is this OK? (yes)


πŸ’» How to Run the backend of the MERN Project Locally

If you want to pull this project and run it again locally, simply execute these commands:

# Navigate to the project folder
cd Project_dir

# create node_modules folder by running this command  
npm i

# Start the local development server
npm start

To enable modern ES6 import/export syntax instead of require(), open package.json and add "type": "module":

{
  "name": "node",
  "version": "1.0.0",
  "bugs": {
    "url": "https://github.com/username/repo/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/username/repo.git"
  },
  "license": "ISC",
  "author": "",
  "type": "commonjs",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node app.js" // add manually write "nodemon index.js" if installed
  }
}

4. Installing Core Dependencies for MERN Stack Backend

Run this command inside your project directory to install npm pakages in pakages.json file:

npm i express
npm i mongoose
npm i nodemon
npm i cors
npm i dotenv

It automatically Create package.json if not exists. Like

{
  "name": "pakage name",
  "version": "1.0.0",
  "description": "Something",
  "keywords": [
    "keywords"
  ],
  "homepage": "https://github.com/github.com/username#readme",
  "bugs": {
    "url": "https://github.com/github.com/username/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/github.com/username.git"
  },
  "license": "MIT",
  "author": "Author",
  "type": "module",
  "main": "app.js",
  "scripts": {
    "start": "nodemon app.js"
  },
  "dependencies": {
    "cors": "^2.8.6",
    "dotenv": "^17.4.2",
    "express": "^5.2.1",
    "mongoose": "^9.9.1",
    "nodemon": "^3.1.14"
  }
}

Note: Install packages when needed


πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm package manager
  • Basic knowledge of React and JavaScript

πŸ“š Learning Resources


πŸ‘€ Author

MehmoodCoder


πŸ“„ License

This project is open source and available under the MIT License.


🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ Changelog

v1.0.0 (Initial Release)

  • ✨ Full-Stack MERN Architecture: Initialized central hub structure for integrated frontend client and backend REST API services.
  • 🎨 Responsive UI Layer: Integrated dynamic dark theme views, table-to-card mobile responsive views, and Bootstrap UI enhancements.
  • βš™οΈ CRUD Systems & Routing: Configured React client routing for seamless navigation across User creation, update, and management states.
  • πŸ›‘οΈ Form Handling & Validation: Built interactive forms with explicit input validation and dynamic data binding.
  • πŸš€ Production-Ready Baseline: Configured build scripts and baseline project setup protocols for scalable feature expansions.

Happy coding without chai ! β˜•

About

πŸš€ MERN_Projects πŸ’» πŸ”₯ Hub for full-stack MERN applications & experiments! ⚑ Powered by MongoDB, Express, React & Node.js πŸ› οΈ Featuring CRUD operations, REST APIs πŸ”—, state management πŸ“Š & responsive UI 🎨. Real-time features ⚑, clean architecture πŸ—οΈ & live deployments 🌐!

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages