MongoDB: A document-based open source database
Express: A web application framework for Node.js
React: A JavaScript front-end library for building user interfaces
Node.js: JavaScript run-time environment that executes JavaScript code outside of a browser (such as a server)
and mongoose: simple, schema-based solution to model application data
Purpose: Assign an exercise to a user
Features:
- New user can be created
- New exercise can be created and assigned to a specific user
- Old exercise can be updated
- All the data is stored using MongoDD
Terms
- Database
- Collection
- Document
- Index
- $lookup
- Reference
MongoDB uses JSON-like documents with optional schemas
- Create the BACKEND and connect to MongoDB
inside the backend folder:
npm install express cors mongoose dotenv
Install nodemon globally to use it in command line:npm install -g nodemon
- Then Create React front end and connect to the backend
- Remember to run both the backend and frontend in order to allow the project to work successfully
- Register MongoDB Atlas for mongoDB access
- Run
npm install
in the project folder and also in the backend folder - Go to backend folder, create .env file and create ATLAS_URI variable with the string you have from MongoDB Atlas to successfully connect to the database. Make sure to replace <password> and <dbname>
- Run
npm start
in the current project folder - Locate into the backedn folder and run
nodemon server