← ClaudeAtlas

fastapi-applisted

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".
aiskillstore/marketplace · ★ 329 · API & Backend · score 79
Install: claude install-skill aiskillstore/marketplace
# 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 ```python # main.py from contextlib import asynccontextmanager from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from routers import students, fees, attendance, auth from dependencies.database import get_db from dependencies.auth import get_current_user import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) @asynccontextmanager async def lifespan(app: FastAPI): # Startup logger.info("Starting up FastAPI application...") yield # Shutdown logger.info("Shutting down FastAPI application...") app = FastAPI( title="ERP API", description="Educational Resource Planning API", version="1.0.0", lifespan=lifespan, docs_url="/