How phatphudo/cs571-final-project works
Cloud Native Task API is a FastAPI service for creating and listing users and their tasks, backed by PostgreSQL. Requests enter the API routes, are validated and serialized with Pydantic schemas, and use SQLAlchemy sessions and models for persistence. The service also exposes health and Prometheus metrics endpoints. The README documents local Compose use and a GKE deployment path with Ingress, Cloud SQL connectivity, and managed Prometheus. Source excerpts show route and persistence behavior; deployment relationships below rely on README statements where noted.
Main entry points: main.py User and task routes · database.py SQLAlchemy sessions · deployment.yaml GKE deployment · models.py User and task models
Components 15
API surface
- User and task routes
app/main.py - Health endpoint
app/main.py
Task domain
- Request and response schemas
app/schemas.py - User and task models
app/models.py
Persistence
- SQLAlchemy sessions
app/database.py - Runtime settings
app/settings.py - PostgreSQL
Operations
- Metrics endpoint
app/main.py - Prometheus
- Grafana
- GKE deployment
k8s/deployment.yaml - Application ingress
k8s/ingress.yaml - Cloud SQL proxy
k8s/deployment.yaml - Managed Prometheus collection
k8s/managed-prometheus-podmonitoring.yaml
Other components
- API client
Connections 15
- API client → User and task routes: sends requests
app/main.py - User and task routes → Request and response schemas: validates and serializes
app/main.py - User and task routes → User and task models: queries and writes
app/main.py - User and task routes → SQLAlchemy sessions: injects sessions
app/main.py - User and task models → SQLAlchemy sessions: uses base
app/models.py - SQLAlchemy sessions → Runtime settings: reads configuration
app/database.py - SQLAlchemy sessions → PostgreSQL: connects to
README.md - User and task routes → Health endpoint: serves health
app/main.py - Prometheus → Metrics endpoint: scrapes
README.md - Grafana → Prometheus: queries metrics
README.md - API client → Application ingress: enters through
README.md - Application ingress → GKE deployment: routes traffic
README.md - GKE deployment → Cloud SQL proxy: runs sidecar
README.md - Cloud SQL proxy → PostgreSQL: connects to
README.md - Managed Prometheus collection → GKE deployment: collects metrics
README.md