{"id":29480869,"url":"https://github.com/aquaracer/fastapi-user-profile-microservice","last_synced_at":"2026-04-13T00:35:29.407Z","repository":{"id":304117399,"uuid":"1017810384","full_name":"aquaracer/Fastapi-User-Profile-Microservice","owner":"aquaracer","description":"Асинхронный микросервис для управления профилями пользователей с поддержкой геолокационного поиска, кэширования и JWT-аутентификации. Стек: Python, Fastapi, Sqlalchemy, PostgreSQL, Postgis, Redis, JWT, Poetry Redis, ","archived":false,"fork":false,"pushed_at":"2025-07-11T06:44:25.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-11T10:20:30.399Z","etag":null,"topics":["alembic","docker-compose","fastapi","jwt-authentication","postgis","postgres","pydantic","python3","redis-cache"],"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/aquaracer.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-07-11T06:16:24.000Z","updated_at":"2025-07-11T06:47:59.000Z","dependencies_parsed_at":"2025-07-11T10:22:58.423Z","dependency_job_id":"02c01b61-7cf8-467d-90c7-24d7c391824a","html_url":"https://github.com/aquaracer/Fastapi-User-Profile-Microservice","commit_stats":null,"previous_names":["aquaracer/fastapi-user-profile-microservice"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/aquaracer/Fastapi-User-Profile-Microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaracer%2FFastapi-User-Profile-Microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaracer%2FFastapi-User-Profile-Microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaracer%2FFastapi-User-Profile-Microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaracer%2FFastapi-User-Profile-Microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquaracer","download_url":"https://codeload.github.com/aquaracer/Fastapi-User-Profile-Microservice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaracer%2FFastapi-User-Profile-Microservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271732362,"owners_count":24811309,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["alembic","docker-compose","fastapi","jwt-authentication","postgis","postgres","pydantic","python3","redis-cache"],"created_at":"2025-07-14T23:11:44.204Z","updated_at":"2026-04-13T00:35:29.342Z","avatar_url":"https://github.com/aquaracer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Profile Microservice\n\n[![FastAPI](https://img.shields.io/badge/FastAPI-0.115.12-green?logo=fastapi)](https://fastapi.tiangolo.com/)\n[![PostgreSQL/PostGIS](https://img.shields.io/badge/PostGIS-16--3.5-blue?logo=postgresql)](https://postgis.net/)\n[![Redis](https://img.shields.io/badge/Redis-5.2.1-red?logo=redis)](https://redis.io/)\n[![Docker Compose](https://img.shields.io/badge/Docker--Compose-3.9-blue?logo=docker)](https://docs.docker.com/compose/)\n[![Python](https://img.shields.io/badge/Python-\u003e=3.10-blue?logo=python)](https://www.python.org/)\n[![SQLAlchemy](https://img.shields.io/badge/SQLAlchemy-2.0.40-red?logo=sqlalchemy)](https://www.sqlalchemy.org/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-blue?logo=postgresql)](https://www.postgresql.org/)\n[![Docker](https://img.shields.io/badge/Docker-24.0.7-blue?logo=docker)](https://www.docker.com/)\n[![Pydantic](https://img.shields.io/badge/Pydantic-2.8.1-green?logo=pydantic)](https://docs.pydantic.dev/)\n[![ruff](https://img.shields.io/badge/ruff-0.12.2-yellow?logo=python)](https://docs.astral.sh/ruff/)\n[![Prometheus](https://img.shields.io/badge/Prometheus-2.51.2-orange?logo=prometheus)](https://prometheus.io/)\n[![Grafana](https://img.shields.io/badge/Grafana-10.4.2-orange?logo=grafana)](https://grafana.com/)\n\n---\n\n## Описание\n\nАсинхронный микросервис для управления профилями\nпользователей с поддержкой геолокационного поиска, кэширования и JWT-аутентификации.\nСервис построен на FastAPI, использует PostgreSQL с расширением PostGIS для хранения\nгеоданных и Redis для кэширования.\n\n---\n\n## 🚀 Основные возможности\n\n- Регистрация и обновление профиля пользователя (с валидацией возраста 18+)\n- Поиск профилей по радиусу и возрасту (геолокация через PostGIS)\n- Кэширование результатов поиска в Redis (ускорение повторных запросов)\n- JWT-аутентификация (доступ только с валидным токеном)\n- Асинхронная работа с БД и кэшем\n- Докеризация и миграции через Alembic\n- Cбор, хранение и визуализация метрик через Prometheus, Grafana\n\n## 🛠️ Технологический стек\n\n- **Python 3.12** — основной язык разработки\n- **FastAPI** — современный асинхронный web-фреймворк\n- **SQLAlchemy** — ORM для работы с базой данных (async)\n- **Alembic** — миграции схемы БД\n- **PostgreSQL + PostGIS** — реляционная база данных с поддержкой геоданных\n- **Redis** — кэширование и хранение сессий (асинхронный доступ)\n- **Docker, docker-compose** — контейнеризация и оркестрация сервисов\n- **Poetry** — управление зависимостями и пакетами\n- **Pydantic** — валидация и сериализация данных\n- **Ruff** — быстрый и современный линтер для Python\n- **Prometheus** — сбора и хранения метрик микросервиса\n- **Grafana** — визуализация метрик и построения дашбордов на основе данных из Prometheus\n\n---\n\n### Слои приложения\n\n- **Контроллеры**: обработка HTTP-запросов, валидация, возврат ошибок\n- **Сервисы**: бизнес-логика, кэширование, агрегация данных\n- **Репозитории**: работа с БД через SQLAlchemy\n- **Кэш**: асинхронное взаимодействие с Redis\n- **Модели и схемы**: структура данных, Pydantic и SQLAlchemy\n- **Исключения**: централизованная обработка ошибок\n\n---\n### Метрики по приложению в Grafana\n\n![Метрики по приложению FastAPI в Grafana](docs/grafana_dashboard_example.png)\n\n\n## Быстрый старт\n\n### Развертывание с помощью Docker\n\n1. Создайте папку с проектом и склонируйте репозиторий:\n\n```bash\nmkdir user_profile_service\ncd user_profile_service\ngit clone https://github.com/aquaracer/Fastapi-User-Profile-Microservice.git\n```\n\n2. Настройте переменные окружения в файле .env\n\n3. Соберите и запустите контейнеры:\n\n```bash\ndocker-compose up --build\n```\n\n4. Примените миграции базы данных:\n\n```bash\ndocker exec -it user_profile_service bash\npoetry run alembic upgrade head\n```\n\nПриложение будет доступно по следующим адресам:\n\n- API: `http://localhost:8000`\n- Swagger UI: `http://localhost:8000/docs`\n- ReDoc: `http://localhost:8000/redoc`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaracer%2Ffastapi-user-profile-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquaracer%2Ffastapi-user-profile-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaracer%2Ffastapi-user-profile-microservice/lists"}