Skip to content

Commit d3cd0e6

Browse files
committed
docs: updated README.md
1 parent 0ed7d5b commit d3cd0e6

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed

README.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
1-
# FastAPI + SQLModel + Alembic + Celry + MongoDB + Redis + jwt Auth
1+
# FastAPI + SQLModel + Alembic + Celery + MongoDB + Redis + jwt Auth
22

3-
This project is an opinionated boilerplate for **FastAPI** micro framework that uses **_SQLAlchemy_**,
4-
_**SQLModel**_, **_PostgresSQL_**, _**Alembic**_, **_Celery_**, **_MongoDB_**, _**Redis**_, **_Docker_** and **_jwt Authentication_**. You can use this ready to
3+
This project is an opinionated boilerplate for **FastAPI** micro framework that uses **_SQLAlchemy_**,
4+
_**SQLModel**_, **_PostgresSQL_**, _**Alembic**_, **_Celery_**, **_MongoDB_**, _**Redis**_, **_Docker_** and *
5+
*_jwt Authentication_**. You can use this ready to
56
use sample and don't worry about CI pipelines and running database migrations and tests inside a FastAPI project.
67

7-
## Add new revision for database :
8+
## Add new tables to PostgresSQL database :
89

910
```sh
10-
alembic revision --autogenerate -m "init"
11+
git clone https://github.com/payamt007/FastAPI-Toolkit
12+
cd FastAPI-Toolkit/app
13+
```
1114

12-
alembic upgrade head
15+
Then create new folder (for example artists) in `app` directory
16+
17+
```sh
18+
cd artists
19+
````
20+
21+
Create `__init__.py` file and a empty `models.py` file inside folder
22+
and paste this sample content inside `models.py` file:
23+
24+
```python
25+
from sqlmodel import Field, SQLModel
26+
27+
28+
class Artist(SQLModel, table=True):
29+
id: int = Field(default=None, nullable=False, primary_key=True)
30+
name: str
31+
city: str
1332
```
1433

15-
## Want to use this project?
34+
go to `migrations/env.py` folder in root directory and add this content to it:
35+
36+
```python
37+
from app.artists.models import Artist
38+
```
39+
40+
then run new migration command in root directory:
41+
42+
```sh
43+
alembic revision --autogenerate -m "added_artist_model"
44+
alembic upgrade head
45+
````
46+
47+
## Want to run this project?
1648
1749
```sh
1850
$ docker-compose up -d --build
@@ -22,7 +54,6 @@ $ docker-compose up -d --build
2254

2355
[http://127.0.0.0:8001/docs](http://127.0.0.0:8001)
2456

25-
2657
### Add a song:
2758

2859
```sh

0 commit comments

Comments
 (0)