ClaudeFastAPIAPI Design
FastAPI Claude Rules
Claude rules for FastAPI: project structure, async SQLAlchemy, testing, and production patterns.
CLAUDE.md
- Use async SQLAlchemy with asyncpg for database access - Structure with: routers/, schemas/, services/, repositories/ directories - Use alembic for migrations; never use SQLAlchemy's create_all in production - Write pytest-asyncio tests; use HTTPX AsyncClient for testing endpoints - Add structlog for structured JSON logging with request correlation IDs - Use slowapi for rate limiting; implement it at the router level - Use Redis + fastapi-cache2 for response caching with per-endpoint TTLs - Enable OpenTelemetry tracing for distributed observability
How to use with Claude
Create a `CLAUDE.md` file in your project root. Claude Code reads this on startup and follows your conventions throughout the session.
#fastapi#sqlalchemy#claude#async#coding-rules
Related Rules
React Claude Rules
ClaudeReact
Claude rules for React: component design, state patterns, performance, and testing conventions in CLAUDE.md.
Architecture
react · claudeCopy Ready
Next.js Claude Rules
ClaudeNext.js
Claude rules for Next.js App Router: streaming, server actions, caching, and production deployment patterns.
Architecture
nextjs · claudeCopy Ready
Go Claude Rules
ClaudeGo
Claude rules for Go: project structure, error handling, testing, and idiomatic Go patterns.
Architecture
go · golangCopy Ready
Rust Claude Rules
ClaudeRust
Claude rules for Rust: zero-cost abstractions, async with Tokio, error types, and high-performance Rust patterns.
Performance
rust · tokioCopy Ready