Store
AI Rules FileArchive

Python + FastAPI Bundle

For Python developers building production FastAPI services

A complete CLAUDE.md rules file for Python + FastAPI projects. Covers async patterns, Pydantic v2, dependency injection, SQLAlchemy 2.0, and production deployment patterns.

Created

Description

Everything your AI assistant needs to know about modern FastAPI: async route handlers, Pydantic v2 model patterns, proper dependency injection chains, SQLAlchemy 2.0 async sessions, background tasks, middleware, and the production config patterns that docs gloss over.

What's included

  • CLAUDE.md rules file (930+ lines)
  • README.md — installation for Claude Code, Cursor, Windsurf, Copilot
  • Customization guide

Sample content

  • Async routes require async dependencies

    Mixing sync and async in the dependency chain causes thread pool exhaustion under load. If your route is `async def`, all its dependencies should be too.

  • Pydantic v2: model_validator replaces root_validator

    `@root_validator` is Pydantic v1. Use `@model_validator(mode='before')` or `mode='after'` in v2. Silent breakage if you mix v1 and v2 patterns.

  • SQLAlchemy 2.0 async sessions require AsyncSession

    `Session` is synchronous. For async FastAPI routes, use `AsyncSession` from `sqlalchemy.ext.asyncio`. Passing a sync session to an async route blocks the event loop.

3 of 930 included items previewed above.

Delivery

Instant download after Stripe checkout. File: nightforge-python-fastapi-bundle.zip