You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<img src="docs/assets/FastAPI-boilerplate.png" alt="Purple Rocket with FastAPI Logo as its window." width="35%" height="auto">
9
9
</a>
10
10
</p>
@@ -37,7 +37,13 @@
37
37
38
38
## 📖 Documentation
39
39
40
-
📚 **[Visit our comprehensive documentation at benavlabs.github.io/fastapi-boilerplate](https://benavlabs.github.io/fastapi-boilerplate/)**
40
+
📚 **[Visit our comprehensive documentation at benavlabs.github.io/FastAPI-boilerplate](https://benavlabs.github.io/FastAPI-boilerplate/)**
41
+
42
+
> **⚠️ Documentation Status**
43
+
>
44
+
> This is our first version of the documentation. While functional, we acknowledge it's rough around the edges - there's a huge amount to document and we needed to start somewhere! We built this foundation (with a lot of AI assistance) so we can improve upon it.
45
+
>
46
+
> Better documentation, examples, and guides are actively being developed. Contributions and feedback are greatly appreciated!
41
47
42
48
This README provides a quick reference for LLMs and developers, but the full documentation contains detailed guides, examples, and best practices.
> 📖 **[See complete configuration guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/getting-started/configuration/)**
163
+
> 📖 **[See complete configuration guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/getting-started/configuration/)**
158
164
159
165
Then create a `.env` file inside `src` directory:
160
166
@@ -314,7 +320,7 @@ pip install uv
314
320
315
321
## 4. Usage
316
322
317
-
> 📖 **[See complete first run guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/getting-started/first-run/)**
323
+
> 📖 **[See complete first run guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/getting-started/first-run/)**
318
324
319
325
### 4.1 Docker Compose
320
326
@@ -544,11 +550,11 @@ uv run alembic upgrade head
544
550
545
551
## 5. Extending
546
552
547
-
> 📖 **[See comprehensive development guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/development/)**
553
+
> 📖 **[See comprehensive development guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/development/)**
548
554
549
555
### 5.1 Project Structure
550
556
551
-
> 📖 **[See detailed project structure guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/project-structure/)**
557
+
> 📖 **[See detailed project structure guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/project-structure/)**
552
558
553
559
First, you may want to take a look at the project structure and understand what each file is doing.
554
560
@@ -679,7 +685,7 @@ Note that this table is used to blacklist the `JWT` tokens (it's how you log a u
679
685
680
686
### 5.3 SQLAlchemy Models
681
687
682
-
> 📖 **[See database models guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/database/models/)**
688
+
> 📖 **[See database models guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/database/models/)**
683
689
684
690
Inside `app/models`, create a new `entity.py` for each new entity (replacing entity with the name) and define the attributes according to [SQLAlchemy 2.0 standards](https://docs.sqlalchemy.org/en/20/orm/mapping_styles.html#orm-mapping-styles):
685
691
@@ -703,7 +709,7 @@ class Entity(Base):
703
709
704
710
### 5.4 Pydantic Schemas
705
711
706
-
> 📖 **[See database schemas guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/database/schemas/)**
712
+
> 📖 **[See database schemas guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/database/schemas/)**
707
713
708
714
Inside `app/schemas`, create a new `entity.py` for each new entity (replacing entity with the name) and create the schemas according to [Pydantic V2](https://docs.pydantic.dev/latest/#pydantic-examples) standards:
709
715
@@ -753,7 +759,7 @@ class EntityDelete(BaseModel):
753
759
754
760
### 5.5 Alembic Migrations
755
761
756
-
> 📖 **[See database migrations guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/database/migrations/)**
762
+
> 📖 **[See database migrations guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/database/migrations/)**
757
763
758
764
> \[!WARNING\]
759
765
> To create the tables if you did not create the endpoints, ensure that you import the models in src/app/models/__init__.py. This step is crucial to create the new models.
@@ -772,7 +778,7 @@ uv run alembic upgrade head
772
778
773
779
### 5.6 CRUD
774
780
775
-
> 📖 **[See CRUD operations guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/database/crud/)**
781
+
> 📖 **[See CRUD operations guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/database/crud/)**
776
782
777
783
Inside `app/crud`, create a new `crud_entities.py` inheriting from `FastCRUD` for each new entity:
> 📖 **[See API pagination guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/api/pagination/)**
1030
+
> 📖 **[See API pagination guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/api/pagination/)**
1025
1031
1026
1032
With the `get_multi` method we get a python `dict` with full suport for pagination:
1027
1033
@@ -1087,7 +1093,7 @@ async def read_entities(
1087
1093
1088
1094
#### 5.7.2 HTTP Exceptions
1089
1095
1090
-
> 📖 **[See API exceptions guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/api/exceptions/)**
1096
+
> 📖 **[See API exceptions guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/api/exceptions/)**
1091
1097
1092
1098
To add exceptions you may just import from `app/core/exceptions/http_exceptions` and optionally add a detail:
1093
1099
@@ -1116,7 +1122,7 @@ if not post:
1116
1122
1117
1123
### 5.8 Caching
1118
1124
1119
-
> 📖 **[See comprehensive caching guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/caching/)**
1125
+
> 📖 **[See comprehensive caching guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/caching/)**
1120
1126
1121
1127
The `cache` decorator allows you to cache the results of FastAPI endpoint functions, enhancing response times and reducing the load on your application by storing and retrieving data in a cache.
1122
1128
@@ -1281,7 +1287,7 @@ For `client-side caching`, all you have to do is let the `Settings` class define
1281
1287
1282
1288
### 5.10 ARQ Job Queues
1283
1289
1284
-
> 📖 **[See background tasks guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/background-tasks/)**
1290
+
> 📖 **[See background tasks guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/background-tasks/)**
1285
1291
1286
1292
Depending on the problem your API is solving, you might want to implement a job queue. A job queue allows you to run tasks in the background, and is usually aimed at functions that require longer run times and don't directly impact user response in your frontend. As a rule of thumb, if a task takes more than 2 seconds to run, can be executed asynchronously, and its result is not needed for the next step of the user's interaction, then it is a good candidate for the job queue.
> 📖 **[See rate limiting guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/rate-limiting/)**
1387
+
> 📖 **[See rate limiting guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/rate-limiting/)**
1382
1388
1383
1389
To limit how many times a user can make a request in a certain interval of time (very useful to create subscription plans or just to protect your API against DDOS), you may just use the `rate_limiter_dependency` dependency:
1384
1390
@@ -1494,7 +1500,7 @@ Note that for flexibility (since this is a boilerplate), it's not necessary to p
1494
1500
1495
1501
### 5.12 JWT Authentication
1496
1502
1497
-
> 📖 **[See authentication guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/authentication/)**
1503
+
> 📖 **[See authentication guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/authentication/)**
1498
1504
1499
1505
#### 5.12.1 Details
1500
1506
@@ -1681,7 +1687,7 @@ volumes:
1681
1687
1682
1688
## 6. Running in Production
1683
1689
1684
-
> 📖 **[See production deployment guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/production/)**
1690
+
> 📖 **[See production deployment guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/production/)**
1685
1691
1686
1692
### 6.1 Uvicorn Workers with Gunicorn
1687
1693
@@ -1876,7 +1882,7 @@ And finally, on your browser: `http://localhost/docs`.
1876
1882
1877
1883
## 7. Testing
1878
1884
1879
-
> 📖 **[See comprehensive testing guide in our docs](https://benavlabs.github.io/fastapi-boilerplate/user-guide/testing/)**
1885
+
> 📖 **[See comprehensive testing guide in our docs](https://benavlabs.github.io/FastAPI-boilerplate/user-guide/testing/)**
1880
1886
1881
1887
This project uses **fast unit tests** that don't require external services like databases or Redis. Tests are isolated using mocks and run in milliseconds.
Copy file name to clipboardExpand all lines: docs/index.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@
8
8
<i>A production-ready FastAPI boilerplate to speed up your development.</i>
9
9
</p>
10
10
11
+
!!! warning "Documentation Status"
12
+
This is our first version of the documentation. While functional, we acknowledge it's rough around the edges - there's a huge amount to document and we needed to start somewhere! We built this foundation (with a lot of AI assistance) so we can improve upon it.
13
+
14
+
Better documentation, examples, and guides are actively being developed. Contributions and feedback are greatly appreciated!
0 commit comments