3030* 🧠 DeepWiki: [ https://deepwiki.com/benavlabs/FastAPI-boilerplate ] ( https://deepwiki.com/benavlabs/FastAPI-boilerplate )
3131* 💬 Discord: [ https://discord.com/invite/TEmPs22gqB ] ( https://discord.com/invite/TEmPs22gqB )
3232
33- ---
34-
3533## Features
3634
3735* ⚡️ Fully async FastAPI + SQLAlchemy 2.0
4543* 🐳 One-command Docker Compose
4644* 🚀 NGINX & Gunicorn recipes for prod
4745
48- ---
49-
5046## When to use it
5147
5248* You want a pragmatic starter with auth, CRUD, jobs, caching and rate-limits.
5551
5652Not a fit if you need a monorepo microservices scaffold - see the docs for pointers.
5753
58- ---
59-
6054## What's inside (high-level)
6155
6256* ** App** : FastAPI app factory, env-aware docs exposure
@@ -75,62 +69,65 @@ Not a fit if you need a monorepo microservices scaffold - see the docs for point
7569Use the template on GitHub, create your repo, then:
7670
7771``` bash
78- # Clone your new repository
7972git clone https://github.com/< you> /FastAPI-boilerplate
8073cd FastAPI-boilerplate
74+ ```
8175
82- # In the scripts/ folder, you can find scripts to run FastAPI-Boilerplate locally,
83- # with uvicorn workers, and in production with nginx.
76+ The ` scripts/ ` folder contains ready-to-use configurations for different deployment scenarios. Pick your path:
8477
85- # Option 1: Running locally with Uvicorn
78+ ### Option 1: Local development with Uvicorn
8679
87- # Copy Dockerfile and Docker Compose files:
80+ Best for: ** Development and testing**
81+
82+ ``` bash
8883cp scripts/local_with_uvicorn/Dockerfile Dockerfile
8984cp scripts/local_with_uvicorn/docker-compose.yml docker-compose.yml
90-
91- # Copy and create your environment file
9285cp scripts/local_with_uvicorn/.env.example src/.env
93- # For local development, the example values work fine. Modify if needed.
86+ ```
9487
95- # Run everything using Docker:
88+ For local development, the example environment values work fine. You can modify them later if needed.
89+
90+ ``` bash
9691docker compose up
92+ ```
93+
94+ Your API will be running at http://127.0.0.1:8000 with auto-reload enabled. Open http://127.0.0.1:8000/docs to see the interactive documentation.
9795
98- # Open the API documentation
99- open http://127.0.0.1:8000/docs
96+ ### Option 2: Staging with Gunicorn managing Uvicorn workers
10097
101- # Option 2: Running with Gunicorn managing Uvicorn workers
98+ Best for: ** Staging environments and load testing **
10299
103- # Copy Dockerfile and Docker Compose files:
100+ ``` bash
104101cp scripts/gunicorn_managing_uvicorn_workers/Dockerfile Dockerfile
105102cp scripts/gunicorn_managing_uvicorn_workers/docker-compose.yml docker-compose.yml
106-
107- # Copy and create your environment file
108103cp scripts/gunicorn_managing_uvicorn_workers/.env.example src/.env
109- # Recommended: Change SECRET_KEY and passwords for staging/testing environments.
104+ ```
110105
111- # Run everything using Docker:
106+ ⚠️ ** Recommended** : Change ` SECRET_KEY ` and passwords in the ` .env ` file for staging/testing environments.
107+
108+ ``` bash
112109docker compose up
110+ ```
111+
112+ ### Option 3: Production with NGINX
113113
114- # Option 3: Production with NGINX
114+ Best for: ** Production deployments **
115115
116- # Copy Dockerfile and Docker Compose:
116+ ``` bash
117117cp scripts/production_with_nginx/Dockerfile Dockerfile
118118cp scripts/production_with_nginx/docker-compose.yml docker-compose.yml
119- # Note: default.conf for nginx is already in the root directory
120-
121- # Copy and create your environment file
122119cp scripts/production_with_nginx/.env.example src/.env
123- # CRITICAL: You MUST change SECRET_KEY, all passwords, and sensitive values before deploying!
120+ ```
124121
125- # Run everything using Docker:
126- docker compose up
122+ 🚨 ** CRITICAL** : You MUST change ` SECRET_KEY ` , all passwords, and sensitive values in the ` .env ` file before deploying!
127123
128- # Access via http://localhost (nginx proxies to the app)
124+ ``` bash
125+ docker compose up
129126```
130127
131- > Full setup (from-scratch, .env examples, PostgreSQL & Redis, gunicorn, nginx) lives in the docs .
128+ Access your application via http://localhost (NGINX proxies to the FastAPI app) .
132129
133- ---
130+ > Full setup (from-scratch, .env examples, PostgreSQL & Redis, gunicorn, nginx) lives in the docs.
134131
135132## Configuration (minimal)
136133
@@ -141,8 +138,6 @@ Create `src/.env` and set **app**, **database**, **JWT**, and **environment** se
141138* ` ENVIRONMENT=local|staging|production ` controls API docs exposure
142139* Set ` ADMIN_* ` to enable the first admin user
143140
144- ---
145-
146141## Common tasks
147142
148143``` bash
@@ -158,8 +153,6 @@ curl -X POST 'http://127.0.0.1:8000/api/v1/tasks/task?message=hello'
158153
159154More examples (superuser creation, tiers, rate limits, admin usage) - ** docs** .
160155
161- ---
162-
163156## Contributing
164157
165158Read [ contributing] ( CONTRIBUTING.md ) .
0 commit comments