Skip to content

CSALLAHBAKASH/fastapi_basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastapi-basic

A minimal FastAPI "Hello, World!" service, managed with uv.

This main branch contains only the app and local dev setup. Deployment is demonstrated on two separate branches:

Stack

  • Python 3.13
  • FastAPI + Uvicorn (standard)
  • uv for dependency / venv management
  • Docker (python:3.13-slim + uv binary from ghcr.io/astral-sh/uv)

Project layout

.
├── main.py             # FastAPI app (/, /healthz)
├── pyproject.toml      # project metadata + deps
├── uv.lock             # locked dependency graph
├── .python-version     # pins Python 3.13 for uv
├── Dockerfile          # uv-based container build
└── .dockerignore

Endpoints

Method Path Response
GET / {"message": "Hello, World!"}
GET /healthz {"status": "ok"}
GET /docs Swagger UI
GET /redoc ReDoc UI

Prerequisites

  • uv (brew install uv)
  • Docker (only if you want to build/run the container locally)

Local development

uv sync
uv run uvicorn main:app --reload --port 8080

Then:

curl http://localhost:8080/
curl http://localhost:8080/healthz
open http://localhost:8080/docs

Managing dependencies

uv add <package>           # add a runtime dep
uv add --dev <package>     # add a dev-only dep
uv remove <package>        # remove a dep
uv lock --upgrade          # refresh uv.lock

Run with Docker

docker build -t fastapi-basic .
docker run --rm -p 8080:8080 fastapi-basic

The image installs deps with uv sync --frozen --no-dev against uv.lock, so the container matches local exactly.

Deploying

Check out one of the deploy branches:

git checkout deploy-script    # local gcloud-based deploy
# or
git checkout deploy-github    # GitHub Actions deploy

About

FastAPI hello-world on Cloud Run (uv, GitHub Actions, WIF)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors