Service Architecture
Service Architecture
Service Inventory
| Service | Runtime | Responsibility | Primary Contracts |
|---|---|---|---|
| sirloin | Go | Main API, billing, credits, media state, shop, admin, storage | proto/sirloin/v5/, apps/sirloin/internal/pkg/pb/ |
| brain | NestJS | Generation records, character metadata, queues, provider integrations | HTTP/OpenAPI client in apps/sirloin/pkg/brain-client/; NestJS gRPC microservice in apps/brain/src/main.ts |
| round | Go | Internal ONNX model serving over gRPC | proto/round/v1/ |
| brisket | Next.js | User-facing frontend | proto-generated TS package, tRPC |
| strip | Go SSR | Internal/admin-style SSR frontend | proto/sirloin/v5/ strip subset |
| flank | TanStack Start | Visual workflow builder and execution surface | proto/flank/v1/, sirloin FlankStorageService |
| fennec | React | UI app | app-local package scripts |
| shank | React templates | UI templates | app-local package scripts |
| chuck | Strapi CMS | CMS content served over HTTP to Brisket | apps/chuck/meat package scripts |
Boundary Rules
Sirloin is the authoritative owner for billing, credits, media user-facing state, shop purchase state, admin/audit state, and most cross-service API contracts.
Brain owns generation records, character metadata, training/provider integrations, and BullMQ async work.
Round is internal-only model serving and has no user auth boundary.
Frontends validate user identity at their edge. Sirloin generally trusts upstream auth for user-facing calls and uses Clerk SDK for lookups.
Contract Sources
- Proto contracts live under proto/.
- Generated proto docs live at api/server.md.
- Brain HTTP/OpenAPI client docs live under apps/sirloin/pkg/brain-client/.
- Brain also exposes a NestJS gRPC microservice from apps/brain/src/main.ts, and Brain calls Round over gRPC; Brain does not call Sirloin.
Runtime Coupling
Sirloin calls Brain and Flank over internal service contracts. Brain calls Round for model-serving work. Flank stores workflows, adapters, secrets, and execution state through sirloin storage contracts, then exposes workflow execution back to sirloin.
Cross-Cutting Conventions
Auth is service-specific: brisket uses Clerk middleware, strip uses custom Fiber middleware, brain uses NestJS guards, and sirloin trusts upstream auth for user-facing calls while using Clerk for lookups. Error handling and logging are also local to each service, so new cross-service behavior should follow the owner service’s existing conventions before introducing shared helpers.