Template for building projects with the MERN (MongoDB, Express, React, Node.js) stack.
This template was generated using create-react-app and express-generator for the
client and server, respectively.
- Install Node and npm here
- Install
npmwith the commandnpm install - Set up a MongoDB Atlas instance. See this video for help!
- Create a
.envfile with a variable calledDB_URLand paste your MongoDB url: - Cd into client and install
aosby callingnpm install aosfor animations - Cd into client and intall
react-router-domas wellaxioswithnpm install react-router-domandnpm install axios - Cd into server and install
express, nodemon, dotenv, and corswithnpm install express nodemon dotenv cors - Start the frontend by cd into client and running
npm start - Start the backend by cd into server and running
npm run dev
DB_URL=mongodb://mongodburl.example.com:portnumbercdintoclientand run the commandyarn installto install all dependencies- To start the client, run
npm startin the same directory - In another command window,
cdintoserverand runnpm installandnpm startto install all dependencies and start the server. - Happy hacking!