API service
Source:
apps/backend/kubernetes/api/
Purpose
Section titled “Purpose”This service is the Kubernetes-hosted API entrypoint for Flow-Like. It:
- Bootstraps
flow_like_api::state::State(DB + platform services) - Exposes Flow-Like API routes via
flow_like_api::construct_router - Adds Kubernetes-specific endpoints (health, jobs)
Entrypoint
Section titled “Entrypoint”apps/backend/kubernetes/api/src/main.rs
Key initialization:
- Logging via
tracing_subscriber+RUST_LOG - Config loaded via
apps/backend/kubernetes/api/src/config.rs - S3 store created using
flow_like_storage::object_store::aws::AmazonS3Builder - Database connection is created inside
flow_like_api::state::Stateand requiresDATABASE_URL
Configuration
Section titled “Configuration”See Configuration.
At minimum for the API runtime:
DATABASE_URLS3_ENDPOINT,S3_REGION,S3_ACCESS_KEY_ID,S3_SECRET_ACCESS_KEY- Bucket names (see note in Configuration)
REDIS_URL(used by the Kubernetes job endpoints)
The service binds to:
0.0.0.0:${PORT}(defaults to8080)
Routes in this implementation:
/health/*(seeapps/backend/kubernetes/api/src/health.rs)/jobs/*(seeapps/backend/kubernetes/api/src/jobs/*)/api/v1/*(Flow-Like API router)
- The Kubernetes
/jobsendpoints are meant to dispatch workflow execution as Kubernetes Jobs (executor). - Authentication/authorization is primarily implemented in
packages/apiand depends on your deployment’s auth setup.