How choiwonwong/nba-apiserver works
This FastAPI service accepts YAML infrastructure requests, validates and transforms them, records request state, and prepares Kubernetes resources for provisioning and deployment. Kubernetes jobs report progress through a webhook; users can query request status, logs, and EKS deployment details. The excerpts show the request orchestration and several controller calls, but not every route body or the manifest contents, so unsampled behavior and relationships are not inferred.
Main entry points: requests.py Request Endpoints · ctn.py Jobs and Logs · main.py FastAPI App · crud.py Request CRUD
Components 18
HTTP API
- FastAPI App
api/main.py - Request Endpoints
api/endpoints/requests.py - Progress Webhook
api/endpoints/webhook.py - Request Models
api/models/pydantic_models.py
Request Workflow
- YAML Validation
api/endpoints/requests.py - Request Processing
api/controller/process.py
Infrastructure Control
- Kubernetes Config
api/controller/cfg.py - Jobs and Logs
api/controller/ctn.py - Job Manifests
api/controller/manifest - EKS Inspection
api/controller/eks.py - Deployment Details
api/controller/get_deploy.py
Persistence
- Request CRUD
api/models/crud.py - Request Table Schema
api/models/schemas.py - DB and K8s Clients
api/models/connection.py
Other components
- API Client
- Kubernetes API
- AWS APIs
- MySQL Database
Connections 24
- API Client → FastAPI App: sends HTTP
api/main.py - FastAPI App → Request Endpoints: routes requests
api/main.py - FastAPI App → Progress Webhook: routes webhook
api/main.py - FastAPI App → DB and K8s Clients: uses K8s client
api/main.py - Request Endpoints → YAML Validation: validates YAML
api/endpoints/requests.py - Request Endpoints → Request Processing: transforms request
api/endpoints/requests.py - Request Endpoints → Request CRUD: reads and writes
api/endpoints/requests.py - Request Endpoints → Kubernetes Config: creates resources
api/endpoints/requests.py - Request Endpoints → Jobs and Logs: streams logs
api/endpoints/requests.py - Request Endpoints → EKS Inspection: inspects cluster
api/endpoints/requests.py - Request Endpoints → Request Models: validates payloads
api/endpoints/requests.py - Progress Webhook → Request CRUD: updates state
api/endpoints/webhook.py - Progress Webhook → Jobs and Logs: starts deploy job
api/endpoints/webhook.py - Request CRUD → Request Table Schema: persists records
api/models/crud.py - Request CRUD → MySQL Database: queries via session
api/models/crud.py - DB and K8s Clients → MySQL Database: configures engine
api/models/connection.py - Kubernetes Config → DB and K8s Clients: uses K8s client
api/controller/cfg.py - Jobs and Logs → DB and K8s Clients: uses K8s client
api/controller/ctn.py - Kubernetes Config → Kubernetes API: creates namespace and config
api/controller/cfg.py - Jobs and Logs → Kubernetes API: creates jobs and reads logs
api/controller/ctn.py - Jobs and Logs → Job Manifests: loads job YAML
api/controller/ctn.py - EKS Inspection → AWS APIs: queries EKS and EC2
api/controller/eks.py - Request Processing → AWS APIs: checks IAM credentials
api/controller/process.py - EKS Inspection → Deployment Details: runs deployment query
api/controller/eks.py