Skip to content
 
 

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Workshop

What You'll Learn

  • Create a FastAPI application
  • Understand API Endpoints
  • Create Path Parameters
  • Create Query Parameters
  • Handle HTTP Exceptions
  • Use Pydantic Models
  • Perform CRUD Operations

Project Structure

fastapi-workshop/
│
├── README.md
├── pyproject.toml
├── uv.lock
├── .gitignore
├── main.py
└── patients.json

Prerequisites

  • Python 3.10 or later
  • uv
  • VS Code
  • Git

Install uv

Windows (PowerShell)

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Linux / macOS

curl -LsSf https://astral.sh/uv/install.sh | sh

Verify the installation:

uv --version

Clone the Repository

git clone https://github.com/<your-username>/fastapi-workshop.git

cd fastapi-workshop

Create a Virtual Environment

Windows

uv venv
.venv\Scripts\activate

Linux / macOS

uv venv
source .venv/bin/activate

Install Dependencies

uv sync

This installs all the required packages listed in the project.


Run the Application

uv run fastapi dev main.py

Once the server starts, you should see something similar to:

Uvicorn running on http://127.0.0.1:8000

Open in Your Browser

Home

http://127.0.0.1:8000/

Swagger UI

http://127.0.0.1:8000/docs

ReDoc

http://127.0.0.1:8000/redoc

Workshop Flow

  • Hello World Endpoint
  • About API Endpoints
  • Reading JSON Data
  • Path Parameters
  • HTTP Exceptions
  • Query Parameters
  • Pydantic Models
  • CRUD Operations

Tech Stack

  • Python
  • FastAPI
  • Pydantic
  • uv

Happy Coding! 🚀

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors