System architecture

Components and trust boundaries

Last verified 8 August 2026 · source-backed

The platform separates customer interaction, commercial control and privileged infrastructure mutation. Nginx is the public edge; application services bind to loopback unless a narrow runtime endpoint requires otherwise.

Component topology

Direction of control

  1. Portal sends authenticated server-side calls to whitelisted Mivama Core methods.
  2. Mivama Core validates ownership and records the requested state.
  3. A job is created; the root runner pulls it using its integration secret.
  4. The runner maps the job type to one known playbook. Arbitrary commands are not accepted.
  5. Progress, final result and discovered runtime manifest are reported to Frappe.

This pull model avoids exposing SSH or Docker privileges through Portal or Frappe HTTP handlers.

Integration boundaries

BoundaryAuthenticationTypical payload
Browser to PortalSigned HTTP-only Portal cookieUser actions
Portal to FrappePortal service secret plus asserted email; Core revalidates ownershipWhitelisted method arguments
Stripe to FrappeWebhook signature and event deduplicationCheckout, subscription, invoice events
Runner to FrappeRunner-specific secretJob claim, heartbeat, result
Portal to StudioShort-lived one-time launch codeHosting service identity
Studio to CoreStudio integration secretRedeem/validate/revoke session, resolve target
Connector to gatewayMigration-scoped token after one-time code exchangeManifest and bounded chunks

Failure philosophy

External events are idempotent where possible. Stripe events have mirror records and retry state; runner jobs have claims and heartbeats; migrations validate legal transitions; Studio deployment makes a verified backup before mutation. A timeout is not treated as permission to assume success.

Source locations

  • Portal BFF: app/api/portal, lib/session.ts and lib/portal-api.ts
  • Core API: mivama_core/api/portal.py and _portal modules
  • Provisioning: mivama_core/provisioning
  • Runner: mivama_core/runner/mivama_runner.py
  • Studio contracts and workers: packages/contracts and apps/worker