└── README.md /README.md: -------------------------------------------------------------------------------- 1 | ## ![Dive logo](https://user-images.githubusercontent.com/424487/219708981-f0416526-ba48-4b01-b5b3-c0eb73362718.png) Dive 2 | 3 | 4 | | Octernship info | Timelines and Stipend | 5 | | ------------- | ------------- | 6 | | Assignment Deadline | 19th June 2023 | 7 | | Octernship Duration | 3rd July 2023 - 3rd October 2023 | 8 | | Monthly Stipend | $500 USD | 9 | 10 | ## Assignment 11 | 12 | 13 | # Write a REST API for the input of calories in Python 14 | 15 | ### Task Instructions 16 | - API Users must be able to create an account and log in. 17 | - All API calls must be authenticated. 18 | - Implement at least three roles with different permission levels: a regular user would only be able to CRUD on their owned records, a user manager would be able to CRUD only users, and an admin would be able to CRUD all records and users. 19 | - Each entry has a date, time, text, and number of calories. 20 | - If the number of calories is not provided, the API should connect to a Calories API provider (for example, https://www.nutritionix.com) and try to get the number of calories for the entered meal. 21 | - User setting – Expected number of calories per day. 22 | - Each entry should have an extra boolean field set to true if the total for that day is less than the expected number of calories per day, otherwise should be false. 23 | - The API must be able to return data in the JSON format. 24 | - The API should provide filter capabilities for all endpoints that return a list of elements, as well should be able to support pagination. 25 | - Write unit and e2e tests. 26 | - Use any *Python* web framework 27 | - Use *SQLite* as the database 28 | 29 | ### Task Expectations 30 | - API Design Best Practices 31 | - Documentation of any assumptions or choices made and why 32 | - Links as citation to any article / code referred to or used 33 | - Unit tests covering the core calories logic 34 | - Appropriate exception handling and error messages 35 | - Code Quality - remove any unnecessary code, avoid large functions 36 | - Good commit history - we won’t accept a repo with a single giant commit 🙅‍♀️ 37 | 38 | ### Task submission 39 | Using the [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow#following-github-flow) for assignment submission 40 | 1. Creating a new branch 41 | 2. Raising a Pull Request for submission 42 | 3. Using GitHub Discussions to ask any relevant questions regarding the project 43 | 4. Final submission Checklist: 44 | - [ ] SUBMISSION.md in the repository / PR, with: 45 | - [ ] commands to set up the repo (dependencies etc.) 46 | - [ ] commands to run the test suite 47 | - [ ] commands to run the API server 48 | --------------------------------------------------------------------------------