Agent skill · software engineering · aiskillstore
fastapi-app
Use when creating FastAPI backend applications - route handlers, dependencies, CORS config, or Pydantic models. NOT when frontend logic, non-Python backends, or unrelated server-side code. Triggers: "FastAPI", "student endpoint", "API route", "dependency injection", "CORS", "Pydantic model".
Why this skill is useful
Provides specific FastAPI patterns and configurations that the AI wouldn't reliably generate on its own.
What it needs
Requires fastapi, sqlalchemy installed locally. About 7k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
FastAPI Application Skill Overview Expert guidance for building FastAPI backend applications with route decorators, dependency injection, CORS configuration, and Pydantic v2 validation. Supports ERP endpoints for students, fees, attendance, and authentication. When This Skill Applies This skill triggers when users request: App Setup: "Create FastAPI app", "Initialize FastAPI", "Lifespan events" Routes: "Student endpoint", "API route", "GET/POST handler", "APIRouter" Dependencies: "DB dependency", "Auth dependency", "Depends()", "JWT auth" CORS: "CORS enable frontend", "Cross-origin config", "credentials" Models: "Pydantic model", "Student schema", "Fee validation" Core Rules 1. Init: FastAPI App and Lifespan Requirements: Use FastAPI() with lifespan context manager Configure CORS for frontend origins Include routers with APIRouter Set up logging for production Enable Swagger docs at /docs 2. Routes: APIRouter with Tags and Responses Requirements: Use APIRouter with prefix and tags Response models with Pydantic schemas Proper HTTP status codes (200, 201, 204, 404, 400) Dependencies for auth and DB Pagination with skip/limit 3. Dependencies: Auth and DB Sessions Requirements: Async SQLAlchemy sessions with context manager JWT token creation and validation HTTPBearer for token extraction Role-based access control Environment variables for secrets 4. Pydantic v2 Models Requirements: Use Pydantic v2 ConfigDict instead of Config class Field validation with min/max, patterns, gt/lt EmailStr for email validation Enum for status fields Optional fields with defaults Fromattributes for ORM compatibility Output Requirements Code Files 1. Main Application: main.py - FastAPI app initialization config.py - Settings and environment variables 2. Routers: routers/init.py routers/students.py routers/fees.py routers/attendance.py routers/auth.py 3. Dependencies: dependencies/init.py dependencies/database.py dependencies/auth.py 4. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/fastapi-app