{"id":28974858,"url":"https://github.com/plcoster/fcc_backend_project4","last_synced_at":"2026-04-13T01:37:03.280Z","repository":{"id":299016088,"uuid":"529432307","full_name":"PLCoster/fcc_backend_project4","owner":"PLCoster","description":"FreeCodeCamp Backend Project 4: Exercise Tracker","archived":false,"fork":false,"pushed_at":"2022-08-29T19:24:49.000Z","size":145,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-13T01:37:01.768Z","etag":null,"topics":["express","mongoose"],"latest_commit_sha":null,"homepage":"https://fcc-backend-project4.plcoster.repl.co/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PLCoster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-26T23:36:53.000Z","updated_at":"2023-04-11T13:05:57.000Z","dependencies_parsed_at":"2025-06-14T06:33:01.040Z","dependency_job_id":"1f213e0d-9f8f-4ccd-acb6-36f6e98ebfce","html_url":"https://github.com/PLCoster/fcc_backend_project4","commit_stats":null,"previous_names":["plcoster/fcc_backend_project4"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PLCoster/fcc_backend_project4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_backend_project4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_backend_project4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_backend_project4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_backend_project4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLCoster","download_url":"https://codeload.github.com/PLCoster/fcc_backend_project4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_backend_project4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","mongoose"],"created_at":"2025-06-24T12:07:10.236Z","updated_at":"2026-04-13T01:37:03.251Z","avatar_url":"https://github.com/PLCoster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Code Camp: Backend Project 4 - Exercise Tracker\n\n## Exercise Tracker\n\nThe aim of this project was to build a small web app with functionality similar to: https://exercise-tracker.freecodecamp.rocks\n\nThe project was built using the following technologies:\n\n- **HTML**\n- **JavaScript** with **[Node.js](https://nodejs.org/en/) / [NPM](https://www.npmjs.com/)** for package management.\n- **[Express](https://expressjs.com/)** web framework to build the web API.\n- **[mongoose](https://mongoosejs.com/)** for MongoDB object modeling, interacting with a **[MongoDB Atlas](https://www.mongodb.com/atlas/database)** database.\n- **[Bootstrap](https://getbootstrap.com/)** for styling with some custom **CSS**.\n- **[FontAwesome](https://fontawesome.com/)** for icons.\n- **[nodemon](https://nodemon.io/)** for automatic restarting of server during development.\n\n### Project Requirements:\n\n- **User Story #1:** You can `POST` to `/api/users` with form data `username` to create a new user.\n\n- **User Story #2:** The returned response from `POST /api/users` with form data `username` will be an object with `username` and `_id` properties.\n\n- **User Story #3:** You can make a `GET` request to `/api/users` to get a list of all users.\n\n- **User Story #4:** The `GET` request to `/api/users` returns an array.\n\n- **User Story #5:** Each element in the array returned from `GET /api/users` is an object literal containing a user's `username` and `_id`.\n\n- **User Story #6:** You can `POST` to `/api/users/:_id/exercises` with form data `description`, `duration`, and optionally `date`. If no date is supplied, the current date will be used.\n\n- **User Story #7:** The response returned from POST `/api/users/:_id/exercises` will be the user object with the exercise fields added.\n\n- **User Story #8:** You can make a GET request to `/api/users/:_id/logs` to retrieve a full exercise log of any user.\n\n- **User Story #9:** A request to a user's log `GET /api/users/:_id/logs` returns a user object with a `count` property representing the number of exercises that belong to that user.\n\n- **User Story #10:** A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added.\n\n- **User Story #11:** Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties.\n\n- **User Story #12:** The `description` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a string.\n\n- **User Story #13:** The `duration` property of any object in the `log` array that is returned from `GET /api/users/:_id/logs` should be a number.\n\n- **User Story #14:** The `date` property of any object in the log array that is returned from `GET /api/users/:_id/logs` should be a string. Use the `dateString` format of the Date API.\n\n- **User Story #15:** You can add `from`, `to` and `limit` parameters to a `GET /api/users/:_id/logs` request to retrieve part of the log of any user. `from` and `to` are dates in `yyyy-mm-dd` format. `limit` is an integer of how many logs to send back.\n\n### Project Writeup:\n\nThe fourth Free Code Camp: Back End Development Project is an Exercise Tracker API. Users can:\n\n- Create a new User by submitting the form on the app home page, or by sending a POST request to `/api/users` with a body containing a url encoded field of 'username'.\n\n- View all Users by sending a GET request to `/api/users`\n\n- Add an Exercise to a User Account by submitting an Exercise using the 'Add Exercise' form on the app home page. Alternatively, by sending a POST request to `/api/users/\u003cUSER_ID\u003e/exercises` with a valid USER_ID, and a body containing url encoded fields of 'description' (string), 'duration' (integer) and 'date' (optional, YYYY-MM-DD).\n\n- View a User's Exercise Log by sending a GET request to `/api/users/:_id/logs?[from][\u0026to][\u0026limit]`, where `[]` denote optional filter query parameters, and `from`, `to` = dates (yyyy-mm-dd); `limit` = number.\n\nUser IDs and their Exercises are stored in a MongoDB database, and expire after 24hrs for Demo purposes.\n\n### Project Files\n\n- `index.js` - the main entry point of the application, an express web server handling the routes defined in the specification.\n\n- `public/` - contains static files for the web app (stylesheet, logo, favicons etc), served by express using `express.static()`.\n\n- `views/` - contains the single html page for the web app, `index.html`, which is served by express on `GET` requests to `/`.\n\n- `middleware/` - contains express middleware functions used by the routes of the express server.\n\n- `models/` - contains `mongoose` schema and models for the database interactions of the app.\n\n### Usage:\n\nRequires Node.js / NPM in order to install required packages. After downloading the repo, install required dependencies with:\n\n`npm install`\n\nTo run the app locally, a valid MongoDB database URI is required to be entered as an environmental variable (MONGO_URI), which can be done via a `.env` file (see sample.env). One possible MongoDB service is **[MongoDB Atlas](https://www.mongodb.com/atlas/database)**.\n\nA development mode (with auto server restart on file save), can be started with:\n\n`npm run dev`\n\nThe application can then be viewed at `http://localhost:3000/` in the browser.\n\nTo start the server without auto-restart on file save:\n\n`npm start`\n\n# Exercise Tracker BoilerPlate\n\nThe initial boilerplate for this app can be found at https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/\n\nInstructions for building the project can be found at https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/exercise-tracker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_backend_project4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplcoster%2Ffcc_backend_project4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_backend_project4/lists"}