mern-stack-tutorial

References

https://www.mongodb.com/languages/mern-stack-tutorial https://www.mongodb.com/community/forums/t/solved-mern-tutorial-issue-cannot-read-properties-of-undefined-reading-collection/212521

Prerequisites

You can clone this repo and change directory to mern-stack-tutorial/ by running these commands:

git clone https://github.com/mavericks-db/mern-stack-tutorial.git
cd mern-stack-tutorial/

Steps

To run the backend:

  1. Change directory to server/ in the terminal, put your Mongodb Atlas URI in the config.env
ATLAS_URI=put_here_your_mongodb_atlas_uri
  1. Install package dependencies:
npm install
  1. Run this command:
npm start
  1. Node-Express App runs on http://localhost:5000

To run the frontend:

  1. Change directory to client/ in the terminal
  2. Install package dependencies:
npm install
  1. Run this command:
npm start
  1. React App runs on http://localhost:3000

Happy Coding!