A boilerplate project for quickly starting full-stack development with the MERN (MongoDB, Express.js, React, Node.js) stack. This setup includes JWT authentication, database connection, and routing with essential packages like bcrypt, cookie-parser, and axios for a seamless development experience.
Clone the repository:
git clone https://github.com/Chauhanvishal01/MERN-Boilerplate-Starter.git
cd mern-boilerplate
Install backend dependencies:
cd backend
npm install
A .env
file is included in the boilerplate. Open it and add your values for the following environment variables:
PORT=5000 # The port on which the server will run
MONGO_DB_URI=your_mongo_db_uri # Replace with your MongoDB connection URI
JWT_SECRET_KEY=your_jwt_secret_key # Replace with your JWT secret key
JWT_EXPIRE=7d # Duration for which the JWT token will be valid
FRONTEND_URL=http://localhost:3000 # Change this if your frontend is running on a different port or host
Start the backend server:
npm run dev
Navigate to the frontend directory:
cd frontend
Install frontend dependencies:
npm install
Start the frontend development server:
npm run dev
mern-boilerplate/
│
├── backend/
│ ├── controllers/
│ ├── database/
│ ├── middlewares/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ ├── .env
│ └── server.js
│
├── frontend/
│ ├── src/
│ ├── public/
│ └── index.html
│
├── README.md
Feel free to contribute by opening a pull request. Any improvements to code organization, security, or features are welcome!😊
This project is licensed under the MIT License.