{"id":23307288,"url":"https://github.com/simonapiz/bossmachine","last_synced_at":"2026-04-12T13:49:01.600Z","repository":{"id":201177389,"uuid":"707127206","full_name":"SimonaPiz/BossMachine","owner":"SimonaPiz","description":"An API to serve information to a Boss Machine app","archived":false,"fork":false,"pushed_at":"2023-10-26T15:58:12.000Z","size":432,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T06:23:44.273Z","etag":null,"topics":["api","codecademy-solutions","express-js","javascript","react","ruter-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonaPiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-10-19T09:23:09.000Z","updated_at":"2023-10-26T16:00:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"1483449a-ccb0-4aee-856d-75445dca75cc","html_url":"https://github.com/SimonaPiz/BossMachine","commit_stats":null,"previous_names":["simonapiz/bossmachine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FBossMachine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FBossMachine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FBossMachine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FBossMachine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonaPiz","download_url":"https://codeload.github.com/SimonaPiz/BossMachine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574095,"owners_count":20960495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","codecademy-solutions","express-js","javascript","react","ruter-api"],"created_at":"2024-12-20T12:29:51.429Z","updated_at":"2026-04-12T13:48:56.579Z","avatar_url":"https://github.com/SimonaPiz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://github.com/SimonaPiz/BossMachine/blob/main/public/img/favicon.ico\" width=\"25px\" alt=\"icon Boss Machine\" title=\"icon Boss Machine\"/\u003e Boss Machine\n\u003e Create an API to serve information to a Boss Machine App\n\n\u003cimg src=\"https://github.com/SimonaPiz/BossMachine/blob/main/anteprima-home.png\" width=\"600px\" alt=\"preview\" title=\"preview\"/\u003e\n\n## Table of Contents\n* [General Info](#general-information)\n* [Implementation Details](#implementation-details)\n* [Testing](#testing)\n* [Screenshots](#screenshots)\n* [Technologies Used](#technologies-used)\n* [Usage](#usage)\n* [Acknowledgements](#acknowledgements)\n* [Author](#author)\n\n## General Information\n\nIn this project, I created an entire API to serve information to a Boss Machine, a unique management application for today's most accomplished (evil) entrepreneurs. \nI created routes to manage the 'minions', the brilliant 'million dollar ideas', and to handle all the annoying meetings that keep getting added to the busy schedule.\n\nYou can view a video demonstration of the final app here: [▶](https://content.codecademy.com/programs/build-apis/solution-videos/BossMachine480.mov)\n\n## Implementation Details\n\nTo complete the project, I needed to complete code on getting the API server up and running:\n\n- [x] Server Boilerplate\n\n  Added key functionality to allow it to run:\n\n  - Set up body-parsing middleware\n  - Set up CORS middleware\n  - Mount the existing `apiRouter` at `/api`.\n  - Start the server listening on the provided `PORT`.\n\n  ✔ [issue #2](https://github.com/SimonaPiz/BossMachine/issues/2)\n\n- [x] API Routes\n\n    Routes Required\n\n  - `/api/minions`\n    - GET /api/minions to get an array of all minions.\n    - POST /api/minions to create a new minion and save it to the database.\n    - GET /api/minions/:minionId to get a single minion by id.\n    - PUT /api/minions/:minionId to update a single minion by id.\n    - DELETE /api/minions/:minionId to delete a single minion by id.\n\n  - `/api/ideas`\n    - GET /api/ideas to get an array of all ideas.\n    - POST /api/ideas to create a new idea and save it to the database.\n    - GET /api/ideas/:ideaId to get a single idea by id.\n    - PUT /api/ideas/:ideaId to update a single idea by id.\n    - DELETE /api/ideas/:ideaId to delete a single idea by id.\n\n  - `/api/meetings`\n    - GET /api/meetings to get an array of all meetings.\n    - POST /api/meetings to create a new meeting and save it to the database.\n    - DELETE /api/meetings to delete _all_ meetings from the database.\n  \n  ✔ [issue #3](https://github.com/SimonaPiz/BossMachine/issues/3)\n\n- [x] Working with the 'Database'\n\n  Import and use helper functions for working with the database arrays on all routers:\n\n  - getAllFromDatabase\n  - getFromDatabaseById\n  - addToDatabase\n  - updateInstanceInDatabase\n  - deleteFromDatabasebyId\n  - deleteAllFromDatabase\n  ✔ [issue #4](https://github.com/SimonaPiz/BossMachine/issues/4)\n\n#### Schemas\n\n- Minion:\n  - id: string\n  - name: string\n  - title: string\n  - salary: number\n- Idea\n  - id: string\n  - name: string\n  - description: string\n  - numWeeks: number\n  - weeklyRevenue: number\n- Meeting\n  - time: string\n  - date: JS `Date` object\n  - day: string\n  - note: string\n\n\n- [x] Custom Middleware\n\n  I created a custom middleware function `checkMillionDollarIdea` that will come in handy in some /api/ideas routes. \n  This function makes sure that any new or updated ideas are still worth at least one million dollars! The total value of an idea is the product of its `numWeeks` and `weeklyRevenue` properties.\n\n  ✔ [issue #7](https://github.com/SimonaPiz/BossMachine/issues/7)\n\n- [x] Bonus\n\n  As a bonus, you may implement routes to allow bosses to add and remove work from their minions' backlogs.\n\nSchema:\n\n- Work:\n  - id: string\n  - title: string\n  - description: string\n  - hours: number\n  - minionId: string\n\n#### Routes required:\n\n  - GET /api/minions/:minionId/work to get an array of all work for the specified minon.\n  - POST /api/minions/:minionId/work to create a new work object and save it to the database.\n  - PUT /api/minions/:minionId/work/:workId to update a single work by id.\n  - DELETE /api/minions/:minionId/work/:workId to delete a single work by id.\n\n  ✔ [issue #8](https://github.com/SimonaPiz/BossMachine/issues/8)\n\n## Testing\n\nRun\n```\n  $ npm run test\n```\nto test:\n- [x] API Routes\n- [x] checkMillionDollarIdea middleware\n- [x] Bonus\n\n✔ [issue #5](https://github.com/SimonaPiz/BossMachine/issues/5)\n\n![test results](https://user-images.githubusercontent.com/91121660/278086636-f11bfdd8-82c8-47ba-872c-afbf76bc0750.png)\n\n## Screenshots\n\n\u003cimg src=\"https://github.com/SimonaPiz/BossMachine/blob/main/anteprima-minions.png\" width=\"600px\" alt=\"preview\" title=\"preview\"/\u003e\n\u003cimg src=\"https://github.com/SimonaPiz/BossMachine/blob/main/anteprima-minion-single.png\" width=\"600px\" alt=\"preview\" title=\"preview\"/\u003e\n\u003cimg src=\"https://github.com/SimonaPiz/BossMachine/blob/main/anteprima-ideas.png\" width=\"600px\" alt=\"preview\" title=\"preview\"/\u003e\n\n## Usage\n\n1. Open the root project directory in your terminal. Run \n```\n  $ npm install\n``` \n  to install the dependencies of this project and build the front-end application. \n2. Once it has finished installing, you can run \n```\n  $ npm run start\n``` \n  to begin your server. You'll see \n```\n  Server listening on port 4001\n``` \n  in the terminal. \n\n3. To see the application in its initial, non-working state, simply open **index.html** in a web browser.\n\n## Technologies Used\n   - React 18\n   - React router dom 6\n   - React Redux 8\n   - @reduxjs/toolkit\n   - mocha 10\n   - chai 4\n   - @faker-js/faker 8\n   - express 4\n\n## Acknowledgements\n\nThis project comes from the [Codecademy's Create a Back-End with JavaScript](https://www.codecademy.com/learn/paths/create-a-back-end-app-with-javascript) course.\n\n## Author\n\n- [Simona Pizio](https://github.com/SimonaPiz)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonapiz%2Fbossmachine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonapiz%2Fbossmachine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonapiz%2Fbossmachine/lists"}