Backend 950 installs

FastAPI Project Templates

by wshobson/agents

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI…

Skill content

Production-ready FastAPI project structure with async patterns, dependency injection, and layered architecture.

- Provides recommended directory layout separating API routes, models, schemas, services, and repositories for maintainable codebases

- Includes base repository pattern for generic CRUD operations and service layer for business logic encapsulation

- Demonstrates async/await patterns throughout, from database sessions to route handlers, with proper lifespan management and middleware setup

- Covers authentication via JWT tokens, password hashing with bcrypt, and dependency-based authorization checks on protected endpoints

- Includes async testing patterns with pytest fixtures for in-memory SQLite and dependency override for isolated unit tests

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: