1- # Benav Labs FastAPI Boilerplate
1+ <h1 align =" center " > Benav Labs FastAPI boilerplate</h1 >
2+ <p align =" center " markdown =1 >
3+ <i >** Batteries-included FastAPI starter** with Pydantic v2, SQLAlchemy 2.0, PostgreSQL, Redis, ARQ jobs, rate-limiting and a minimal admin. Production-ready defaults, optional modules, and clear docs.</i >
4+ </p >
5+
6+ <p align =" center " >
7+ <a href =" https://benavlabs.github.io/FastAPI-boilerplate " >
8+ <img src="docs/assets/FastAPI-boilerplate.png" alt="Purple Rocket with FastAPI Logo as its window." width="25%" height="auto">
9+ </a >
10+ </p >
211
3- > ** Batteries-included FastAPI starter** with Pydantic v2, SQLAlchemy 2.0, PostgreSQL, Redis, ARQ jobs, rate-limiting and a minimal admin. Production-ready defaults, optional modules, and clear docs.
12+ <p align =" center " >
13+ <a href =" https://fastapi.tiangolo.com " >
14+ <img src="https://img.shields.io/badge/FastAPI-005571?style=for-the-badge&logo=fastapi" alt="FastAPI">
15+ </a >
16+ <a href =" https://www.postgresql.org " >
17+ <img src="https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white" alt="PostgreSQL">
18+ </a >
19+ <a href =" https://redis.io " >
20+ <img src="https://img.shields.io/badge/Redis-DC382D?logo=redis&logoColor=fff&style=for-the-badge" alt="Redis">
21+ </a >
22+ <a href =" https://deepwiki.com/benavlabs/FastAPI-boilerplate " >
23+ <img src="https://img.shields.io/badge/DeepWiki-1F2937?style=for-the-badge&logoColor=white" alt="DeepWiki">
24+ </a >
25+ </p >
426
527<p align =" left " >
628 <a href =" https://fastapi.tiangolo.com " >FastAPI</a >
1941
2042---
2143
44+ ## Features
45+
46+ * ⚡️ Fully async FastAPI + SQLAlchemy 2.0
47+ * 🧱 Pydantic v2 models & validation
48+ * 🔐 JWT auth (access + refresh), cookies for refresh
49+ * 👮 Rate limiter + tiers (free/pro/etc.)
50+ * 🧰 FastCRUD for efficient CRUD & pagination
51+ * 🧑💼 ** CRUDAdmin** : minimal admin panel (optional)
52+ * 🚦 ARQ background jobs (Redis)
53+ * 🧊 Redis caching (server + client-side headers)
54+ * 🐳 One-command Docker Compose
55+ * 🚀 NGINX & Gunicorn recipes for prod
56+
57+ ---
58+
59+ ## When to use it
60+
61+ * You want a pragmatic starter with auth, CRUD, jobs, caching and rate-limits.
62+ * You value ** sensible defaults** with the freedom to opt-out of modules.
63+ * You prefer ** docs over boilerplate** in README - depth lives in the site.
64+
65+ Not a fit if you need a monorepo microservices scaffold - see the docs for pointers.
66+
67+ ---
68+
69+ ## What's inside (high-level)
70+
71+ * ** App** : FastAPI app factory, env-aware docs exposure
72+ * ** Auth** : JWT access/refresh, logout via token blacklist
73+ * ** DB** : Postgres + SQLAlchemy 2.0, Alembic migrations
74+ * ** CRUD** : FastCRUD generics (get, get_multi, create, update, delete, joins)
75+ * ** Caching** : decorator-based endpoints cache; client cache headers
76+ * ** Queues** : ARQ worker (async jobs), Redis connection helpers
77+ * ** Rate limits** : per-tier + per-path rules
78+ * ** Admin** : CRUDAdmin views for common models (optional)
79+
80+ > The full tree and deep dives are in ** Project Structure** , ** Database** , ** CRUD Operations** , ** API** , ** Caching** , ** Background Tasks** , ** Rate Limiting** , and ** Production** sections of the docs.
81+
2282## TL;DR - Quickstart
2383
2484Use the template on GitHub, create your repo, then:
@@ -28,7 +88,8 @@ Use the template on GitHub, create your repo, then:
2888git clone https://github.com/< you> /FastAPI-boilerplate
2989cd FastAPI-boilerplate
3090
31- # In the scripts/ folder, you can find scripts to run FastAPI-Boilerplate locally, with uvicorn workers, and in production with nginx.
91+ # In the scripts/ folder, you can find scripts to run FastAPI-Boilerplate locally,
92+ # with uvicorn workers, and in production with nginx.
3293
3394# Option 1: Running locally with Uvicorn
3495
@@ -80,46 +141,6 @@ docker compose up
80141
81142---
82143
83- ## Features
84-
85- * ⚡️ Fully async FastAPI + SQLAlchemy 2.0
86- * 🧱 Pydantic v2 models & validation
87- * 🔐 JWT auth (access + refresh), cookies for refresh
88- * 👮 Rate limiter + tiers (free/pro/etc.)
89- * 🧰 FastCRUD for efficient CRUD & pagination
90- * 🧑💼 ** CRUDAdmin** : minimal admin panel (optional)
91- * 🚦 ARQ background jobs (Redis)
92- * 🧊 Redis caching (server + client-side headers)
93- * 🐳 One-command Docker Compose
94- * 🚀 NGINX & Gunicorn recipes for prod
95-
96- ---
97-
98- ## When to use it
99-
100- * You want a pragmatic starter with auth, CRUD, jobs, caching and rate-limits.
101- * You value ** sensible defaults** with the freedom to opt-out of modules.
102- * You prefer ** docs over boilerplate** in README - depth lives in the site.
103-
104- Not a fit if you need a monorepo microservices scaffold - see the docs for pointers.
105-
106- ---
107-
108- ## What's inside (high-level)
109-
110- * ** App** : FastAPI app factory, env-aware docs exposure
111- * ** Auth** : JWT access/refresh, logout via token blacklist
112- * ** DB** : Postgres + SQLAlchemy 2.0, Alembic migrations
113- * ** CRUD** : FastCRUD generics (get, get_multi, create, update, delete, joins)
114- * ** Caching** : decorator-based endpoints cache; client cache headers
115- * ** Queues** : ARQ worker (async jobs), Redis connection helpers
116- * ** Rate limits** : per-tier + per-path rules
117- * ** Admin** : CRUDAdmin views for common models (optional)
118-
119- > The full tree and deep dives are in ** Project Structure** , ** Database** , ** CRUD Operations** , ** API** , ** Caching** , ** Background Tasks** , ** Rate Limiting** , and ** Production** sections of the docs.
120-
121- ---
122-
123144## Configuration (minimal)
124145
125146Create ` src/.env ` and set ** app** , ** database** , ** JWT** , and ** environment** settings. See the docs for a copy-pasteable example and production guidance.
@@ -167,8 +188,7 @@ This project was inspired by a few projects, it's based on them with things chan
167188
168189## Contact
169190
170- Benav Labs – [ benav.io] ( https://benav.io )
171- [ github.com/benavlabs] ( https://github.com/benavlabs/ )
191+ Benav Labs – [ benav.io] ( https://benav.io ) , [ discord server] ( https://discord.com/invite/TEmPs22gqB )
172192
173193<hr >
174194<a href =" https://benav.io " >
0 commit comments