Skip to content
VerificationWould you notice if your agent drifted in production?Explore the 5-stage harness›
Framework Architecture

Full-Stack Runtime Architecture

At runtime, an Aegil application is a standard, production-ready Serverpod backend communicating with a Flutter frontend over HTTP RPC and real-time WebSockets, backed by PostgreSQL. Aegil itself has zero runtime dependencies—it operates entirely as a design-time domain compiler and verification harness.

Aegil has zero runtime dependencies. Aegil is a compiler and verification harness: once compiled, your backend and frontend run using official Serverpod and Flutter packages.

Aegil Full-Stack Runtime Architecture


  • Single Public API Barrel: Hand-written Flutter code never imports deep backend or protocol paths. Everything is exposed through package:<app>_flutter/api.dart.
  • Pre-Configured Client: createAppClient() initializes connectivity with session persistence, automatic reconnects, and token management.
  • Generated Feature BLoCs: Every entity with an @autoQuery receives an <Entity>Bloc managing query caching, optimistic UI updates, and real-time stream subscriptions.
  • HTTP RPC: Unary operations (queries and mutations) execute over Serverpod’s high-performance HTTP JSON-RPC protocol.
  • WebSocket Streams: Real-time streams declared via @autoStream maintain a persistent WebSocket connection to broadcast live updates instantly.
  • Session Tokens: Authentication headers are attached automatically by the client SDK and validated on every request.

3. Serverpod Backend Layer (.aegil/server/)

Section titled “3. Serverpod Backend Layer (.aegil/server/)”
  • Zero-Trust Identity Extraction: Endpoints extract auth.id and auth.role strictly from the server session. No client can pass an actingRole parameter.
  • Database-Level RLS Pushdown: Common Expression Language (CEL) policies declared in specs compile into PostgreSQL WHERE clauses, filtering data inside the database.
  • Transaction Lifecycle: Mutations execute inside atomic database transactions (Transaction tx), passing pre-fetched entities and transactions to custom hooks.