Skip to content

tusharkulkarni02/Simple-CRUD-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Simple-CRUD-template

Universal template to ease out building CRUD apps in MERN

Here are the key commands to set up a MERN stack CRUD app:

1. Initialize project and create directories:

mkdir mern-crud
cd mern-crud
mkdir backend frontend

2. Set up backend:

cd backend
npm init -y
npm install express mongoose cors dotenv nodemon
  • express: Web framework
  • mongoose: MongoDB object modeling
  • cors: Enable cross-origin requests
  • dotenv: Environment variables
  • nodemon: Auto-restart server during development

3. Set up frontend:

cd ../frontend
npx create-react-app .
npm install axios react-router-dom
  • create-react-app: Creates React project structure
  • axios: HTTP client for API requests
  • react-router-dom: Client-side routing

4. Add scripts to backend package.json:

"scripts": {
  "start": "node server.js",
  "dev": "nodemon server.js"
}

The basic structure will be:

mern-crud/
  ├── backend/
  │   ├── models/
  │   ├── routes/
  │   ├── server.js
  │   └── .env
  └── frontend/
      ├── src/
      ├── public/
      └── package.json

Start development with:

# Terminal 1 (backend)
cd backend
npm run dev

# Terminal 2 (frontend)
cd frontend
npm start

About

Universal template to ease out building CRUD apps in MERN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published