Architecture
Overview
The project is a monorepo managed by Turborepo with Bun workspaces. It consists of three apps and one shared package.
Tech Stack
Backend (apps/api)
| Technology | Purpose |
|---|---|
| Hono | Web framework |
| Bun | Runtime, package manager, test runner |
| Prisma | ORM for PostgreSQL |
| Playwright | Browser automation for checking plates |
| Trigger.dev | Background job scheduling and execution |
| Sentry | Error monitoring (production only) |
| Scalar | Interactive API reference at /docs |
Frontend (apps/web)
| Technology | Purpose |
|---|---|
| Next.js | React framework (App Router) |
| shadcn/ui | Component library (Radix primitives) |
| Tailwind CSS | Utility-first styling |
| ReactFlow | Workflow builder canvas |
| Zustand | State management (builder store) |
| React Hook Form | Form handling with Zod integration |
| Axios | HTTP client with retry logic |
Shared (packages/shared)
The shared package is the single source of truth for types and validation used by both apps:
| Export | Description |
|---|---|
validators | Zod schemas for license plates, users, workflows |
workflow-dsl | Graph schema, node config schemas, type definitions |
builder-ir | Intermediate representation schema for compiled workflows |
template-variables | Variable definitions, parser, and resolver |
node-registry | Node type registry with specs, ports, and config schemas |
types | Shared TypeScript types (User, Check, Workflow, Execution) |
constants | Limits and scheme constants |
Data Flow
License Plate Check Flow
This diagram shows the network communication flow triggered by a user creating a check request with a workflow attached. Attaching a workflow to an existing check will trigger the same flow.
Database
PostgreSQL hosted on Supabase (Frankfurt region). Uses pgBouncer for connection pooling at runtime and a direct connection for migrations.
Key Models
| Model | Description |
|---|---|
User | User accounts with profile information (name, address, etc.) |
CityAbbreviation | Available German cities with reservation website URLs and allowed domains |
LicenseplateCheck | Individual check requests with status, scheduling info, and workflow reference |
Workflow | Automation definitions with name, city, graph definition (JSON), and publish state |
WorkflowExecution | Execution history with status, logs, outcome, duration, and error details |
