{"id":15174029,"url":"https://github.com/mar-alv/ignite-daily-diet-api","last_synced_at":"2026-02-03T16:35:57.170Z","repository":{"id":249451260,"uuid":"831508206","full_name":"mar-alv/ignite-daily-diet-api","owner":"mar-alv","description":"2nd NodeJs challenge of Ignite, Rocketseat's programming course, an API to handle your diet, where you can create, list, visualize, edit your diets, besides retrieving metrics of them","archived":false,"fork":false,"pushed_at":"2024-12-14T16:08:51.000Z","size":763,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T06:31:27.780Z","etag":null,"topics":["api","back-end","backend","end-to-end","end-to-end-testing","fastify","httpie","javascript","jest","js","knex","node","nodejs","sqlite","ts","typescript","vitest","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mar-alv.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}},"created_at":"2024-07-20T19:00:12.000Z","updated_at":"2024-12-14T16:08:55.000Z","dependencies_parsed_at":"2024-07-28T15:44:23.474Z","dependency_job_id":"f37d5e5b-f064-4e56-99cd-3f48c7b75bc7","html_url":"https://github.com/mar-alv/ignite-daily-diet-api","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":0.04166666666666663,"last_synced_commit":"ec63db34b4c961a043aa31f1a11d32e381bc351f"},"previous_names":["mar-alv/ignite-daily-diet-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mar-alv/ignite-daily-diet-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-alv%2Fignite-daily-diet-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-alv%2Fignite-daily-diet-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-alv%2Fignite-daily-diet-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-alv%2Fignite-daily-diet-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mar-alv","download_url":"https://codeload.github.com/mar-alv/ignite-daily-diet-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-alv%2Fignite-daily-diet-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29049233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: 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":["api","back-end","backend","end-to-end","end-to-end-testing","fastify","httpie","javascript","jest","js","knex","node","nodejs","sqlite","ts","typescript","vitest","zod"],"created_at":"2024-09-27T11:23:03.092Z","updated_at":"2026-02-03T16:35:57.113Z","avatar_url":"https://github.com/mar-alv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003e Ignite Daily Diet API \u003c/h1\u003e\n\n\u003cdiv align='center'\u003e\n\n  ![project-img](.github/cover.jpg)\n  \n  [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n\n  [🇧🇷 Português](./docs/README-pt.md)\n\n\u003c/div\u003e\n\n## 📚 Summary\n- [❕ About](#about)\n- [📖 Instructions](#instructions)\n  - [📥 Install](#install)\n  - [🚀 Run Locally](#locally)\n\t- [📋 Run Unit Tests](#unit-tests)\n- [⚡ Endpoints](#endpoints)\n- [📂 Structure](#structure)\n- [🧰 Technologies](#technologies)\n- [📸 Screenshots and 🎥 Recordings](#screenshots-prints)\n- [👤 Author](#author)\n- [📄 License](#license)\n\n### \u003ca id='about' style='text-decoration: none; color: inherit;'\u003e❕ About\u003c/a\u003e\nThis is my implementation of the challenge project \"Daily Diet API\" from the second Node.js module of [Ignite](https://www.rocketseat.com.br/ignite), an intermediate and advanced course in various programming languages and technologies offered by [Rocketseat](https://www.rocketseat.com.br/).\n\n### \u003ca id='instructions' style='text-decoration: none; color: inherit;'\u003e📖 Instructions\u003c/a\u003e\n#### \u003ca id='instalar' style='text-decoration: none; color: inherit;'\u003e📥 Install\u003c/a\u003e\nPaste this 1º command into a terminal opened within a folder of your preference to clone the project\n```sh\ngit clone https://github.com/mar-alv/ignite-daily-diet.git\n```\n\nThen run one of the versions of the 2º command to install the dependencies\n```sh\nnpm i\n```\n```sh\nnpm install\n```\n\n#### \u003ca id='locally' style='text-decoration: none; color: inherit;'\u003e🚀 Run Locally\u003c/a\u003e\nPaste the command into a terminal, the server will be accessable through the port 3001\n```sh\nnpm run dev\n```\n\n#### \u003ca id='unit-tests' style='text-decoration: none; color: inherit;'\u003e📋 Run Unit Tests\u003c/a\u003e\nPaste the command into a terminal, they will be exectued one after the other mentioning if there were failed tests\n```sh\nnpm run test\n```\n\n### \u003ca id='endpoints' style='text-decoration: none; color: inherit;'\u003e⚡ Endpoints\u003c/a\u003e\nIn order to make requests to the server with 🥧 HTTPie directly from the terminal, you would have to follow its CLI [installation guide](https://httpie.io/docs/cli/main-features)\n#### Create user\nCreates a new user\n```sh\ncurl -X POST http://localhost:3001/users -h \"Content-Type: application/json\" -d '{\"name\": \"mar alv\",\"age\": 30,\"height\": 210,\"weight\": 100,\"sex\": \"masculine\"}'\n```\n\nWith 🥧 HTTPie\n```sh\nhttp POST http://localhost:3001/users \u003c httpie/create-user.json\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 201 Created\nConnection: keep-alive\nset-cookie: sessionId=39cad374-1d58-48e3-bb3b-e63cdaf76163; Max-Age=604800; Path=/\n\n{\n    \"userId\": \"dfb402ec-7962-4bb3-a6e2-b1d674430dbd\"\n}\n\n# When not providing an attribute\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"age\": [\n            \"Required\"\n        ],\n\t\t\t\t...\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a name that is too short\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"name\": [\n            \"Name must be at least 3 characters long\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an age below 12 years\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"age\": [\n            \"Age must be at least 12 years old\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an age above 110 years\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"age\": [\n            \"Age must be no more than 110 years old\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a height below 130cm\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"height\": [\n            \"Height must be at least 130 cm\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a height above 270cm\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"height\": [\n            \"Height must be no more than 270 cm\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a weight below 30kg\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"weight\": [\n            \"Weight must be at least 30 kg\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an invalid sex\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"sex\": [\n            \"Please select either \"masculine\" or \"feminine\" as your sex\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n```\n\n#### Get user\nGets an user by its id\n```sh\ncurl -X GET \"http://localhost:3001/users/245f1c46-101d-471a-976f-74878e61c819\" -H \"Cookie: sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nWith 🥧 HTTPie\n```sh\nhttp GET http://localhost:3001/users/245f1c46-101d-471a-976f-74878e61c819 \"Cookie:sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 200 OK\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"user\": {\n        \"age\": 30,\n        \"height\": 210,\n        \"name\": \"mar alv\",\n        \"sex\": \"masculine\",\n        \"weight\": 100\n    }\n}\n\n# When sending an invalid uuid\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"id\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n```\n\n#### Get metrics\nGets an user's metrics\n```sh\ncurl -X GET \"http://localhost:3001/users/245f1c46-101d-471a-976f-74878e61c819/metrics\" -H \"Cookie: sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nWith 🥧 HTTPie\n```sh\nhttp GET http://localhost:3001/users/245f1c46-101d-471a-976f-74878e61c819/metrics \"Cookie:sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 200 OK\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"bestDietSequence\": 1,\n\t\t\"dietPercentage\": 50,\n    \"platesAmount\": 2,\n    \"platesOnDiet\": 1,\n    \"platesOutOfDiet\": 1\n}\n\n# When sending an invalid uuid\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"id\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n```\n\n#### Create plate\nCreates a new plate for an user\n```sh\ncurl -X POST http://localhost:3001/users/835fc927-94e8-4bda-be46-db2f12dca0f9/plates -h \"Content-Type: application/json\" -d '{\"name\":\"Grilled Chicken Salad\",\"description\":\"A fresh salad with grilled chicken, mixed greens, and a light vinaigrette.\",\"inDiet\":true}'\n```\n\nWith 🥧 HTTPie\n```sh\nhttp POST http://localhost:3001/users/835fc927-94e8-4bda-be46-db2f12dca0f9/plates \u003c httpie/create-plate.json\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 201 Created\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"plateId\": \"8a07b00e-e396-4f03-b3f0-d2e850fc177e\"\n}\n\n# When not providing an attribute\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"userId\": [\n            \"Required\"\n        ],\n\t\t\t\t...\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an invalid user id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"userId\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a name that is too short\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"name\": [\n            \"Name must be at least 2 characters long\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an invalid specification of the plate belonging to the diet\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"inDiet\": [\n            \"Please specify if the plate is on a diet.\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n```\n\n#### Get plates\nGets all plates added by an user\n```sh\ncurl -X GET \"http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates\" -H \"Cookie: sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nWith 🥧 HTTPie\n```sh\nhttp GET http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates \"Cookie:sessionId=c0c01f92-f54b-4b1f-a294-d8876267203c; Max-Age=604800; Path=/\"\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 200 OK\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n  \"plates\": {\n    \"2024-09-28\": [\n      {\n        \"id\": \"1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p\",\n        \"name\": \"Grilled Chicken Salad\",\n        \"description\": \"A fresh salad with grilled chicken, mixed greens, and a light vinaigrette.\",\n        \"inDiet\": true,\n        \"createdAt\": \"2024-09-28T14:30:00.000Z\"\n      },\n      {\n        \"id\": \"7h8i9j0k-1l2m-3n4o-5p6q-7r8s9t0u1v2w\",\n        \"name\": \"Fruit Smoothie\",\n        \"description\": \"A delicious smoothie made with mixed fruits.\",\n        \"inDiet\": true,\n        \"createdAt\": \"2024-09-28T15:00:00.000Z\"\n      }\n    ],\n    \"2024-09-27\": [\n      {\n        \"id\": \"3n4o5p6q-7r8s-9t0u-1v2w-3x4y5z6a7b8c\",\n        \"name\": \"Pasta Primavera\",\n        \"description\": \"Pasta with a variety of fresh vegetables.\",\n        \"inDiet\": false,\n        \"createdAt\": \"2024-09-27T12:15:00.000Z\"\n      }\n    ]\n  }\n}\n\n# When not having plates created\n\nHTTP/1.1 200 OK\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"plates\": {}\n}\n\n# When sending an invalid user id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"userId\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n```\n\n#### Get a plate\nGets a plate created by an user\n```sh\ncurl -X GET \"http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates/dd2786d7-c0e7-4dd1-a435-100728774102\" -H \"Cookie: sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nWith 🥧 HTTPie\n```sh\nhttp GET http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates/dd2786d7-c0e7-4dd1-a435-100728774102 \"Cookie:sessionId=c0c01f92-f54b-4b1f-a294-d8876267203c; Max-Age=604800; Path=/\"\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 200 OK\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"plate\": {\n\t\t\t\t\"createdAt\": \"2024-07-22 23:34:30\",\n\t\t\t\t\"description\": \"A fresh salad with grilled chicken, mixed greens, and a light vinaigrette.\",\n\t\t\t\t\"id\": \"dd2786d7-c0e7-4dd1-a435-100728774102\",\n\t\t\t\t\"inDiet\": true,\n\t\t\t\t\"name\": \"Grilled Chicken Salad\",\n\t\t\t\t\"updatedAt\": \"2024-07-22 23:34:30\"\n\t\t}\n}\n\n# When sending an invalid user id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"userId\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When sending an invalid plate id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"plateId\": [\n            \"Invalid plate ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n\n# When not finding the plate\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Plate not found\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n```\n\n#### Update plate\nUpdate a plate's data of an user\n```sh\ncurl -X PUT http://localhost:3001/users/835fc927-94e8-4bda-be46-db2f12dca0f9/plates/2b5d459e-55c3-48a7-ac21-86dc8c1049b7  -h \"Content-Type: application/json\" -d '{\"name\":\"Grilled Chicken Salad\",\"description\":\"A fresh salad with grilled chicken, mixed greens, and a light vinaigrette.\",\"inDiet\":true,\"createdAt\":\"2024-07-25T00:00:00.000Z\"}'\n```\n\nWith 🥧 HTTPie\n```sh\nhttp PUT http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates/2b5d459e-55c3-48a7-ac21-86dc8c1049b7 \"Cookie:sessionId=c0c01f92-f54b-4b1f-a294-d8876267203c; Max-Age=604800; Path=/\" \u003c httpie/update-plate.json\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 204 No Content\nConnection: keep-alive\n\n# When providing an invalid user id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"userId\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an invalid plate id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"plateId\": [\n            \"Invalid plate ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a name that is too short\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"name\": [\n            \"Name must be at least 2 characters long\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing an invalid specification of the plate belonging to the diet\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"inDiet\": [\n            \"Please specify if the plate is on a diet.\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When providing a creation date that is set in the future\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"createdAt\": [\n            \"The date cannot be in the future.\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n\n# When not finding the plate\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"PLate not found\"\n}\n```\n\n#### Delete plate\nDeletes a plate created by an user\n```sh\ncurl -X DELETE \"http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates/dd2786d7-c0e7-4dd1-a435-100728774102\" -H \"Cookie: sessionId=1384df4b-bc5c-400f-9ae4-8dd841aafc3e\"\n```\n\nWith 🥧 HTTPie\n```sh\nhttp DELETE http://localhost:3001/users/7e04dcd0-8619-4602-bbe3-d9194790ae51/plates/dd2786d7-c0e7-4dd1-a435-100728774102 \"Cookie:sessionId=c0c01f92-f54b-4b1f-a294-d8876267203c; Max-Age=604800; Path=/\"\n```\n\nResponses\n```\n# When successfully doing it\n\nHTTP/1.1 204 No Content\nConnection: keep-alive\n\n# When sending an invalid user id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"userId\": [\n            \"Invalid user ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When sending an invalid plate id\n\nHTTP/1.1 400 Bad Request\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"plateId\": [\n            \"Invalid plate ID\"\n        ]\n    },\n    \"message\": \"Invalid input\"\n}\n\n# When not finding the user\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"User not found\"\n}\n\n# When not finding the plate\n\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Plate not found\"\n}\n\n# When being unauthorized\n\nHTTP/1.1 401 Unauthorized\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Unauthorized\"\n}\n```\n\n#### Non existing route\nWhen trying to access a route that doesn't exists in the server\n\nResponse\n```\nHTTP/1.1 404 Not Found\nConnection: keep-alive\ncontent-type: application/json; charset=utf-8\n\n{\n    \"error\": \"Not Found\",\n    \"message\": \"Route POST:/route not found\",\n    \"statusCode\": 404\n}\n```\n\n### \u003ca id='structure' style='text-decoration: none; color: inherit;'\u003e📂 Structure\u003c/a\u003e\n```\n│ .github/\n│   └── ...\n│ @types/\n│   └── ...\n│ db/\n│   ├── migrations/\n│   │     └── ...\n│   └── ...\n│ docs/\n│   └── ...\n│ httpie/\n│   └── ...\n│ src/\n│   ├── errors/\n│   │     └── ...\n│   ├── libs/\n│   │     └── ...\n│   ├── middlewares/\n│   │     └── ...\n│   ├── routes/\n│   │     └── ...\n│   └── ...\n│ tests/\n│   └── ...\n```\n\n### \u003ca id='technologies' style='text-decoration: none; color: inherit;'\u003e🧰 Technologies\u003c/a\u003e\n#### Back-end Framework\n[![Fastify](https://img.shields.io/badge/fastify-000000?style=for-the-badge\u0026logo=fastify\u0026logoColor=white)](https://www.fastify.io/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n\n#### Database\n[![Knex](https://img.shields.io/badge/knex-ff5722?style=for-the-badge\u0026logo=knex\u0026logoColor=white)](https://knexjs.org/)\n[![SQLite](https://img.shields.io/badge/sqlite-003B57?style=for-the-badge\u0026logo=sqlite\u0026logoColor=white)](https://www.sqlite.org/)\n\n#### Testing\n[![Vitest](https://img.shields.io/badge/vitest-506E10?style=for-the-badge\u0026logo=vitest\u0026logoColor=FCC72B)](https://vitest.dev/)\n[![Jest](https://img.shields.io/badge/Jest-C21325?style=for-the-badge\u0026logo=jest\u0026logoColor=white)](https://jestjs.io/)\n\n#### Utilities\n[![Day.js](https://img.shields.io/badge/Day.js-FF6F00?style=for-the-badge\u0026logo=dayjs\u0026logoColor=white)](https://day.js.org/)\n[![dotenv](https://img.shields.io/badge/dotenv-ECD53F?style=for-the-badge\u0026logo=.env\u0026logoColor=black)](https://github.com/motdotla/dotenv)\n[![ESLint](https://img.shields.io/badge/eslint-4B32C3?style=for-the-badge\u0026logo=eslint\u0026logoColor=white)](https://eslint.org/)\n[![TSX](https://img.shields.io/badge/tsx-3178C6?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)](https://www.npmjs.com/package/tsx)\n[![Zod](https://img.shields.io/badge/Zod-007ACC?style=for-the-badge\u0026logo=superman\u0026logoColor=white)](https://zod.dev/)\n\n\n### \u003ca id='screenshots-prints' style='text-decoration: none; color: inherit;'\u003e📸 Screenshots and 🎥 Recordings\u003c/a\u003e\nFor a longer video demonstration click here and like my post on \u003ca href='https://www.linkedin.com/feed/update/urn:li:activity:7246141307188854784/'\u003eLinkedIn\u003c/a\u003e\n\n### \u003ca id='author' style='text-decoration: none; color: inherit;'\u003e👤 Author\u003c/a\u003e\n\u003cdiv style='display: flex; align-items: center;'\u003e\n\t\t\u003cimg src='https://github.com/mar-alv.png' alt='Marcelo Alvarez GitHub profile picture' style='width: 150px; border-radius: 50%; margin-right: 20px;'\u003e\n\t\t\u003cdiv\u003e\n\t\t\t\t\u003cstrong\u003eMarcelo Alvarez\u003c/strong\u003e\n\t\t\t\t\u003cbr\u003e\n\t\t\t\t\u003cem\u003eFront-end Developer\u003c/em\u003e\u003cbr\u003e\n\t\t\t\t\u003cspan\u003e\"Some AI generated funny quote here 😗\"\u003c/span\u003e\u003cbr\u003e\n\t\t\t\t\u003ca href='https://www.linkedin.com/in/mar-alv'\u003e\n\t\t\t\t\t\u003cimg\n\t\t\t\t\t\talt='LinkedIn'\n\t\t\t\t\t\tsrc='https://img.shields.io/badge/LinkedIn-Marcelo%20Alvarez-0077B5?logo=linkedin\u0026logoColor=white'\n\t\t\t\t\t/\u003e\n\t\t\t\t\u003c/a\u003e\n\t\t\t\t\u003ca href='https://mar-alv.github.io/'\u003e\n\t\t\t\t\t\u003cimg\n\t\t\t\t\t\talt='Portfolio'\n\t\t\t\t\t\tsrc='https://img.shields.io/badge/Portfolio-Marcelo%20Alvarez-000?style=flat\u0026logo=portfolio\u0026logoColor=white'\n\t\t\t\t\t/\u003e\n\t\t\t\t\u003c/a\u003e\n\t\t\u003c/div\u003e\n\u003c/div\u003e\n\n### \u003ca id='license' style='text-decoration: none; color: inherit;'\u003e📄 License\u003c/a\u003e\nLicensed under [MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar-alv%2Fignite-daily-diet-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmar-alv%2Fignite-daily-diet-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar-alv%2Fignite-daily-diet-api/lists"}