π» π₯ 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.
- Frontend Architecture: Built with React (
useState,useEffect), utilizing Axios for async HTTP calls (GET,POST,PUT,DELETE),react-router-domfor 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, andfindByIdAndDelete. - 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
dotenvenvironment variables, clean project architecture, and production-ready code structure.
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.
Main Folder:
CRUD_Project/Subfolders:
backend/(Node/Express/TypeScript REST API) &frontend/(React/TypeScript SPA)
A full-stack user management module built on the MERN stack and migrated to TypeScript with strict type safety, offering dynamic record operations, MongoDB Atlas persistence, and instant UI state synchronization.
Live App π : https://mh56-crud-project.vercel.app/
- Features:
- Fetch and render all stored user records on the main dashboard (
GET /api) with robust array safety checks. - Add new user entries via form inputs with strict type 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) and optimized Vite builds.
- Fetch and render all stored user records on the main dashboard (
- Concepts: Full-stack TypeScript architecture (
.ts,.tsx,IUser), strict type checking (noImplicitAny), modular Express routing, Mongoose schema modeling, Axios relative paths, React Hooks (useState,useEffect,useParams,useNavigate), client-side routing (react-router-dom), Bootstrap 5 layouts, and modern ESM runtime execution viatsx.
| Tool / Library | Type | Purpose |
|---|---|---|
| TypeScript | Language / Superset | Adds static typing, robust interfaces, and error prevention across frontend and backend |
| Node.js | Runtime | Server-side JavaScript/TypeScript 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 (.tsx) |
| 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 optimized ESM bundling pipeline |
| 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) |
Generated: 8/7/2026, 4:55:19 PM
Root Path: workspace\MERN_Projects
π MERN_Projects
βββ π CRUD_Project
β βββ π vercel.json
β βββ π README.md
β βββ β‘ backend
β βββ π» frontend
βββ π LICENSE
βββ π .gitignore
βββ π README.md
Before deploying, ensure your database access is open to Vercel:
- Go to MongoDB Atlas.
- Navigate to Network Access under Security.
- Click Add IP Address and select Allow Access from Anywhere (
0.0.0.0/0). - Save changes.
Set up your environment variables in Vercel before or after deployment:
- In your Vercel Project Dashboard, go to Settings β Environment Variables.
- Add your environment key-value pairs (e.g.,
MONGO_URL,JWT_SECRET,PORT). β οΈ Important Requirement:- Ensure Production, Preview, and Development targets are ALL CHECKED.
- DO NOT toggle on the "Sensitive" option for
MONGO_URLto prevent variable save/sync issues.
- Push your latest code to GitHub.
- Go to vercel.com and log in.
- Click "New Project".
- Connect your GitHub repository.
- Select/Connect the exact project root folder containing
package.json(to avoid nested directory deployment issues). - Configure Build Settings:
- Vercel automatically detects Vite/Node settings.
- Toggle the "Build Command" switch and manually type
npm run buildto override it (if using a build step).
- Ensure all Environment Variables (
MONGO_URL, etc.) are added under the project settings. - 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.jsonThis 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.
Run the following command in your terminal:
npm init viteProceed? y
Project Name: name
Package Name: name
Select a framework: React
Select a variant: JavaScript
Select oxlintrc? Yes
Install with npm? Yes
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
# Install TypeScript Globally
npm i -g typescript
# create dist folder by running this command
tsc
# Start the local development server
npm run devRun this command inside your project directory to install npm pakages in pakages.json file:
npm i axios
npm i react-router-dom
npm i bootstrapIt 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.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.0.4",
"oxlint": "^1.75.0",
"vite": "^8.2.0"
}
}
Note: Install packages when needed
Download and install the LTS version from Node.js Official Site. Verify installation in your terminal:
node -v
npm -v- Download MongoDB Community Server from MongoDB Download Center.
- Download MongoDB Shell (
mongosh) to run CLI database operations. - Start the local server daemon:
# Verify connection using mongosh CLI
mongoshInitialize your Node project inside any project directory:
npm initpackage 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)
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
# create dist folder by running this command
tsc
# Start the local development server
npm run devTo 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
}
}
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
npm i @types/cors
npm i @types/express
npm i @types/node
npm i typescript
npm i -D tsxIt 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": "dist/app.js",
"scripts": {
"start": "node dist/app.js",
"dev": "nodemon --exec tsx app.ts"
},
"dependencies": {
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/node": "^26.6.2",
"cors": "^2.8.6",
"dotenv": "^17.4.2",
"express": "^5.2.1",
"mongoose": "^9.9.1",
"nodemon": "^3.1.14",
"typescript": "^7.0.2"
},
"devDependencies": {
"tsx": "^4.19.0"
}
}
Note: Install packages when needed
git clone <your-repository-url>
cd Main_folder/Project_FolderInstall TypeScript globally on your system to use tsc commands directly:
npm install -g typescriptTypeScript is already listed as a project dependency. Install it locally with:
npm installOr
npm i typescriptUsing the local dependency keeps the project compiler version consistent across different machines.
Generate the tsconfig.json file to configure compiler settings and strict type-checking rules:
tsc --initNote: This creates a tsconfig.json file in your root folder with "strict": true enabled by default.
Open src/Notes.ts and review the examples covering the concepts listed above.
Run these commands from inside the Project Folder directory.
tscThis reads tsconfig.json, compiles TypeScript files from src/, and writes JavaScript, declaration, and source map files to dist/.
tsc --watchThe compiler will rebuild the project whenever a source file changes. Press Ctrl + C to stop watch mode.
node dist/FileName.jsnode dist/FileName.jstsc --noEmitThis checks the project for type errors without creating or changing files in dist/.
You can add these shortcut scripts to your package.json file:
"scripts": {
"build": "tsc",
"watch": "tsc --watch",
"start": "tsc && node dist/Notes.js",
"check": "tsc --noEmit"
}Now you can run:
npm run buildto compilenpm run watchfor auto-rebuildnpm startto compile and run in one stepnpm run checkfor quick type checks
- Node.js (v16 or higher)
- npm package manager
- Basic knowledge of React and JavaScript & TypeScript
-
Frontend & UI:
- React Documentation β Official guide for building component-based UIs and hooks.
- React Router Documentation β Learn client-side routing, dynamic navigation, and parameter handling.
- Vite Guide β Documentation for high-performance frontend tooling and bundling.
- Bootstrap 5 Documentation β Reference for responsive grid layouts, styling, and dark-theme classes.
-
Backend & Database:
- Node.js Official Docs β Core runtime environment and server-side JavaScript APIs.
- Express.js Guide β Framework guide for building RESTful APIs and middleware pipelines.
- Mongoose ODM Docs β Schema modeling, data validation, and MongoDB query execution.
- MongoDB Atlas Documentation β Cloud database setup, clusters, and security configuration.
-
Language & Utilities:
- TypeScript Documentation β Comprehensive guide to static typing, interfaces, and compiler configurations.
- Axios HTTP Client β Promise-based HTTP requests for browser and Node environments.
- W3Schools All Language Tutorials β Comprehensive tutorials and quick reference guides for JavaScript, TypeScript, Node, React, CSS, and Bootstrap.
- MDN Web Docs (Mozilla) β In-depth reference for JavaScript, HTML, CSS, and web APIs.
MehmoodCoder
- π GitHub: https://github.com/MehmoodCoder
- π Portfolio: My Portfolio Link
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request