- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
19 lines
1 KiB
Markdown
19 lines
1 KiB
Markdown
---
|
|
name: "FastAPI Architecture"
|
|
description: "Enforces standards for FastAPI route controllers, Pydantic data schemas, and dependency injection."
|
|
---
|
|
|
|
# Skill: FastAPI Architecture
|
|
|
|
## 1. Purpose
|
|
Maintain a uniform, scalable structure in the backend application, ensuring separation of routing, business logic, and database access.
|
|
|
|
## 2. When to Use
|
|
Before editing or adding backend controllers, routers, or schemas.
|
|
|
|
## 3. Step-by-Step Checklist
|
|
1. **Router Separation**: Place routes inside domain-specific submodules and register them on the main router.
|
|
2. **Pydantic Schemas**: Separate request body schemas, response schemas, and database entity models.
|
|
3. **Dependency Injection**: Use `Depends` for database sessions, security authentication, and permissions.
|
|
4. **Error Handling**: Throw structured HTTPExceptions with clear detail messages rather than generic exceptions.
|
|
5. **Types and Documentation**: Add typing annotations and descriptions to all endpoint parameters for auto-generated OpenAPI documentation.
|