Skip to main content

Architecture overview

platform-go separates platform capability into declaration, runtime, and adapter layers. Business packages depend on public contracts, not the Admin shell, a concrete database, or internal HTTP handlers.

Request and contract path​

Trusted identity + TenantContext
-> capability manifest / route declaration
-> session + Casbin + data scope
-> Query / Command contract
-> service and storage port
-> GORM, cache, file or external adapter

Identity comes from a trusted JWT session, OIDC, or declared credential provider. The trusted server context resolves tenant and data scope; ordinary clients cannot submit a DSN, physical database, schema, shard, or arbitrary permission.

Five planes​

PlaneResponsibilityKey boundary
Admin PlaneManagement resources, menus, forms, audit entry pointsMenus are visibility only; backend authorization is independent
Service/Data PlaneBusiness services, queries, commands, data scopeDefault is one datasource and one native transaction
Control PlaneCapabilities, configuration, migrations, release policyDesired state requires contract regeneration and restart
External/Partner PlaneStable service contracts for external consumersOpenAPI, versioning, errors, and idempotency semantics are reviewable
Event PlaneVersioned events and controlled asynchronous boundaryOutbox/MQ/search are default-off, not default enabled

Extension model​

Each capability.Manifest owns its resource schema, routes, permissions, lifecycle, and optional UI registration. External business packages use only public surfaces such as pkg/platform/capability; when that contract is insufficient, extend the public contract before touching internal platform implementation.

Platform core and optional platform capabilities do not import business applications. Business tables, migrations, state machines, handlers, and UI remain in a downstream composition root, keeping the foundation reusable while domain behavior evolves independently.

Read business integration for the smallest practical example and the support matrix to distinguish the default path from controlled integrations.