Akan applications run on a Bun-based runtime that connects app code, generated artifacts, server routes, and pages. The app entry point (main.ts) starts the runtime, and Akan handles the server shape behind it.
When Akan App starts, Akan Server prepares everything the app can serve. In practice, the runtime exposes four kinds of work.
- Internal API (Queue, Timer, etc.): internal work that runs without a browser request.
- API (HTTP, WebSocket): public communication for data requests and realtime updates.
- SSR Pages (Web): web pages rendered by the server and sent to the browser.
- CSR Page (Android, iOS): client-rendered pages used by mobile targets.
One Akan App can run one or more Akan Server processes. AKAN_REPLICA controls how many server processes are started for each role, so the same app can scale web traffic and background work separately. For browser traffic, Akan App also load-balances requests across ready federation and all servers.
- federation: serves browser traffic such as pages, API calls, and WebSocket connections.
- batch: runs background work such as queues, timers, and scheduled jobs.
- all: runs both federation and batch behavior in one server process. This is the simple local default.
A single Akan App has built-in clustering. You can run multiple server replicas and let Akan App distribute traffic, without setting up separate local load-balancing tools such as nginx, docker compose, or pm2.