This repository contains a MERN (MongoDB, Express.js, React.js, Node.js) boilerplate for building full-stack web applications following the MVC (Model-View-Controller) architecture. It includes separate directories for the backend and frontend components, allowing for modular development and easy deployment.
Don't forget to star⭐ this repository if you find it helpful! It helps to show appreciation for the work put into this project.
For more information about me, visit my Portfolio. You can also reach out to me directly through the contact form on my website.
- Clone the repository:
git clone https://github.com/MananKanani5/mern-setup.git
- Navigate to the root directory mern-setup:
cd mern-setup
- Install required modules for both running as single project
npm install
- Navigate to the backend directory:
cd backend
- Install backend dependencies:
npm install
- Navigate back to the root directory:
cd ../
- Navigate to the frontend directory:
cd frontend
- Install frontend dependencies:
npm install
- Change your MongoDB connection URI in the .env file located in the backend directory.
MONGO_URI = "YOUR_MONGO_URI_STRING"
- In the root directory mern-setup, start the application:
npm run start
This command will concurrently run the Express server, frontend React app, and establish a connection with MongoDB.