Fastro · The Benav Labs FastAPI Boilerplate¶
A production-ready FastAPI boilerplate to speed up your development.
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:
Your API will be available at http://localhost:8000/docs
Continue with the Getting Started Guide →
Documentation Structure¶
For New Users¶
- Getting Started - Quick setup and first steps
- User Guide - Comprehensive feature documentation
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.
Community & Support¶
- Discord Community - Join our Discord server to connect with other developers
- GitHub Issues - Bug reports and feature requests