Skip to content

Service Architecture

Service Architecture

Service Inventory

ServiceRuntimeResponsibilityPrimary Contracts
sirloinGoMain API, billing, credits, media state, shop, admin, storageproto/sirloin/v5/, apps/sirloin/internal/pkg/pb/
brainNestJSWorkflows, generation records, character metadata, queues, provider integrationsHTTP/OpenAPI; Round gRPC client
roundGoInternal ONNX model serving over gRPCproto/round/v1/
brisketNext.jsUser-facing frontendproto-generated TS package, tRPC
stripGo SSRInternal/admin-style SSR frontendproto/sirloin/v5/ strip subset
flankTanStack StartVisual workflow editor for the brain-owned workflow enginebrain HTTP workflow API (apps/flank/app/lib/brain-http-client.ts)
fennecReactCreator/admin dashboardBrain HTTP API and generated client
shankReact templatesUI templatesapp-local package scripts
chuckStrapi CMSCMS content served over HTTP to Brisketapps/chuck/meat package scripts
hornsCloudflare WorkersScheduled operational automationsWorker-local HTTP/scheduled contracts

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 calls Round over gRPC. When configured, Brain posts terminal workflow completion notifications to Sirloin’s webhook HTTP server.

Runtime Coupling

Sirloin calls Brain over its generated HTTP client and both services call Round over gRPC. Flank uses Brain HTTP for workflows and Sirloin gRPC only for playground character search. The former Sirloin/Flank storage and execution gRPC link is removed. Fennec uses Brain HTTP; Brisket consumes Chuck over HTTP.

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.