Platform
The shared platform packages and how they serve as the backend of record for the whole product.
The platform/ directory holds the cross-cutting backend packages. These implement the concerns every application module depends on: the database gateway, identity, tenants, permissions, request context, and admin identity. This section documents each one in code-level detail.
The platform packages are deliberately small in number - a locked set that the architecture deliberately limits. auth, database, organizations, and permissions carry the load; request-context composes them; admin-auth handles the admin console separately.
Database
The one gateway to Postgres: services, scoping helpers, and transactions.
Organizations
The full service surface for tenants, memberships, and the registry.
Admin auth
Operator identity for the admin console, in its own schema.
Admin console
The admin app itself and what it manages.
Configuration
Environment variables, constants, and feature flags.
The platform dependency graph
Platform packages depend only on each other and on shared core packages (@africaos/config, @africaos/logger). They never depend on apps or application modules, keeping the platform independent of any single vertical.
The Effect service pattern
Every platform package follows the same structure:
- A
Context.Serviceclass defines the tag and its method surface (theServicetype). - A
static Livelayer builds the production implementation, wired to whateverDatabaseandLoggerprovide. - Where relevant, a
static Testlayer replaces the database withDatabase.Test, so tests run without Postgres. - The implementation is factored into a
makeXServicefunction, so tests can construct one directly.
Server functions never instantiate services. They yield* them inside an Effect program, and the request runtime provides them.
A note on placeholder packages
notifications, offline, sdk, search, and storage exist as workspace members but export nothing yet. They are reserved slots for future platform work. Do not import them - they have nothing to offer.
Next steps
Start with Database - every other platform package builds on it.