Backend

[ AxiomCore · Documentation ]

Build a backend

How an Acore backend turns typed declarations into a public contract, a private execution plan and a running HTTP service.

An AxiomCore backend is an HTTP service described by an Acore contract. This section shows how to declare a backend in Acore, run it locally, protect it, connect providers and package it for a deployment target. Both paths below produce a contract that clients, tests and Inspector can read.

Start fromFirst guideWhat stays yours
FastAPIFastAPIThe Python application and its business logic
GoGoThe Go application and its router
AcoreBuild your first APIAuthored models, actions, policies and deployment choices
A database-backed appRun your first appThe database contract and typed storage mappings

What a backend is made of

FileCreated byRead by
.acore source and AxiomDeps.toml with type = "backend"YouCompiler and editor
backend.axiom, the public contractaxiom buildClients, tests, Inspector and Axiom Cloud
backend.server.json, the private execution planaxiom build, when the source declares server behaviorThe server runtime only
deployment.json, the private deploymentaxiom server deployment, then your reviewThe server runtime only

The public contract describes endpoints, models and client policies. The private plan holds actions, guards, resources and server policies, which clients never receive. The deployment names environment variables and grants, never secret values.

A request through an Acore backend

How one HTTP request moves through an Acore backend
How one HTTP request moves through an Acore backend
Diagram source
flowchart LR
  A[Client] --> B[Transport or framework adapter]
  B --> C[Limits and input validation]
  C --> D[Identity]
  D --> E[Guards and server policies]
  E --> F[Action]
  F --> G[Effect gate]
  G --> H[Storage or provider]
  H --> I[Output validation]
  I --> J[Response]

The transport applies size limits and validates the request against the contract. The server verifies the caller, then enforces the action's mandatory guards and the server policies (rate limits, idempotency, timeouts). The action runs as managed Acore code, a verified WebAssembly sandbox or registered native code. Each storage or provider call passes an effect gate that checks the declared operation and the deployment's grant. Output is validated before the response is sent. Execution plan gives the exact stage order.

Contract lifecycle

From Acore source to a released backend
From Acore source to a released backend
Diagram source
flowchart LR
  A[Write .acore source] --> B[axiom check]
  B --> C[axiom build]
  C --> D[Contract and private plan]
  D --> E[Inspect, test and diff]
  E --> F[Review deployment.json]
  F --> G[Run locally]
  G --> H[Package for a target]
  H --> I[Verify and release]
  1. Write the source and validate it with axiom check.
  2. Build with axiom build main.acore --out backend.axiom. This writes the contract and, beside it, backend.server.json.
  3. Review with axiom inspect, axiom server inspect, axiom test, axiom diff, axiom security check and axiom domain validate. Inspection reads artifacts; it does not run the backend.
  4. Scaffold deployment.json with axiom server deployment, then review its providers, authentication and grants.
  5. Run the real service with axiom run or axiom serve, or choose an explicit mock. Add persistence with storage mappings.
  6. Package for a deployment target, verify the bundle, and release. A Cloud contract release is immutable; publish a new version instead of overwriting one.

A built contract does not start or deploy a service.

Status

CapabilityStatus
Backend contracts: check, build, inspect, semantic diffAlpha
Managed actions, typed failures and local real servingExperimental
SQLite and PostgreSQL storage mappingsExperimental
Deployment targetsPer target; see Deployment targets
FastAPI extraction / Go extractionAvailable / Alpha; see Use your existing stack
HTTP adapters for FastAPI and Go Chi handlersExperimental

See Support and availability for the full matrix.

In this section

Next steps