{"id":28943067,"url":"https://github.com/dm-zhuk/goit-pythonweb-hw-10","last_synced_at":"2026-05-10T03:07:30.743Z","repository":{"id":297854950,"uuid":"997595832","full_name":"dm-zhuk/goit-pythonweb-hw-10","owner":"dm-zhuk","description":"REST API Advanced","archived":false,"fork":false,"pushed_at":"2025-06-16T17:29:10.000Z","size":5588,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-16T18:36:05.377Z","etag":null,"topics":["cloudinary","docker-compose","fastapi","sqlalchemy-python"],"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/dm-zhuk.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,"zenodo":null}},"created_at":"2025-06-06T19:54:43.000Z","updated_at":"2025-06-16T17:29:13.000Z","dependencies_parsed_at":"2025-06-07T23:35:58.930Z","dependency_job_id":null,"html_url":"https://github.com/dm-zhuk/goit-pythonweb-hw-10","commit_stats":null,"previous_names":["dm-zhuk/goit-pythonweb-hw-10"],"tags_count":0,"template":false,"template_full_name":"dm-zhuk/goit-pythonweb-hw-08","purl":"pkg:github/dm-zhuk/goit-pythonweb-hw-10","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dm-zhuk%2Fgoit-pythonweb-hw-10","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dm-zhuk%2Fgoit-pythonweb-hw-10/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dm-zhuk%2Fgoit-pythonweb-hw-10/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dm-zhuk%2Fgoit-pythonweb-hw-10/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dm-zhuk","download_url":"https://codeload.github.com/dm-zhuk/goit-pythonweb-hw-10/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dm-zhuk%2Fgoit-pythonweb-hw-10/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261416300,"owners_count":23155037,"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":["cloudinary","docker-compose","fastapi","sqlalchemy-python"],"created_at":"2025-06-23T04:41:01.874Z","updated_at":"2026-05-10T03:07:30.731Z","avatar_url":"https://github.com/dm-zhuk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contacts Management REST API on Python v.3.13.2\n\nThe Contacts Management REST API is a web application designed to manage user contacts efficiently. Built with FastAPI, this API provides a robust and scalable solution for performing CRUD (Create, Read, Update, Delete) operations on user contact information.\n\n## Features\n\n- **User Authentication:** Implements a secure authentication mechanism to verify user identities.\n- **JWT Authorization:** Utilizes JSON Web Tokens (JWT) for authorization, ensuring that all contact operations are performed only by registered users.\n- **User-Specific Access:** Each user has access only to their own contacts, preventing unauthorized access to others' data.\n- **Email Verification:** Supports email verification for newly registered users to confirm their identity.\n- **Rate Limiting:** Limits the number of requests to the `/me` endpoint to enhance security and prevent abuse.\n- **CORS Support:** Cross-Origin Resource Sharing is enabled, allowing secure interactions with the API from different origins.\n- **User Avatar Updates:** Provides functionality for users to update their profile avatars, utilizing Cloudinary for image hosting.\n- **Conflict Handling:** Returns HTTP 409 Conflict if a user tries to register with an existing email.\n- **Password Security:** Hashes passwords before storing them in the database to ensure security.\n- **Creation Responses:** Returns HTTP 201 Created status for successful user registrations and resource creation.\n- **Authentication on POST Requests:** Requires user authentication for all POST requests, accepting user credentials (username and password) in the request body.\n- **Unauthorized Access Handling:** Returns HTTP 401 Unauthorized if the user does not exist or if the password is incorrect.\n- **Environment Variables:** All sensitive data is stored in a `.env` file, with no hard-coded secrets in the application code.\n- **Docker Compose:** Uses Docker Compose to launch all services and databases, simplifying the deployment process.\n\n## Technologies Used\n\n- **FastAPI:** A modern, fast (high-performance) web framework for building APIs with Python 3.7+.\n- **PostgreSQL:** A powerful, open-source relational database for storing user and contact information.\n- **Redis:** Used for caching and rate limiting to enhance performance.\n- **Cloudinary:** Service for hosting user avatars.\n- **Docker:** Containerized application for easy deployment and scalability.\n\n## Getting Started\n\nTo run this API locally, clone the repository and follow the instructions in the installation section:\n\n# poetry install\n\n# docker-compose up --build -d\n\n# docker-compose exec web ls -l /app/src/services/templates\n\n# openssl rand -hex 32 (create JWT_SECRET)\n\n# Verify Redis is running:\n- **docker exec -it redis-cache redis-cli ping**\n\n## Project Structure\n.\n├── Dockerfile\n├── README.md\n├── docker-compose.yaml\n├── img\n├── poetry.lock\n├── postgres_data/\n├── pyproject.toml\n└── src\n    ├── main.py\n    ├── __init__.py\n    ├── database\n    │   ├── __init__.py\n    │   ├── connect.py\n    │   └── models.py\n    ├── repository\n    │   ├── __init__.py\n    │   ├── contacts.py\n    │   └── users.py\n    ├── routers\n    │   ├── __init__.py\n    │   ├── contacts.py\n    │   ├── users.py\n    │   └── utils.py\n    ├── schemas\n    │   ├── __init__.py\n    │   └── schemas.py\n    ├── services\n    │   ├── auth.py\n    │   ├── base.py\n    │   ├── cloudinary_config.py\n    │   ├── email.py\n    │   ├── get_upload.py\n    │   └── templates\n    │       └── email_template.html\n    ├── tests/\n    └── utils.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdm-zhuk%2Fgoit-pythonweb-hw-10","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdm-zhuk%2Fgoit-pythonweb-hw-10","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdm-zhuk%2Fgoit-pythonweb-hw-10/lists"}