fastapi-templates
快速建立 FastAPI 專案模板
你需要一個包含非同步和依賴注入模式的乾淨 FastAPI 結構。此技能提供佈局和程式碼範例,以啟動可投入生產的 API。
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "fastapi-templates". Plan a FastAPI user service template with async patterns
Résultat attendu:
- api、core、models、schemas、services、repositories 的資料夾佈局
- 非同步資料庫會話依賴和應用程式生命週期流程
- 使用者儲存庫和服務職責
- 端點和測試設定概述
Utilisation de "fastapi-templates". How do I set up dependency injection for database sessions?
Résultat attendu:
- 使用來自 SQLAlchemy 的 AsyncSessionLocal 搭配 sessionmaker
- 建立帶有 try/except/finally 的 get_db 非同步生成器依賴
- 在測試中使用測試資料庫會話覆寫依賴
- 成功時提交,發生例外時回滾
Audit de sécurité
SûrThis is a documentation-only skill containing architectural guidance and code examples for FastAPI projects. All 41 static findings are FALSE POSITIVES: cryptographic algorithms (bcrypt, HS256) shown are industry-standard secure choices; backtick patterns are markdown code delimiters, not shell execution; environment variable references are Pydantic configuration definitions, not secret access. The skill has no executable code, network calls, or filesystem access capabilities.
Facteurs de risque
🌐 Accès réseau (2)
⚙️ Commandes externes (14)
🔑 Variables d’environnement (7)
Score de qualité
Ce que vous pouvez construire
新 API 基準
為新服務定義包含非同步、依賴注入和測試模式的 FastAPI 結構。
MVP API 設定
取得清晰的專案佈局和首個 FastAPI MVP 的核心模式。
團隊架構指南
標準化多個 API 之間的儲存庫和服務層模式。
Essayez ces prompts
提供乾淨的 FastAPI 資料夾結構,並簡要說明每個資料夾和檔案的用途。
展示使用依賴注入和安全提交處理的最小非同步資料庫會話設定。
草擬用於非同步 CRUD 的基礎儲存庫模式,以及使用它的使用者服務層。
概述 JWT 認證流程和使用者端點的最小非同步測試策略。
Bonnes pratiques
- 在路由、資料庫和背景工作中保持非同步
- 為清晰起見,分離路由、服務和儲存庫
- 使用 Pydantic 綱要以獲得一致的要求和回應資料
Éviter
- 將業務邏輯放在路由處理程序中
- 在非同步路由中使用封鎖式資料庫驅動程式
- 跳過核心使用者流程的測試