Exercise Tracker - freeCodeCamp APIs and Microservices Project Tutorial
Ganesh H
This is a full walkthrough for the Exercise Tracker project on freeCodeCamp. We connect to a MongoDB database and set up some models for storing users and exercise sessions. Then we can create express routes to add and retrieve data from the database which the user can access through form POST and url GET routes.
Link to Project : https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/exercise-tracker Written Guide and Source Code : https://www.notion.so/ganeshh123/Exercise-Tracker-8cd21bd626034f358c511f312e662789
Timestamps: 0:00 - Project Setup 02:20 - Database Connection Setup 05:42 - Creating the Models 09:50 - Test 1 - I can provide my own project, not the example url 10:22 - Test 2 - I can create a user by posting form data username to /api/exercise/new-user and returned will be an object with username and _id 17:04 - Test 3 - I can get an array of all users by getting api/exercise/users with the same info as when creating a user 19:55 - Test 4 - I can add an exercise to any user by posting form data userId(_id), description, duration, and optionally date to /api/exercise/add. If no date supplied it will use current date. App will return the user object with the exercise fields added 36:42 - Test 5 - I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). App will return the user object with added array log and count (total exercise count) 41:05 - Test 6 - I can retrieve part of the log of any user by also passing along optional parameters of from & to or limit. (Date format yyyy-mm-dd, limit = int) 51:35 - Styling and Final Touches
-————————————————————————————————————- Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.
The Node Package Manager (npm) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.
Express.js, or simply Express, is a web application framework for Node.js. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. Express runs between the server created by Node.js and the frontend pages of a web application. Express also handles an application's routing.
MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is devel ... https://www.youtube.com/watch?v=ANfJ0oGL2Pk
251247110 Bytes