feat(api): init FastAPI project with uv, SQLAlchemy async, Alembic, lib/ utilities#6
Merged
gracefullight merged 2 commits intomainfrom Mar 21, 2026
Merged
feat(api): init FastAPI project with uv, SQLAlchemy async, Alembic, lib/ utilities#6gracefullight merged 2 commits intomainfrom
gracefullight merged 2 commits intomainfrom
Conversation
…ib/ utilities Initialize the api/ subdirectory with: - pyproject.toml with FastAPI, SQLAlchemy[asyncio], asyncpg, alembic, redis, miniopy-async, pyjwt, pydantic-settings - src/main.py with FastAPI app, CORS, lifespan, /health endpoint - src/lib/config.py — pydantic-settings based configuration - src/lib/database.py — async SQLAlchemy engine + session factory - src/lib/redis.py — async Redis client - src/lib/storage.py — MinIO async client - src/lib/exceptions.py — AppError hierarchy + exception handlers - src/lib/pagination.py — response envelope models (PaginatedResponse, SuccessResponse) - src/lib/auth.py — JWT encode/decode + get_current_user dependency - Alembic configured for async migrations - AGENTS.md documenting Router→Service→Repository pattern Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add type: ignore for miniopy_async missing stubs in storage.py - Use generic T in PaginatedResponse/SuccessResponse data fields - Use Annotated[..., Depends()] pattern for CurrentUser dependency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
api/) with uv package managerdatabase.py,redis.py,storage.py,exceptions.py,pagination.py,auth.py,config.pyapi/AGENTS.mddocumenting Router→Service→Repository pattern{ data, meta, errors }for success,{ error: { code, message, details } }for errorsGET /healthTest plan
uv run pytest— health endpoint test passesuv run mypy src/— no type errorsuv run ruff check src/ tests/— no lint errors./scripts/harness/validate.sh— all architecture checks pass🤖 Generated with Claude Code