
fastapi
by Razamirxa
SKILL.md
name: fastapi description: Comprehensive FastAPI development skill for building Python web APIs from hello world to production-ready applications. Use when building REST APIs, implementing authentication, integrating databases, adding WebSockets, creating microservices, or any FastAPI development task. Covers project scaffolding, CRUD operations, testing, deployment, and best practices.
FastAPI Development Skill
Build professional FastAPI applications from beginner to advanced level.
Quick Start
Create New Project
Use the scaffolding script to generate a new FastAPI project:
python scripts/scaffold_project.py <project-name> --template <template-type>
Template types:
hello-world- Minimal FastAPI app (default)rest-api- REST API with database integrationauth-api- API with JWT authenticationfull-stack- FastAPI backend + frontend integrationmicroservice- Microservice architecture
Add Features to Existing Project
# Add authentication
python scripts/add_auth.py
# Add database support
python scripts/add_database.py --db-type postgresql
# Generate CRUD endpoints for a model
python scripts/generate_crud.py --model User
Project Templates
Ready-made templates are available in assets/templates/:
- hello-world/ - Basic FastAPI application
- rest-api/ - REST API with SQLAlchemy database
- auth-api/ - Complete authentication system
- full-stack/ - Backend + frontend integration
- microservice/ - Microservice with Docker
Each template includes:
- Proper project structure
- Configuration management
- Testing setup
- Documentation
- Docker files
Reference Documentation
Comprehensive guides are available in references/:
- project-structure.md - Organizing FastAPI projects
- database.md - Database integration (SQLAlchemy, async)
- authentication.md - JWT, OAuth2 patterns
- crud-patterns.md - CRUD operation best practices
- testing.md - Testing strategies
- deployment.md - Deployment guides (Docker, cloud)
- websockets.md - WebSocket implementation
- background-tasks.md - Async job patterns
- middleware.md - Custom middleware
- best-practices.md - Performance, security, production tips
- api-design.md - RESTful API design patterns
Common Workflows
Workflow 1: Create a New API from Scratch
-
Scaffold the project:
python scripts/scaffold_project.py my-api --template rest-api -
Review the generated structure in
references/project-structure.md -
Define your models and generate CRUD:
python scripts/generate_crud.py --model Product -
Add authentication if needed:
python scripts/add_auth.py -
Write tests following patterns in
references/testing.md -
Deploy using guides in
references/deployment.md
Workflow 2: Add Database to Existing Project
-
Run the database setup script:
python scripts/add_database.py --db-type postgresql -
Review database patterns in
references/database.md -
Define models using SQLAlchemy
-
Generate CRUD endpoints:
python scripts/generate_crud.py --model YourModel
Workflow 3: Implement Authentication
-
Add authentication scaffolding:
python scripts/add_auth.py -
Review authentication patterns in
references/authentication.md -
Customize JWT settings and user model
-
Implement protected endpoints
Workflow 4: Build a Microservice
-
Create from microservice template:
python scripts/scaffold_project.py my-service --template microservice -
Review the generated Docker and docker-compose files
-
Implement service-specific endpoints
-
Deploy using containerization
Development Tips
When Starting a New Feature
- Check if a template exists in
assets/templates/ - Review relevant documentation in
references/ - Use scaffolding scripts to generate boilerplate
- Follow patterns from the references
When Stuck
- Project structure questions → See
references/project-structure.md - Database issues → See
references/database.md - Auth problems → See
references/authentication.md - Performance concerns → See
references/best-practices.md - Testing questions → See
references/testing.md - Deployment issues → See
references/deployment.md
Best Practices
Always refer to references/best-practices.md for:
- Performance optimization
- Security considerations
- Production deployment
- Error handling
- Logging strategies
- API versioning
Progressive Learning Path
Beginner (Hello World → Basic API)
- Start with
assets/templates/hello-world/ - Read
references/project-structure.md - Build simple endpoints with path/query parameters
Intermediate (Database Integration)
- Use
assets/templates/rest-api/ - Read
references/database.md - Implement CRUD operations
- Add validation with Pydantic
Advanced (Authentication & Production)
- Use
assets/templates/auth-api/ - Read
references/authentication.md - Implement JWT auth
- Add middleware and background tasks
- Write comprehensive tests
Professional (Microservices & Deployment)
- Use
assets/templates/microservice/ - Read
references/deployment.md - Containerize with Docker
- Set up CI/CD
- Deploy to cloud platforms
Scripts Reference
All scripts in scripts/ are designed to be run from the project root:
- scaffold_project.py - Generate new FastAPI project from template
- add_auth.py - Add JWT authentication to existing project
- add_database.py - Set up database configuration and models
- generate_crud.py - Generate CRUD endpoints for a model
- add_tests.py - Add test files for a module
Run any script with --help for detailed usage information.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です