Skip to content

Fastro · The Benav Labs FastAPI Boilerplate

Fastro - open-source FastAPI boilerplate Fastro - open-source FastAPI boilerplate

A production-ready FastAPI boilerplate to speed up your development.

FastAPI Pydantic PostgreSQL Redis Docker

What is FastAPI Boilerplate?

FastAPI Boilerplate is a comprehensive, production-ready template that provides everything you need to build scalable, async APIs using modern Python technologies. It combines the power of FastAPI with industry best practices to give you a solid foundation for your next project.

Core Technologies

This boilerplate leverages cutting-edge Python technologies:

  • FastAPI - Modern, fast web framework for building APIs with Python 3.7+
  • Pydantic V2 - Data validation library rewritten in Rust (5x-50x faster)
  • SQLAlchemy 2.0 - Python SQL toolkit and Object Relational Mapper
  • PostgreSQL - Advanced open source relational database
  • Redis - In-memory data store for caching and message brokering
  • Taskiq - Async-first task queue with Redis/RabbitMQ brokers
  • Docker - Containerization for easy deployment

Key Features

Performance & Scalability

  • Fully async architecture
  • Pydantic V2 for ultra-fast data validation
  • SQLAlchemy 2.0 with efficient query patterns
  • Built-in caching with Redis or Memcached

Security & Authentication

  • Server-side session authentication with secure HTTP-only cookies
  • OAuth 2.0 sign-in (Google, with GitHub provider scaffolded) using PKCE
  • API keys with per-key permissions and usage tracking
  • CSRF protection and login rate limiting
  • Role-based access control with user tiers
  • Production-ready security configurations

Developer Experience

  • Comprehensive CRUD operations with FastCRUD
  • Automatic API documentation
  • Database migrations with Alembic
  • Background task processing
  • Extensive test coverage
  • Docker Compose for easy development

Production Ready

  • Environment-based configuration
  • Structured logging
  • Health checks and monitoring
  • Database connection pooling
  • Async task processing with Taskiq workers

Quick Start

Get up and running in less than 5 minutes. Pick whichever fits your workflow:

git clone https://github.com/benavlabs/fastapi-boilerplate
cd fastapi-boilerplate/backend
uv sync --extra dev
cp .env.example .env  # then edit values as needed
uv run fastapi dev src/interfaces/main.py
git clone https://github.com/benavlabs/fastapi-boilerplate
cd fastapi-boilerplate/backend
docker compose up

Your API will be available at http://localhost:8000/docs

Continue with the Getting Started Guide →

Documentation Structure

For New Users

For Developers

  • Development - Extending and customizing the boilerplate
  • Testing - Testing strategies and best practices
  • Production - Production deployment guides

Perfect For

  • REST APIs - Build robust, scalable REST APIs
  • Microservices - Create microservice architectures
  • SaaS Applications - Multi-tenant applications with user tiers
  • Data APIs - APIs for data processing and analytics

Building a complete SaaS? Meet FastroAI

Fastro is the free foundation. FastroAI builds on the same base for shipping a full SaaS - Stripe billing (subscriptions, credits, discounts), entitlements, transactional email, a frontend, and AI agents - all wired together, so you don't build them from scratch.

FastroAI - the complete SaaS template FastroAI - the complete SaaS template

Community & Support


Benav Labs - benav.io Benav Labs - benav.io