Sherdos /
restaurant-FastApi
API menu in a restaurant on FastAPI with CRUD systems, asyncio routers, asyncio test on pytest, cache on redis and with Docker for simple run
61/100 healthLoading repository data…
AkashAkuthota / repository
Async FastAPI REST API service for fetching, validating, storing, and refreshing GitHub repository metadata using PostgreSQL, SQLAlchemy, Alembic, Docker, and GitHub Actions CI.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
An async REST API that accepts GitHub repository URLs, fetches metadata from the GitHub REST API, and persists it in PostgreSQL. Built with FastAPI, async SQLAlchemy, and httpx.
Selected from shared topics, language and repository description—not editorial ratings.
Sherdos /
API menu in a restaurant on FastAPI with CRUD systems, asyncio routers, asyncio test on pytest, cache on redis and with Docker for simple run
61/100 healthenesduru96 /
High-performance Async Note Taking API template featuring Encryption at Rest, Redis Caching, and Advanced JWT Security.
38/100 healthZeinkunn /
This service provides CRUD endpoints for GitHub repository metadata. Submitting a GitHub URL triggers a live fetch from the GitHub API; the result is validated, stored in PostgreSQL, and returned to the caller. Subsequent reads are served from the local database without hitting GitHub.
The project is structured as a production-oriented backend service: fully async, layered architecture, typed throughout, and covered by unit and integration tests.
The fastest path to a running service:
# Clone and start (PostgreSQL + migrations + API server — all-in-one)
docker compose up --build
To run the test suite (requires a separate test database — see Testing):
pytest -v
The codebase follows a strict three-layer architecture. Layers only communicate downward — routes call services, services call the repository layer and the GitHub client, nothing flows upward.
┌──────────────────────────────────────────────────────┐
│ HTTP Client │
└────────────────────────┬─────────────────────────────┘
│ HTTP request
┌────────────────────────▼─────────────────────────────┐
│ API Layer (app/api/) │
│ Route handlers — validate input, delegate to │
│ service, return typed response. Zero logic here. │
└────────────────────────┬─────────────────────────────┘
│ Domain calls
┌────────────────────────▼─────────────────────────────┐
│ Service Layer (app/services/) │
│ Orchestrates use cases: parse URL, fetch GitHub, │
│ check duplicates, persist, return response schema. │
└──────────────┬──────────────────────┬────────────────┘
│ │
┌──────────────▼──────────┐ ┌────────▼────────────────┐
│ Repository Layer │ │ GitHub Client │
│ (app/repositories/) │ │ (app/services/ │
│ Async SQLAlchemy — all │ │ github_client.py) │
│ DB access lives here. │ │ httpx.AsyncClient — │
│ │ │ maps HTTP → exceptions. │
└──────────────┬──────────┘ └────────┬────────────────┘
│ │
┌──────────────▼──────────┐ ┌────────▼────────────────┐
│ PostgreSQL │ │ GitHub REST API │
└─────────────────────────┘ └─────────────────────────┘
Exception flow: domain exceptions (app/core/exceptions.py) propagate from services upward, and are mapped to HTTP status codes exclusively in app/api/exception_handlers.py. No layer below the API layer imports FastAPI or HTTP status codes.
| Component | Library | Version |
|---|---|---|
| Web framework | FastAPI | 0.115.x |
| ASGI server | Uvicorn | 0.30.x |
| ORM | SQLAlchemy (async) | 2.0.x |
| Database driver | asyncpg | 0.29.x |
| Migrations | Alembic | 1.13.x |
| Validation | Pydantic v2 | 2.7.x |
| Settings | pydantic-settings | 2.3.x |
| HTTP client | httpx | 0.27.x |
| Logging | structlog | 24.x |
| Testing | pytest + pytest-asyncio | 8.x / 0.23.x |
| HTTP mocking | respx | 0.21.x |
github-metadata-service/
├── app/
│ ├── api/
│ │ ├── dependencies.py # Typed Annotated aliases (DBSession, RepoService)
│ │ ├── exception_handlers.py # Domain exception → HTTP status code mapping
│ │ └── v1/
│ │ └── repositories.py # Route handlers — thin, no logic
│ ├── core/
│ │ ├── config.py # pydantic-settings, all env vars
│ │ ├── exceptions.py # Domain exception hierarchy
│ │ └── logging.py # structlog configuration
│ ├── db/
│ │ ├── base.py # SQLAlchemy DeclarativeBase
│ │ └── session.py # Async engine, session factory, get_db_session
│ ├── models/
│ │ └── repository.py # Repository ORM model
│ ├── schemas/
│ │ ├── github.py # GitHub API response schema (internal)
│ │ └── repository.py # API request/response schemas (public)
│ ├── repositories/
│ │ └── repository_repo.py # All database access for Repository model
│ ├── services/
│ │ ├── github_client.py # httpx.AsyncClient wrapper, exception mapping
│ │ └── repository_service.py # Use-case orchestration
│ └── main.py # App factory, lifespan, health endpoints
├── alembic/
│ ├── env.py # Async-aware Alembic environment
│ ├── script.py.mako
│ └── versions/
│ └── 20260526_0001_create_repositories_table.py
├── tests/
│ ├── conftest.py # Shared fixtures: engine, client, mock_github_api
│ ├── unit/
│ │ ├── test_github_url_validation.py
│ │ ├── test_repository_service.py
│ │ └── test_github_client.py
│ └── integration/
│ └── test_repositories_api.py
├── .env.example
├── alembic.ini
├── docker-compose.yml
├── Dockerfile
└── pyproject.toml
git clone https://github.com/your-org/github-metadata-service.git
cd github-metadata-service
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Production dependencies
pip install -e .
# Development dependencies (includes test tools, linter, type checker)
pip install -e ".[dev]"
cp .env.example .env
# Edit .env — at minimum, set DATABASE_URL and optionally GITHUB_TOKEN
alembic upgrade head
All variables are read from a .env file in the project root. Copy .env.example to get started.
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | — | Async PostgreSQL connection string. Must use postgresql+asyncpg:// scheme. |
GITHUB_TOKEN | No | "" | GitHub personal access token. Unauthenticated rate limit: 60 req/hr. Authenticated: 5,000 req/hr. |
APP_ENV | No | development | Runtime environment. Accepted: development, staging, production. Controls log format (JSON in production). |
APP_NAME | No | github-metadata-service | Service name injected into structured log output. |
DEBUG | No | false | Enable debug mode. Do not set true in production. |
LOG_LEVEL | No | INFO | Log level. Accepted: DEBUG, INFO, WARNING, ERROR, CRITICAL. |
DB_POOL_SIZE | No | 10 | SQLAlchemy connection pool size. |
DB_MAX_OVERFLOW | No | 20 | Maximum connections above pool size. |
DB_POOL_TIMEOUT | No | 30 | Seconds to wait for a connection from the pool before raising. |
GITHUB_API_BASE_URL | No | https://api.github.com | GitHub API base URL. Override for testing against a mock server. |
GITHUB_REQUEST_TIMEOUT | No | 10.0 | Per-request timeout in seconds for GitHub API calls. |
TEST_DATABASE_URL | No* | postgresql+asyncpg://postgres:postgres@localhost:5433/github_metadata_test | Separate database for the test suite. Never points at the development DB. |
*Required when running the integration test suite.
DATABASE_URL format:
postgresql+asyncpg://USER:PASSWORD@HOST:PORT/DBNAME
Example:
postgresql+asyncpg://postgres:postgres@localhost:5432/github_metadata
If you have Docker available:
docker run -d \
--name github-metadata-db \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=github_metadata \
-p 5432:5432 \
postgres:16-alpine
alembic upgrade head
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000.
Interactive docs: http://localhost:8000/docs
Alternative docs: http://localhost:8000/redoc
Docker Compose starts PostgreSQL, waits for the health check to pass, runs migrations, and starts the API server — in a single command.
# Optional: set your GitHub token to avoid rate limits
export GITHUB_TOKEN=ghp_your_token_here
docker compose up --build
The service is available at http://localhost:8000 once the app container logs application_startup.
# Stop and remove containers (data volume is preserved)
docker compose down
# Stop and remove containers AND the database volume
docker compose down -v
This project uses Alembic for schema migrations. The alembic/env.py is configured for async SQLAlchemy using the run_sync bridge pattern required by asyncpg.
# Apply all pending migrations
alembic upgrade head
# Roll back the most recent migration
alembic downgrade -1
# Roll back all migrations (returns to empty schema)
alembic downgrade base
# Show migration history
alembic history --verbose
# Show current applied revision
alembic current
# Generate a new migration (requires a running DB)
alembic revision --autogenerate -m "add_column_x_to_repositories"
Note: Always review autogenerated migrations before applying. Alembic's autogenerate does not detect all changes (e.g. server defaults, some index changes).
http://localhost:8000/api/v1
POST /repositoriesSubmit a GitHub repository URL. Fetches metadata from GitHub and stores it locally.
Request body:
{
"github_url": "https://github.com/tiangolo/fastapi"
}
Success response — 201 Created:
{
"id": 1,
"github_id": 116195547,
"owner": "tiangolo",
"repo_name": "fastapi",
"full_name": "tiangolo/fastapi",
"description": "FastAPI framework, high performance, easy to learn, fast to code",
"html_url": "https://github.com/tiangolo/fastapi",
"stars": 75000,
"forks": 6100,
"language": "Python",
"github_created_at": "2018-12-08T08:21:47Z",
"github_updated_at": "2024-01-15T10:00:00Z",
"created_at": "2026-05-26T12:00:00Z",
A scalable AI-ready backend with FastAPI and pgvector — supporting RAG vector memory, async PostgreSQL, and production Docker setup.
elkliueva /
Async FastAPI backend that caches Riot API match data in Postgres and serves it via REST.
53/100 healthbogdan0089 /
Production-ready async e-commerce REST API. FastAPI + PostgreSQL + Redis + Stripe + WebSocket. Clean Architecture, JWT auth, RBAC, pytest, Docker, deployed on AWS EC2.
53/100 health9meows /
# online-store-api REST API for an online store: authentication, product categories, product management, and a feedback system.
46/100 health