https://github.com/v41bh4vr4jput/fastapi
This repository contains practice projects, examples, and mini-apps built using FastAPI β a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.
https://github.com/v41bh4vr4jput/fastapi
fastapi pydantic typing
Last synced: 5 months ago
JSON representation
This repository contains practice projects, examples, and mini-apps built using FastAPI β a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.
- Host: GitHub
- URL: https://github.com/v41bh4vr4jput/fastapi
- Owner: V41BH4VR4JPUT
- Created: 2025-05-31T20:19:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-31T20:30:12.000Z (about 1 year ago)
- Last Synced: 2025-07-07T05:42:46.009Z (12 months ago)
- Topics: fastapi, pydantic, typing
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# FastAPIπ
This repository demonstrates how to build a **FastAPI web application** using core Python concepts, **Pydantic models**, and **template rendering** with HTML and CSS. It's a great starting point to understand how FastAPI handles routing, validation, and frontend integration.
---
## π Project Structure
```
v41bh4vr4jput-fastapi/
βββ Readme.md # Project documentation
βββ app.py # Alternate app runner file
βββ index.py # Route definitions and logic
βββ main.py # Main entry point for FastAPI server
βββ Pydantic_models.py # Data validation models using Pydantic
βββ PythonTypes.py # Examples demonstrating FastAPI with Python types
βββ static/
β βββ style.css # Styling for the HTML template
βββ templates/
βββ index.html # Jinja2 template rendered on the frontend
```
---
## π Features
* π¦ **FastAPI Server** β Lightweight, fast web framework using ASGI
* β
**Data Validation** β Leverages **Pydantic** for request/response validation
* π§ **Python Type Hints** β Demonstrates strong typing in API parameters and return values
* π¨ **HTML Template Rendering** β Uses Jinja2 templates to build frontend
* π
**Static Files Support** β Integrates CSS for styling
---
## π οΈ How to Run the App
### Step 1: Install Dependencies
```bash
pip install fastapi uvicorn jinja2
```
### Step 2: Start the FastAPI Server
```bash
uvicorn main:app --reload
```
### Step 3: Open in Browser
Navigate to:
```
http://127.0.0.1:8000/
```
To access the **interactive API docs**:
```
http://127.0.0.1:8000/docs
```
---
## π File Descriptions
* `main.py` β Entry point with `FastAPI()` instance and route mounting
* `index.py` β Contains route logic and request handling
* `Pydantic_models.py` β Defines models for request validation
* `PythonTypes.py` β Demonstrates FastAPI capabilities with Python's built-in type annotations
* `app.py` β Alternate run file for experimentation or development
* `templates/index.html` β Basic HTML page rendered by FastAPI using Jinja2
* `static/style.css` β CSS file linked to the HTML template
---