This is a exercise Tracker Web App that allows users to log their exercises. It is built with the MERN stack.
This repository contains learning notes and code from the Learn the MERN Stack - Full Tutorial (MongoDB, Express, React, Node.js).
- Backend server: Run
npm start
under thebackend
folder, the default URL ishttp://localhost:5000
- Frontend server: Run
npm start
under the main folder, the web page can be viewed athttp://localhost:3000
- Create a project and a cluster on MongoDB Atlas.
- Add whitelist IPs(under Network Access) and DB users (under Database Access).
- Connect the application and copy the connection string for future use.
- Create backend folder and install packages:
express
,cors
,mongoose
,dotenv
,nodeman
. - Define server architecture in
backend/server.js
. - Define database schema(s) under
backend/models
. - Define API routes under
backend/routes
. - Use tools like
Insomnia
ofPostman
to test the correctness of the APIs.
- Create a react app:
npx create-react-app [APP NAME]
- Modify the default files:
- Define custom React components under src/components
- Connect frontend & backend through REST APIs