Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
76804ab
Merge pull request #14 from satyam-seth-learnings/your-first-fastapi-app
satyam-seth May 11, 2025
22bf179
Add missing requirements files
satyam-seth May 11, 2025
c5ff36d
Add FastAPI Clean Folder Structure
satyam-seth May 11, 2025
3025b91
Merge pull request #15 from satyam-seth-learnings/fastapi-clean-folde…
satyam-seth May 11, 2025
96bb9a3
Add readme file for ch3
satyam-seth May 11, 2025
8dff69d
Add missing server info
satyam-seth May 11, 2025
ba24d7d
Add Auto-Generated FastAPI App Documentation
satyam-seth May 11, 2025
5e115c2
Merge pull request #16 from satyam-seth-learnings/auto-generated-fast…
satyam-seth May 11, 2025
16e0c68
Add Path Parameters and HTTP Methods
satyam-seth May 11, 2025
a5ac07c
Merge pull request #17 from satyam-seth-learnings/path-params
satyam-seth May 11, 2025
6f7b315
Add Path Parameter with Type
satyam-seth May 11, 2025
867d978
Merge pull request #18 from satyam-seth-learnings/path-params-with-types
satyam-seth May 11, 2025
e9acca3
Add Path Parameter order matters
satyam-seth May 11, 2025
5e2ce67
Merge pull request #19 from satyam-seth-learnings:path-params-order-m…
satyam-seth May 11, 2025
e3198e4
Add Path Parameter Predefined Value
satyam-seth May 11, 2025
c4264c0
Merge pull request #20 from satyam-seth-learnings:path-params-predefi…
satyam-seth May 11, 2025
6201685
Update readmes
satyam-seth May 11, 2025
69c6001
Merge branch 'geekyshows' of github.com:satyam-seth-learnings/fastapi…
satyam-seth May 11, 2025
7d7e07f
Add Path converter
satyam-seth May 11, 2025
168260b
Merge pull request #21 from satyam-seth-learnings:path-params-path-co…
satyam-seth May 11, 2025
c69aea7
Add Your First Fast API CRUD
satyam-seth May 11, 2025
e409006
Merge pull request #22 from satyam-seth-learnings:first-crud
satyam-seth May 11, 2025
cb3e04b
Add Query Parameters
satyam-seth May 11, 2025
f8f96b3
Merge pull request #23 from satyam-seth-learnings:query-params
satyam-seth May 11, 2025
ac7c6be
Add Response Status Code
satyam-seth May 11, 2025
425e7cd
Merge pull request #24 from satyam-seth-learnings/response-status-code
satyam-seth May 11, 2025
b1e8cc2
Add Query Parameter Validation
satyam-seth May 11, 2025
84197e0
Merge pull request #25 from satyam-seth-learnings:query-params-str-va…
satyam-seth May 11, 2025
22bd8ce
Add Path Parameters and Numeric Validations
satyam-seth May 11, 2025
64e734a
Merge pull request #26 from satyam-seth-learnings:path-params-numeric…
satyam-seth May 11, 2025
80e3274
Add Validate Request Body using Pydantic Model
satyam-seth May 11, 2025
d3f0ebc
Merge pull request #27 from satyam-seth-learnings:body-validate-using…
satyam-seth May 11, 2025
4aafb36
Add Multiple Body Parameters
satyam-seth May 11, 2025
b242edf
Merge pull request #28 from satyam-seth-learnings:muplitple-body-params
satyam-seth May 11, 2025
c0496d0
Add Pydantic Field
satyam-seth May 11, 2025
c2e45e8
Merge pull request #29 from satyam-seth-learnings:pydantic-field
satyam-seth May 11, 2025
a82e972
Add Nested Pydantic Body Model
satyam-seth May 11, 2025
781f296
Merge pull request #30 from satyam-seth-learnings:nested-pydantic-bod…
satyam-seth May 11, 2025
230a7c6
Add Declare Request Example Data
satyam-seth May 11, 2025
fba4525
Merge pull request #31 from satyam-seth-learnings:schema-extra-example
satyam-seth May 11, 2025
ac75dad
Update readmes
satyam-seth May 11, 2025
fd35202
Add Cookie Parameters
satyam-seth May 12, 2025
6c94eb8
Merge pull request #32 from satyam-seth-learnings:cookie-params
satyam-seth May 12, 2025
703ded9
Add Cookie Parameter Models
satyam-seth May 12, 2025
0e4714d
Merge pull request #33 from satyam-seth-learnings:cookie-param-models
satyam-seth May 12, 2025
9ff2c74
Add Header Parameters
satyam-seth May 12, 2025
1b58568
Merge pull request #34 from satyam-seth-learnings:header-params
satyam-seth May 12, 2025
3ff34f3
Add Header Parameter Models
satyam-seth May 12, 2025
51f1078
Merge pull request #35 from satyam-seth-learnings:header-param-models
satyam-seth May 12, 2025
3a01891
Restrucure
satyam-seth May 13, 2025
b177b28
Add Return type annotation
satyam-seth May 13, 2025
cc49e03
Merge pull request #36 from satyam-seth-learnings:response-model
satyam-seth May 13, 2025
779e072
Add Response Model
satyam-seth May 13, 2025
f5d1735
Merge pull request #37 from satyam-seth-learnings:response-model-
satyam-seth May 13, 2025
51e0b00
Add Include and Exclude specific field
satyam-seth May 13, 2025
d3c777d
Merge pull request #38 from satyam-seth-learnings:response-model--
satyam-seth May 13, 2025
1779333
Add Form Data
satyam-seth May 14, 2025
9b65318
Merge pull request #39 from satyam-seth-learnings:request-forms
satyam-seth May 14, 2025
f2f9c20
Add Form Data with Pydantic Model
satyam-seth May 14, 2025
e890682
Merge pull request #40 from satyam-seth-learnings:request-form-models
satyam-seth May 14, 2025
2cb4abd
Add Single File Upload
satyam-seth May 14, 2025
dd0708e
Merge pull request #41 from satyam-seth-learnings:request-files
satyam-seth May 14, 2025
efa07ad
Add Multiple File Upload
satyam-seth May 14, 2025
f2fd8ed
Merge pull request #42 from satyam-seth-learnings:request-files-
satyam-seth May 14, 2025
2fdfe61
Add Form Field and File Upload Together
satyam-seth May 14, 2025
88ebd52
Merge pull request #44 from satyam-seth-learnings/request-forms-and-f…
satyam-seth May 14, 2025
d9b53d3
Restructure
satyam-seth May 14, 2025
c2dc58b
Add Handling Errors
satyam-seth May 14, 2025
1b4f2a7
Merge pull request #45 from satyam-seth-learnings:handling-errors
satyam-seth May 14, 2025
0a8621c
Add Custom Exception
satyam-seth May 14, 2025
3c46aac
Merge pull request #46 from satyam-seth-learnings:custom-exception
satyam-seth May 14, 2025
b3c2ff5
Add Override the default exception handlers
satyam-seth May 14, 2025
e3b38d2
Merge pull request #47 from satyam-seth-learnings:override-the-defaul…
satyam-seth May 14, 2025
acc67e3
Add Introduction to SQLAlchemy
satyam-seth May 14, 2025
bba4fc4
Merge pull request #48 from satyam-seth-learnings:introduction-to-sql…
satyam-seth May 14, 2025
67f7aeb
Update README.md
satyam-seth May 14, 2025
05cbdf0
Update readme
satyam-seth May 14, 2025
da526de
Add SQLAlchemy APIs
satyam-seth May 14, 2025
30355dc
Merge pull request #49 from satyam-seth-learnings:sqlalchemy-apis
satyam-seth May 14, 2025
d4516ef
Update README.md
satyam-seth May 14, 2025
ea582a3
Restructure
satyam-seth May 15, 2025
8b2cecb
Add Install SQLAlchemy and Create Engine
satyam-seth May 15, 2025
5eb92c1
Merge pull request #50 from satyam-seth-learnings:sqlalchemy-installa…
satyam-seth May 15, 2025
744ae7a
Add Create Database Tables
satyam-seth May 15, 2025
fede9c0
Merge pull request #51 from satyam-seth-learnings/create-db-table
satyam-seth May 15, 2025
bb08578
Update gitignore
satyam-seth May 16, 2025
0ef2b9c
Add One to One, One to Many and Many to Many Relationship
satyam-seth May 16, 2025
241e3a7
Merge pull request #52 from satyam-seth-learnings/core-relationship
satyam-seth May 16, 2025
8a4d8d8
Add CRUD
satyam-seth May 16, 2025
4b8ef04
Merge pull request #53 from satyam-seth-learnings/core-crud
satyam-seth May 16, 2025
8ddf98e
Add Order_by and Group_by
satyam-seth May 16, 2025
8255f03
Merge pull request #54 from satyam-seth-learnings:core-order-by-group-by
satyam-seth May 16, 2025
a2a37a6
Add Join
satyam-seth May 16, 2025
13a22ef
Merge pull request #55 from satyam-seth-learnings:core-join
satyam-seth May 16, 2025
8b698a4
Add Raw SQL
satyam-seth May 16, 2025
a7aa783
Merge pull request #56 from satyam-seth-learnings:core-raw-sql
satyam-seth May 16, 2025
ed59ac1
Add Install and Setup SQLAlchemy ORM
satyam-seth May 16, 2025
f3c235e
Merge pull request #57 from satyam-seth-learnings:setup-sqlalchemy-orm
satyam-seth May 16, 2025
c1c1c81
Add ORM Create Model
satyam-seth May 16, 2025
4a3bfce
Merge pull request #58 from satyam-seth-learnings:orm-create-table
satyam-seth May 16, 2025
7b313cc
Add ORM Relationship
satyam-seth May 16, 2025
6d8866e
Merge pull request #59 from satyam-seth-learnings:orm-relationship
satyam-seth May 16, 2025
3eb3451
Add ORM Relationship
satyam-seth May 16, 2025
61e8f47
Merge pull request #60 from satyam-seth-learnings:orm-crud
satyam-seth May 16, 2025
91ff09f
Add Install and Config Alembic
satyam-seth May 17, 2025
dc05694
Merge pull request #61 from satyam-seth-learnings:alembic-installation
satyam-seth May 17, 2025
f371ef9
Add Create Database Table using Alembic Migrations
satyam-seth May 18, 2025
4ba7ada
Merge pull request #62 from satyam-seth-learnings:create-database-tab…
satyam-seth May 18, 2025
f4661af
Add Alembic Upgrade
satyam-seth May 18, 2025
9025d9b
Merge pull request #63 from satyam-seth-learnings:alembic-upgrade
satyam-seth May 18, 2025
a6a7ec3
Add Alembic Downgrade
satyam-seth May 18, 2025
67fdf72
Merge pull request #64 from satyam-seth-learnings:alembic-downgrade
satyam-seth May 18, 2025
11812cb
Adding Constraints
satyam-seth May 18, 2025
0fef673
Merge pull request #65 from satyam-seth-learnings:adding-constraints
satyam-seth May 18, 2025
15a13a3
Add Autogenerate Alembic Migrations
satyam-seth May 18, 2025
44f2e0d
Merge pull request #66 from satyam-seth-learnings:autogenerate-alembi…
satyam-seth May 18, 2025
c0c8a00
Add Alembic History
satyam-seth May 18, 2025
d78098d
Merge pull request #67 from satyam-seth-learnings/alembic-history
satyam-seth May 18, 2025
32aba5d
Add Async SQLAlchemy Core
satyam-seth May 18, 2025
b3468bf
Merge pull request #68 from satyam-seth-learnings:async-sqlalchemy-core
satyam-seth May 18, 2025
0b1067a
Add Async SQLAlchemy Core with Alembic
satyam-seth May 18, 2025
7f3bf38
Merge pull request #69 from satyam-seth-learnings:async-sqlalchemy-co…
satyam-seth May 18, 2025
52e580f
Add Async SQLAlchemy ORM
satyam-seth May 18, 2025
dabd993
Merge pull request #70 from satyam-seth-learnings:async-sqlalchemy-orm
satyam-seth May 18, 2025
df78d69
Add Async SQLAlchemy ORM with Alembic
satyam-seth May 18, 2025
feb2c18
Merge pull request #71 from satyam-seth-learnings:async-sqlalchemy-or…
satyam-seth May 18, 2025
c0b4f39
Add Setup and Config FastAPI with Sync SQLAlchemy and Alembic
satyam-seth May 18, 2025
75aa2a4
Merge pull request #72 from satyam-seth-learnings:setup-and-config-fa…
satyam-seth May 18, 2025
a41095b
Add Create FastAPI Model using Sync SQLAlchemy and alembic
satyam-seth May 18, 2025
657535f
Merge pull request #73 from satyam-seth-learnings:create-fastapi-mode…
satyam-seth May 18, 2025
2135fa5
Add Insert Fetch Data using FastAPI and Sync SQLAlchemy
satyam-seth May 18, 2025
aa499a0
Merge pull request #74 from satyam-seth-learnings:insert-fetch-data-u…
satyam-seth May 18, 2025
460fbb1
Add Setup and Config FastAPI with Async SQLAlchemy and Alembic
satyam-seth May 18, 2025
6fc9182
Merge pull request #75 from satyam-seth-learnings:setup-and-config-fa…
satyam-seth May 18, 2025
5f0cbac
Add Create FastAPI Model using Async SQLAlchemy and Alembic
satyam-seth May 18, 2025
81340a3
Merge pull request #76 from satyam-seth-learnings:create-fastapi-mode…
satyam-seth May 18, 2025
13c102d
Add Insert Fetch Data using FastAPI and Async SQLAlchemy
satyam-seth May 18, 2025
f5136eb
Merge pull request #77 from satyam-seth-learnings:insert-fetch-data-u…
satyam-seth May 18, 2025
888a091
Add fastnotes v1
satyam-seth May 18, 2025
343f972
Merge pull request #78 from satyam-seth-learnings:fastnotes-v1
satyam-seth May 18, 2025
7c1532f
Add Fastnotes V2
satyam-seth May 18, 2025
317204f
Merge pull request #79 from satyam-seth-learnings:fastnotes-v2
satyam-seth May 18, 2025
a01b07c
Add Fastnotes V3
satyam-seth May 18, 2025
b9f2f31
Merge pull request #80 from satyam-seth-learnings/fastnotes-v3
satyam-seth May 18, 2025
430b100
Add Install SQL Model and Create Engine
satyam-seth May 18, 2025
cbc0ec8
Merge pull request #81 from satyam-seth-learnings:install-sqlmodel
satyam-seth May 18, 2025
082ffae
Add Create Model
satyam-seth May 18, 2025
823ad0d
Merge pull request #82 from satyam-seth-learnings:sqlmodel-create-table
satyam-seth May 18, 2025
57cbecd
Add Database Operations
satyam-seth May 18, 2025
47f5a9b
Merge pull request #83 from satyam-seth-learnings:sqlmodel-db-operations
satyam-seth May 18, 2025
21a8341
Add SQLModel Relationship
satyam-seth May 19, 2025
8fb2136
Merge pull request #85 from satyam-seth-learnings:sqlmodel-relationship
satyam-seth May 19, 2025
76a0b64
Fix conflict
satyam-seth May 19, 2025
240bf55
Add Relationship Attributes
satyam-seth May 20, 2025
db553f8
Merge pull request #86 from satyam-seth-learnings/relationship-attrib…
satyam-seth May 20, 2025
f444a31
Add Cascade
satyam-seth May 23, 2025
1fef9ab
Merge pull request #87 from satyam-seth-learnings:Cascade
satyam-seth May 23, 2025
46bf430
Add config SQL Model with FastAPI
satyam-seth Jun 16, 2025
d86c75e
Merge pull request #88 from satyam-seth-learnings/config-sql-model
satyam-seth Jun 16, 2025
f1065fa
Add create model
satyam-seth Jun 17, 2025
55f804e
Merge pull request #89 from satyam-seth-learnings/create-model
satyam-seth Jun 17, 2025
3c88f83
Add Database Operations
satyam-seth Jun 18, 2025
ed195eb
Merge pull request #90 from satyam-seth-learnings/database-operations
satyam-seth Jun 18, 2025
b1ac07f
Add task karo v1
satyam-seth Jun 19, 2025
172c1d8
Merge pull request #91 from satyam-seth-learnings/taskkaro-v1
satyam-seth Jun 19, 2025
23b4e4c
Add Task karo v2
satyam-seth Jun 19, 2025
1fc35e8
Merge pull request #92 from satyam-seth-learnings/taskkaro-v2
satyam-seth Jun 20, 2025
9b8efa8
Add taskkaro v3
satyam-seth Jun 21, 2025
3d56288
Merge pull request #93 from satyam-seth-learnings:taskkaro-v3
satyam-seth Jun 21, 2025
6a1b720
Create Middleware
satyam-seth Jun 27, 2025
4900eb7
Merge pull request #94 from satyam-seth-learnings:create-middleware
satyam-seth Jun 27, 2025
df9cbe1
Add multiple middleware
satyam-seth Jun 28, 2025
ee53ad6
Merge pull request #95 from satyam-seth-learnings/mutiple-middleware
satyam-seth Jun 28, 2025
136b00d
Separate Middleware file
satyam-seth Jul 3, 2025
44638ba
Merge pull request #96 from satyam-seth-learnings:separate-middleware…
satyam-seth Jul 3, 2025
9435544
Path Specific Middleware
satyam-seth Jul 4, 2025
c074c84
Merge pull request #97 from satyam-seth-learnings:path-specific-middl…
satyam-seth Jul 4, 2025
ca48746
Built-in Middleware
satyam-seth Jul 7, 2025
4574902
Merge pull request #98 from satyam-seth-learnings:built-in-middleware
satyam-seth Jul 7, 2025
8babd8b
ASGI Middleware
satyam-seth Jul 7, 2025
42d3215
Merge pull request #99 from satyam-seth-learnings:asgi-middleware
satyam-seth Jul 7, 2025
be4498c
Creating API Router
satyam-seth Jul 8, 2025
1939296
Merge pull request #100 from satyam-seth-learnings/creating-api-router
satyam-seth Jul 8, 2025
1e957c9
Add api router tags
satyam-seth Jul 9, 2025
9c00742
Merge pull request #101 from satyam-seth-learnings/tags
satyam-seth Jul 9, 2025
cbced23
Add api router prefix
satyam-seth Jul 9, 2025
008cb75
Merge pull request #102 from satyam-seth-learnings/prefix
satyam-seth Jul 9, 2025
86fd601
Creating and Using Dependency Injection
satyam-seth Jul 11, 2025
edd50cc
Merge pull request #103 from satyam-seth-learnings/dependency-injection
satyam-seth Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.venv
__pycache__
.venv/
__pycache__/
.mypy_cache/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- [FastAPI Installation Doc](https://fastapi.tiangolo.com/#installation)

- Create python virtual environment

```bash
python3 -m venv .venv
```

- Activate the virtual environment

```bash
source .venv/Scripts/activate
```

- Install FastAPI

```bash
pip install "fastapi[standard]"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
annotated-types==0.7.0
anyio==4.9.0
certifi==2025.4.26
click==8.2.0
colorama==0.4.6
dnspython==2.7.0
email_validator==2.2.0
fastapi==0.115.12
fastapi-cli==0.0.7
h11==0.16.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.28.1
idna==3.10
Jinja2==3.1.6
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
pydantic==2.11.4
pydantic_core==2.33.2
Pygments==2.19.1
python-dotenv==1.1.0
python-multipart==0.0.20
PyYAML==6.0.2
rich==14.0.0
rich-toolkit==0.14.5
shellingham==1.5.4
sniffio==1.3.1
starlette==0.46.2
typer==0.15.3
typing-inspection==0.4.0
typing_extensions==4.13.2
uvicorn==0.34.2
watchfiles==1.0.5
websockets==15.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- [Run FastAPI Doc](https://fastapi.tiangolo.com/#run-it)

- Create python virtual environment

```bash
python3 -m venv .venv
```

- Activate the virtual environment

```bash
source .venv/Scripts/activate
```

- Install FastAPI

```bash
pip install "fastapi[standard]"
```

- Run Server

- Using FastAPI CLI (Recommended)

```bash
fastapi dev main.py
```

- Using [`uvicorn`](https://www.uvicorn.org/)

```bash
uvicorn main:app --reload
```

- Server at `http://127.0.0.1:8000/`
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def home():
return {"message": "Hello Fast API"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
annotated-types==0.7.0
anyio==4.9.0
certifi==2025.4.26
click==8.2.0
colorama==0.4.6
dnspython==2.7.0
email_validator==2.2.0
fastapi==0.115.12
fastapi-cli==0.0.7
h11==0.16.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.28.1
idna==3.10
Jinja2==3.1.6
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
pydantic==2.11.4
pydantic_core==2.33.2
Pygments==2.19.1
python-dotenv==1.1.0
python-multipart==0.0.20
PyYAML==6.0.2
rich==14.0.0
rich-toolkit==0.14.5
shellingham==1.5.4
sniffio==1.3.1
starlette==0.46.2
typer==0.15.3
typing-inspection==0.4.0
typing_extensions==4.13.2
uvicorn==0.34.2
watchfiles==1.0.5
websockets==15.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- [Run FastAPI Doc](https://fastapi.tiangolo.com/#run-it)

- Create python virtual environment

```bash
python3 -m venv .venv
```

- Activate the virtual environment

```bash
source .venv/Scripts/activate
```

- Install FastAPI

```bash
pip install "fastapi[standard]"
```

- Run Server

- Using FastAPI CLI (Recommended)

```bash
fastapi dev main.py
```

- Using [`uvicorn`](https://www.uvicorn.org/)

```bash
uvicorn main:app --reload
```

- Server at `http://127.0.0.1:8000/`
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
annotated-types==0.7.0
anyio==4.9.0
certifi==2025.4.26
click==8.2.0
colorama==0.4.6
dnspython==2.7.0
email_validator==2.2.0
fastapi==0.115.12
fastapi-cli==0.0.7
h11==0.16.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.28.1
idna==3.10
Jinja2==3.1.6
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
pydantic==2.11.4
pydantic_core==2.33.2
Pygments==2.19.1
python-dotenv==1.1.0
python-multipart==0.0.20
PyYAML==6.0.2
rich==14.0.0
rich-toolkit==0.14.5
shellingham==1.5.4
sniffio==1.3.1
starlette==0.46.2
typer==0.15.3
typing-inspection==0.4.0
typing_extensions==4.13.2
uvicorn==0.34.2
watchfiles==1.0.5
websockets==15.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- [Run FastAPI Doc](https://fastapi.tiangolo.com/#run-it)

- Create python virtual environment

```bash
python3 -m venv .venv
```

- Activate the virtual environment

```bash
source .venv/Scripts/activate
```

- Install FastAPI

```bash
pip install "fastapi[standard]"
```

- Run Server

- Using FastAPI CLI (Recommended)

```bash
fastapi dev main.py
```

- Using [`uvicorn`](https://www.uvicorn.org/)

```bash
uvicorn main:app --reload
```

- Server at `http://127.0.0.1:8000/`

- Documentation

- Swagger UI at `http://127.0.0.1:8000/docs`

- Redoc at `http://127.0.0.1:8000/docs`
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def home():
return {"message": "Hello Fast API"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
annotated-types==0.7.0
anyio==4.9.0
certifi==2025.4.26
click==8.2.0
colorama==0.4.6
dnspython==2.7.0
email_validator==2.2.0
fastapi==0.115.12
fastapi-cli==0.0.7
h11==0.16.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.28.1
idna==3.10
Jinja2==3.1.6
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
pydantic==2.11.4
pydantic_core==2.33.2
Pygments==2.19.1
python-dotenv==1.1.0
python-multipart==0.0.20
PyYAML==6.0.2
rich==14.0.0
rich-toolkit==0.14.5
shellingham==1.5.4
sniffio==1.3.1
starlette==0.46.2
typer==0.15.3
typing-inspection==0.4.0
typing_extensions==4.13.2
uvicorn==0.34.2
watchfiles==1.0.5
websockets==15.0.1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [SQLAlchemy Official Doc](https://www.sqlalchemy.org/)

- ![Introduction to SQLAlchemy](1.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [SQLAlchemy Installation Doc](https://docs.sqlalchemy.org/en/20/intro.html#installation)

- Install SQLAlchemy using pip:

```bash
pip install SQLAlchemy
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from sqlalchemy import create_engine
DATABASE_URL = "sqlite:///./sqlite.db"
engine = create_engine(DATABASE_URL, echo=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
greenlet==3.2.2
SQLAlchemy==2.0.41
typing_extensions==4.13.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [SQLAlchemy Core Doc](https://docs.sqlalchemy.org/en/20/core/index.html)

- Install SQLAlchemy using pip:

```bash
pip install SQLAlchemy
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from sqlalchemy import create_engine
DATABASE_URL = "sqlite:///./sqlite.db"
engine = create_engine(DATABASE_URL, echo=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from tables import create_tables

# Create Tables
create_tables()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
greenlet==3.2.2
SQLAlchemy==2.0.41
typing_extensions==4.13.2
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from db import engine
from sqlalchemy import MetaData, Table, Column, Integer, String

metadata = MetaData()

# User Table
users = Table(
"users",
metadata,
Column("id", Integer, primary_key=True),
Column("name", String(length=50), nullable=False),
Column("email", String, nullable=False, unique=True),
Column("phone", Integer, nullable=False, unique=True)
)

# address Table
address = Table(
"address",
metadata,
Column("id", Integer, primary_key=True),
Column("street", String(length=50), nullable=False),
Column("dist", String, nullable=False, unique=True),
Column("country", String, nullable=False, unique=True)
)

# Create Table in Database
def create_tables():
metadata.create_all(engine)

# # Drop Table in Database
# def drop_tables():
# metadata.drop_all(engine)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [SQLAlchemy Core Doc](https://docs.sqlalchemy.org/en/20/core/index.html)

- Install SQLAlchemy using pip:

```bash
pip install SQLAlchemy
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from sqlalchemy import create_engine
DATABASE_URL = "sqlite:///./sqlite.db"
engine = create_engine(DATABASE_URL, echo=True)
Loading