{"id":27643286,"url":"https://github.com/lesiaukr/goit-pythonweb-hw-12","last_synced_at":"2026-05-04T10:38:33.079Z","repository":{"id":274883238,"uuid":"919166901","full_name":"LesiaUKR/goit-pythonweb-hw-12","owner":"LesiaUKR","description":"Master's degree | Advanced Python Programming | HW | Final Project","archived":false,"fork":false,"pushed_at":"2025-02-03T17:37:12.000Z","size":905,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T00:11:44.393Z","etag":null,"topics":["authentication","authorization","docker-compose","email-verification","fastapi","jwt-token","module-testing","postgres","python","redis-cache","roles","sphinx-doc","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Python","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/LesiaUKR.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":"2025-01-19T21:32:04.000Z","updated_at":"2025-02-04T19:54:55.000Z","dependencies_parsed_at":"2025-01-29T23:35:02.774Z","dependency_job_id":null,"html_url":"https://github.com/LesiaUKR/goit-pythonweb-hw-12","commit_stats":null,"previous_names":["lesiaukr/goit-pythonweb-hw-12"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesiaUKR%2Fgoit-pythonweb-hw-12","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesiaUKR%2Fgoit-pythonweb-hw-12/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesiaUKR%2Fgoit-pythonweb-hw-12/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesiaUKR%2Fgoit-pythonweb-hw-12/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LesiaUKR","download_url":"https://codeload.github.com/LesiaUKR/goit-pythonweb-hw-12/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535104,"owners_count":21446508,"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":["authentication","authorization","docker-compose","email-verification","fastapi","jwt-token","module-testing","postgres","python","redis-cache","roles","sphinx-doc","unit-testing"],"created_at":"2025-04-24T00:12:08.536Z","updated_at":"2026-05-04T10:38:33.049Z","avatar_url":"https://github.com/LesiaUKR.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Topic 12. Homework | FastAPI | Building a REST API | Final Homework Assignment\n\n## Greetings, friends! 🙂 ✋🏼\n\nThe FullStack Web Development with Python course is now behind you, and you are on the threshold of your final homework assignment. This task will summarize and reinforce all the knowledge, skills, and abilities you have acquired throughout the course.\n\nIn this final homework, you must refine your REST API application from previous assignments.\n\n---\n\n## Technical Description of the Assignment\n\n### 1. Documentation with Sphinx\nUse Sphinx to generate documentation for your application. Add docstrings to necessary functions and class methods in the main modules.\n\n### 2. Unit Testing\nCover your application's repository modules with unit tests.\n\n### 3. Integration Testing\nCover your application's routes with integration tests using the pytest framework.\n\n### 4. Test Coverage Above 75%\nEnsure that your application is covered with tests by at least 75%. Use the pytest-cov package to monitor coverage.\n\n### 5. Caching Mechanism with Redis\nImplement a caching mechanism using Redis. Cache the current user during authentication so that the `get_current_user` function retrieves the user from the cache instead of querying the database every time.\n\n### 6. Password Reset Mechanism\nImplement a password reset mechanism for the REST API application.\n\n### 7. User Roles and Access Control\nImplement role-based access control for users with roles: `user` and `admin`. Ensure that only administrators can change their default avatar independently.\n\n👉🏻 The last three tasks were not part of previous homework assignments, but these aspects are thoroughly covered in the course materials. Feel free to seek help from a mentor if needed.\n\n---\n\n## General Requirements for the Homework Assignment\n\n👉🏻 The following requirements are mandatory for mentor evaluation. If any requirement is missing, the mentor will return the assignment for revision without grading. If you need clarification 😉 or get stuck on a step, contact the mentor via Slack.\n\n### 1. Code Documentation\nAll main functions and class methods must have appropriate docstrings for Sphinx documentation generation.\n\n### 2. Testing\n- Test modules should be structured according to your application’s organization.\n- Use pytest for writing unit and integration tests.\n- Ensure at least 75% test coverage of the application code. Use pytest-cov to verify coverage.\n\n### 3. Caching with Redis\n- Set up Redis as a caching service for your application.\n- Ensure data security and validity when caching user information.\n\n### 4. Password Reset\nImplement a secure password reset mechanism with email confirmation or another method.\n\n### 5. Role Management\n- Implement a user role system.\n- Ensure access control checks for operations restricted to administrators.\n\n### 6. Confidential Data Storage\nAll confidential data and settings should be stored in a `.env` file. Do not include confidential data in the codebase.\n\n### 7. Containerization\nUse Docker Compose to launch all services and databases of your application.\n\n---\n\n\n# TASK RESULTS\n\n![Swagger](assets/swagger.png)\n![Кeset_password_email](assets/reset_password_email.png)\n![Test_coverage_75_percents](assets/test_coverage_75_percents.png)\n![Test_coverage_75_percents_2](assets/test_coverage_75_percents_2.png)\n![Docker_container](assets/docker_container.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesiaukr%2Fgoit-pythonweb-hw-12","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesiaukr%2Fgoit-pythonweb-hw-12","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesiaukr%2Fgoit-pythonweb-hw-12/lists"}