Platform architecture
Apso separates product intent, generated framework code, custom behavior, and deployment operations. This makes schema changes reviewable and keeps the resulting backend usable as a standard framework project.
Core flow
Describe the behavior
Actors, records, permissions, tenant boundaries, and the workflows they need.
Define the model
.apsorcEntities, fields, relationships, auth strategy, indexes, and scope.
Build the service
APIs, migrations, guards, tests, infrastructure, and OpenAPI.
Extend, run, and own
src/extensions/Add product behavior, connect the client, and deploy wherever you choose.
| Boundary | Responsibility |
|---|---|
| Product brief | Describe the application domain and first user workflow. |
.apsorc | Define entities, fields, relationships, auth, scoping, and generation settings. |
| CLI | Parse, validate, generate, diagnose, test migrations, and coordinate platform actions. |
| Language generator | Produce NestJS and TypeORM, FastAPI and SQLAlchemy, or Gin and GORM source. |
autogen/ | Hold replaceable framework layers derived from the schema. |
extensions/ | Hold product-specific endpoints, hooks, integrations, and business rules. |
| Repository | Record the schema, generated diff, migrations, extensions, dependencies, and tests. |
| Runtime | Run locally, in Apso Cloud, or in infrastructure owned by the team. |
Generation path
apso generate reads .apsorc, resolves the target language, validates generator compatibility, builds the relationship map, and writes the generated layers in the configured rootFolder.
For a REST entity, the generator creates the framework-native equivalents of:
- Persistence model
- Create and update request types
- CRUD service
- HTTP controller or handler when
httpis enabled - Module or route registration
- Relationship wiring
- Auth and scoping support when configured
The exact filenames differ by framework. The ownership rule remains the same: generated layers can be replaced, and extensions are preserved.
Request path
- 01ClientServer component, mobile app, or service
- 02SDK or RESTTyped operation and validated payload
- 03IdentitySession, JWT, or API key context
- 04Tenant scopeAuthorization and row boundary
- 05ServiceGenerated route, product logic, and database
When auth and scopeBy are configured, the request identity supplies fields such as workspaceId. The generated scope layer filters reads, injects scope on create, and verifies ownership for single-record operations. Extensions add product rules around this base behavior.
Local runtime
apso dev detects the language and database configuration from .apsorc and .env. It starts the native development command, or Docker when --docker is provided. The generated service exposes its OpenAPI surface at /_docs.
apso migrate compares schema snapshots, creates migration SQL, and runs the change against a local PGlite sandbox. This gives the developer a reviewable database impact before deployment.
Cloud deployment
For a linked service, apso deploy:
- Verifies CLI authentication and the local project link.
- Parses
.apsorcand runs the migration sandbox unless skipped. - Synchronizes local source to the connected GitHub repository unless skipped.
- Triggers the Apso build.
- Waits for the build result unless
--no-waitis set.
The platform build provisions the service through an ordered workflow covering initialization, codebase preparation, database resources, and the application cloud stack. Build status is returned to the CLI and dashboard.
The cloud workflow consumes the same source repository the team can inspect and run locally. Generated code does not require a proprietary Apso runtime after generation.
System components
| Component | Role |
|---|---|
| Web application | Service builder, schema editor, code editor, credentials, environment, docs, deployment, and billing UI. |
| Platform API | Workspaces, services, users, schema state, billing, and platform CRUD. |
| CLI | Local generation and the developer interface to platform operations. |
| Build engine | Ordered provisioning and build orchestration. |
| Service templates | Framework baselines used before entity-specific generation. |
| SDK | TypeScript client for generated REST resources. |
Failure boundaries
- Schema validation stops before generation.
- A generator failure leaves the reviewed schema as the source for diagnosis.
- A migration failure stops deployment before the remote build.
- An extension build failure does not require changes to generated files.
- Use
apso statusandapso logsto diagnose a platform failure.