TEA PlatformTEA Docs
Technical DocumentationArchitecture

Architecture overview

Understand the TEA Platform's application layers and where to find their code.

Edit on GitHub

The TEA Platform is a Next.js App Router application. It serves the browser interface, API handlers and documentation from one repository. PostgreSQL stores users, assurance cases, permissions and published snapshots. Prisma provides the database client and schema.

Find the main parts

PathPurpose
app/Pages, layouts and API route handlers
components/Browser interface, including the case editor
actions/Server actions used by parts of the interface
lib/services/Case, element, permission, publishing and integration operations
lib/auth/Session configuration and machine token checks
lib/prisma.ts, prisma/Database client, schema and SQL migrations
hooks/, store/Browser event subscriptions and editor state
lib/plugins/Plugin registration, slots and the health plugin

Browser components call both actions and /api handlers. Route handlers check authentication and delegate case operations to services. The editor itself is a client component at /case/[caseId]: it fetches case data, converts elements into a React Flow diagram and calls the relevant operations when you edit. See the case editor for its data flow.

Identity and access

NextAuth.js supports email and password, GitHub and Google sign-in. Browser requests use a session. Machine integrations present issued teap_… bearer tokens on /api/machine routes. A valid identity still needs permission for the case it touches. Case permissions can be granted to users or teams at view, comment, edit or admin levels. The API reference explains where to inspect the current routes.

Cases and publication

An assurance case holds its argument elements, case information and access grants. Its editor shows goals, strategies, property claims, evidence, away goals and modules with dedicated node renderers. Context is stored on relevant elements. The case model describes these records.

Publishing creates a frozen PublishedAssuranceCase snapshot for Discover. A later publication retires the current public version and creates another snapshot. The active workflow has draft and published states. Public snapshots omit collaboration comments. Unpublishing deletes the published versions and returns the working case to draft.

Plugins contribute features through registered slots.

MIT 2026 © Alan Turing InstituteTrustworthy and Ethical Assurance Platform