Developers need production-ready FastAPI project structures without starting from scratch. This skill provides complete templates with async patterns, dependency injection, and layered architecture for high-performance APIs.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「fastapi-templates」。 Create a FastAPI project with user registration and login
預期結果:
- Generated app/ directory with api/, core/, models/, schemas/, services/, and repositories/ subdirectories
- JWT authentication endpoints with token-based security
- Async SQLAlchemy database configuration with session management
- Pydantic schemas for request validation and response models
正在使用「fastapi-templates」。 Add repository pattern to existing user endpoints
預期結果:
- Created UserRepository with async CRUD methods
- Extracted business logic to UserService layer
- Updated endpoints to use dependency injection for services
- Added unit test fixtures for repository testing
安全審計
安全Static analysis flagged 32 patterns, but all are false positives. This is a documentation skill containing markdown code examples and templates, not executable code. External command detections are markdown backtick code blocks. Network findings reference test mocks. Environment access patterns show standard configuration examples. No actual security risks exist.
品質評分
你能建構什麼
Startup API Development
Quickly scaffold a new FastAPI project with authentication, database integration, and proper project structure for MVP development.
Microservice Template
Generate consistent API structures across multiple microservices with standardized error handling and dependency injection patterns.
Learning Resource
Study production-ready patterns for async operations, repository pattern, and layered architecture in modern Python APIs.
試試這些提示
Create a new FastAPI project with user authentication, PostgreSQL database, and basic CRUD endpoints for a resource.
Add JWT-based authentication to my existing FastAPI project with token refresh and password reset functionality.
Refactor my FastAPI routes to use repository and service layers with async database operations and proper dependency injection.
Generate a production-ready microservice with FastAPI including health checks, structured logging, error handling middleware, and Docker configuration.
最佳實務
- Use async database operations throughout to avoid blocking the event loop
- Separate concerns with repository, service, and API layers for testability
- Validate all inputs with Pydantic schemas and handle errors consistently
避免
- Using synchronous database drivers in async route handlers
- Placing business logic directly in route handlers instead of service layer
- Accessing database directly from routes without repository abstraction