skillfed

fastapi-templates

fastapi-templates provides structured blueprints for launching FastAPI applications with async/await patterns, built-in dependency injection, and organized layouts for routes, models, and business logic. Start new projects with proper separation of concerns and testing infrastructure already in place.

fastapi-templates sets up new FastAPI projects with production-ready structure, async patterns, and dependency injection.

AI-generated summary based on this skill's SKILL.md

38,308 4,097 MIT updated by wshobson

Install

wshobson/agents/fastapi-templates · repository language: Python

git clone https://github.com/wshobson/agents
cp -r agents/plugins/api-scaffolding/skills/fastapi-templates ~/.claude/skills/fastapi-templates
npx skillfed install wshobson/agents/fastapi-templates

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I structure a FastAPI app using fastapi-templates?

fastapi-templates provides organized project layouts that separate routes, models, and business logic into distinct modules. The templates include proper directory structures with configuration management, database connections, and middleware setup, so you can start building with best practices already in place rather than organizing from scratch.

What async patterns does fastapi-templates support?

fastapi-templates demonstrates async/await patterns throughout its blueprints, including async database queries, async middleware, and proper event loop handling. The templates show how to leverage FastAPI's native async support for high-performance operations and include examples of async dependency injection for managing resources efficiently.

Can fastapi-templates help me build microservices?

Yes. fastapi-templates includes setup patterns for microservices and high-performance web services, with examples of API versioning, service-to-service communication, and modular architecture. The templates support building scalable services that can be deployed independently while maintaining clean separation of concerns.

Is fastapi-templates production-ready out of the box?

fastapi-templates provides production-ready structure with error handling, testing infrastructure using pytest, middleware configuration, and proper logging setup. While you'll customize business logic for your use case, the template gives you a solid foundation for deployment with security and reliability patterns already configured.

How does fastapi-templates implement dependency injection?

fastapi-templates demonstrates FastAPI's built-in dependency injection system through practical examples in its templates. You'll find patterns for managing database sessions, authentication, configuration, and other dependencies, showing how to inject them cleanly into route handlers and business logic without tight coupling.

What database support does fastapi-templates include?

fastapi-templates includes templates for async database integration, with examples for PostgreSQL and other databases using async drivers. The templates show repository patterns and async ORM setup, allowing you to build data layers that work efficiently with FastAPI's async capabilities.

SKILL.md

rendered from the published skill — quoted content, verbatim

FastAPI Project Templates

Production-ready FastAPI project structures with async patterns, dependency injection, middleware, and best practices for building high-performance APIs.

When to Use This Skill

  • Starting new FastAPI projects from scratch
  • Implementing async REST APIs with Python
  • Building high-performance web services and microservices
  • Creating async applications with PostgreSQL, MongoDB
  • Setting up API projects with proper structure and testing

Core Concepts

1. Project Structure

Recommended Layout:

``` app/ ├── api/ # API routes │ ├── v1/ │ │ ├── endpoints/ │ │ │ ├── users.py │ │ │ ├── auth.py │ │ │ └── items.py │ │ └── router.py │ └── dependencies.py # Shared dependencies ├── core/ # Core configuration │ ├── config.py │ ├── security.py │ └── database.py ├── models/ # Database models │ ├── user.py │ └──

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 2 files
plugins/api-scaffolding/skills/fastapi-templates/SKILL.md
plugins/api-scaffolding/skills/fastapi-templates/references/details.md

Related skills

Tags

api-scaffolding async-framework backend-starter layered-architecture python-web-dev