python-backend
Installation
SKILL.md
Python Backend
Production Python backend services with FastAPI, SQLModel, async PostgreSQL, and GCP Cloud Run deployment.
Core Architecture
The non-negotiable pattern is the layered flow. Each layer only calls the layer directly below it — never skip layers.
Router → Service → Repository → Database
| Layer | Responsibility | Constraint |
|---|---|---|
| Router | HTTP in/out, request validation, response mapping | No business logic, no direct DB access |
| Service | Business logic, orchestration | No SQLModel queries, no AsyncSession, no HTTP concerns |
| Repository | Data access, query building, ORM operations | No business logic, no HTTP-aware errors |
Supporting constructs (not layers):