Skeleton structure of a MERN application - frontend and backend with a MongoDB instance
Backend -
- Clone the repo and run
cd backend
and do annpm install
- Create a .env file in the root of the backend file and create a PORT variable for the port to run on, and MONGO_URI with the mongoDB connection string
- The run command is
npm run dev
which will run nodemon to listen for any backend changes - If the server runs successfully, there will be a "connected to DB & server ready at http://localhost:PORT
Frontend -
- The project is built with Vite and React v18 is installed
- React Router is installed and imported in the App.js file
cd frontend
and runnpm install
npm run dev
to run the frontend- Frontend has a proxy defined to bypass CORS errors during development for port 4000