What problem does it solve?
This Skill ensures that all FastAPI code within the project adheres to established best practices, maintaining consistency, readability, and maintainability across the codebase.
Core Features & Use Cases
- Project Structure Guidance: Provides clear guidelines on organizing endpoints, services, repositories, and models.
- API Design Standards: Details best practices for using APIRouter, defining routes, and handling request/response models.
- Dependency Management: Explains how to correctly use FastAPI's dependency injection system for sessions, services, and repositories.
- Error Handling: Outlines strategies for robust error handling at API boundaries and within business logic.
- Async Operations: Guides on effectively using asynchronous operations to prevent blocking the event loop.
- Use Case: When adding a new API endpoint for user management, consult this Skill to ensure the endpoint is correctly placed, dependencies are injected properly, and response models are defined according to project standards.
Quick Start
Follow the FastAPI best practices outlined in this skill when developing new API routes or modifying existing ones.