Skip to content

Welcome to my FastAPI playground where I took my first spin with FastAPI and went from uvicorn confusion to full-blown route domination.

Notifications You must be signed in to change notification settings

Nevin100/FastApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ fastApi-Fundamentals

Welcome to my FastAPI playground where I took my first spin with FastAPI and went from uvicorn confusion to full-blown route domination.

πŸ“š What I Learned

This repo contains my hands-on experiments and learnings from the world of FastAPI. Here’s a breakdown of my FastAPI road trip:


πŸ› οΈ Setup & Environment

  • Created and activated a virtual environment using venv
  • Installed required dependencies:
    pip install fastapi uvicorn

Ran the server using:

Copy
Edit
uvicorn main:app --reload

πŸ—οΈ FastAPI Core Concepts Covered :

Concept Description:

-> FastAPI() Initializing the app -> @app.get, .post Declaring API routes -> BaseModel class Pydantic models for data validation -> Path and Query Handling path & query parameters -> Swagger UI Auto-generated docs at /docs -> ReDoc Alternative docs at /redoc

πŸ“¬ HTTP Methods Implemented

1.) GET / β†’ Welcome route

2.) GET /get-items/{item_id} β†’ Path param demo

3.) GET /get-by-name?name=Milk β†’ Query param demo

4.) POST /create-item/{item_id} β†’ Create new item via body

5.) PUT /update-item/{item_id} β†’ Update item data

6.) DELETE /delete-item/{item_id} β†’ Delete an item

πŸ”¬ Testing via Swagger

Visit: http://127.0.0.1:8000/docs

-> Interactive UI for testing all endpoints -> Model validation + auto schema generation

πŸ“¦ Sample Data Used python

Copy
Edit
inventory = {
  1: {"name": "Milk", "price": 3.99, "brand": "Regular"}
}

MSIT = {
  1: {"Name": "Nevin Bali", "SGPA": 9.847}
}

About

Welcome to my FastAPI playground where I took my first spin with FastAPI and went from uvicorn confusion to full-blown route domination.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages