{"id":15040540,"url":"https://github.com/frontendmasters/api-design-node-v3","last_synced_at":"2025-04-08T09:09:41.505Z","repository":{"id":41141828,"uuid":"160208775","full_name":"FrontendMasters/api-design-node-v3","owner":"FrontendMasters","description":"[Course] API design in Node with Express v3","archived":false,"fork":false,"pushed_at":"2024-03-01T20:58:04.000Z","size":295,"stargazers_count":696,"open_issues_count":38,"forks_count":958,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-08T09:09:36.918Z","etag":null,"topics":["express","mongodb","mongoose","nodejs","rest"],"latest_commit_sha":null,"homepage":"https://frontendmasters.com/courses/api-design-nodejs-v3/","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/FrontendMasters.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":"2018-12-03T15:02:28.000Z","updated_at":"2025-01-05T00:08:24.000Z","dependencies_parsed_at":"2024-10-30T02:27:48.209Z","dependency_job_id":null,"html_url":"https://github.com/FrontendMasters/api-design-node-v3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrontendMasters%2Fapi-design-node-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrontendMasters%2Fapi-design-node-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrontendMasters%2Fapi-design-node-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrontendMasters%2Fapi-design-node-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrontendMasters","download_url":"https://codeload.github.com/FrontendMasters/api-design-node-v3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"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":["express","mongodb","mongoose","nodejs","rest"],"created_at":"2024-09-24T20:44:43.134Z","updated_at":"2025-04-08T09:09:41.479Z","avatar_url":"https://github.com/FrontendMasters.png","language":"JavaScript","readme":"\u003e [!NOTE]\n\u003e This repo is from an archived version of the course. Watch the latest version of the course on [frontendmasters.com](https://frontendmasters.com/courses/api-design-nodejs-v4/).\n\n# Course Code for [API design in Node.js with Express, v3](https://frontendmasters.com/courses/api-design-nodejs-v3/)\n\u003e Scott Moss \u0026 Frontend Masters\n\n- [Resources](#resources)\n- [Course](#course)\n- [Exercises](#excercises)\n  - [Hello world Express](#hello-world-express)\n  - [Routing](#routing)\n  - [Create Schemas](#create-schemas)\n  - [Controllers](#controllers)\n  - [Authentication](#authentication)\n  - [Testing](#testing)\n\n## Resources\n* [Slides](https://slides.com/scotups/api-design-in-node-with-express-v3/)\n* [Nodejs](https://nodejs.org/en/)\n* [Express](https://expressjs.com/)\n* [MongoDB](https://www.mongodb.com/)\n\n## Course\nThis course has two parts, slides and excercises. The slides describe the excerices in detail. Each excercise has a starting branch and solution branch. Example `lesson-1` and `lesson-1-solution`.\n## Exercises\n### Hello world Express\n* branch - `lesson-1`\n\nIn this lesson you'll be creating a simple Express based API in node, just to get your feet wet.\n- [ ] install dependencies with yarn (prefered for version locking) or npm\n- [ ] create a route that sends back some json\n- [ ] create a route that accepts json and logs it\n- [ ] start the server\n\n### Routing\n* branch - `lesson-2`\n* test command - `yarn test-routes` or `npm run test-routes`\n\nThis exercise will have you creating routes and sub routers for our soon the be DB resources using Express routing and routers\n- [ ] create a router for the Item resource\n- [ ] create full crud routes and create placeholder controllers\n- [ ] mount router on the root server\n- [ ] ensure all tests pass by running test command\n\n### Create Schemas\n* branch - `lesson-3`\n* test command - `yarn test-models` or `npm run test-models`\n\nIn this exercise, you'll be taking what you learned about Mongoose and MongoDb to create a schema and model for the Item resource.\n\n- [ ] create a schema for the item resource\n- [ ] add the correct fields (look at test)\n- [ ] add the correct validations (look at test)\n- [ ] *extra* add compund index to ensure all tasks in a list have unique names\n- [ ] ensure all tests pass by running test command\n\n### Controllers\n* branch - `lesson-4`\n* test command - `yarn test-controllers` or `npm run test-controllers`\n\nSo far we have routes and models. Now we need to hook our routes up to our models so we can perfom CRUD on the models based on the routes + verbs. That's exactly what controllers do.\n\n- [ ] create CRUD resolvers in `utils/crud.js`\n- [ ] create controllers for the Item resources using the base crud resolvers\n- [ ] ensure all tests pass by running test command\n\n### Authentication\n* branch - `lesson-5`\n* test command - `yarn test-auth` or `npm run test-auth`\n\nIn this exercise you'll be locking down our API using JWT's.\n\n- [ ] create a signup controller\n- [ ] create a signin controller\n- [ ] create a protect middlware to lock down API routes\n- [ ] ensure all tests pass by running test command\n\n### Testing\nTHe other resources don't have any test, go ahead and write some!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontendmasters%2Fapi-design-node-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrontendmasters%2Fapi-design-node-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontendmasters%2Fapi-design-node-v3/lists"}