Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

saicrazyfire/mern-exercise-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning the MERN stack

MongoDB + Express + React + Node.js

Video Blog Code

Pre-requisites:

  • Node.js version 8.17.0 (lts/carbon)
  • Nodemon - Install nodemon globally or use npx nodemon.

Note: You will need to run sudo npm install -g --force nodemon to get macOS terminal to find nodemon.

Tip: To run the backend server.js file, you may run npx nodemon server without modifying the package.json file.


Creating the project

  1. Run npx create-react-app mern-exercise-tracker to create the folder/React project

Setting up the backend

  1. Change directory into newly created folder cd mern-exercise-tracker
  2. Create new folder backend and change into it
  3. Run npm init -y to create npm scaffold project with default values
  4. Create a new file called server.js
  5. Paste boilerplate express code with mongoose/cors/dotenv lines
  6. Create .env file in backend folder and make sure the mongoose URI is set properly (note: make sure to change URI to localhost if running locally).
  7. Make sure the root .gitignore file is skipping the newly created .env file and the node_modules folder within the backend folder
  8. In the backend folder, create a new folder called models with two files exercise.model.js and user.model.js
  9. Input the schema into each respective model file
  10. In the backend folder, create a new folder called routes with two files exercises.js and users.js
  11. Update server.js to use the newly created routes
  12. Input the routes into the newly created routes files. Include advanced features like update by ID and deleting exercises

Done with backend!

You are done with the backend (for the video section)! Skip to 43:37 in the video to proceed with the frontend


Setting up the frontend

TBD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published