Skip to content

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)

TechnologyPurpose
HonoWeb framework
BunRuntime, package manager, test runner
PrismaORM for PostgreSQL
PlaywrightBrowser automation for checking plates
Trigger.devBackground job scheduling and execution
SentryError monitoring (production only)
ScalarInteractive API reference at /docs

Frontend (apps/web)

TechnologyPurpose
Next.jsReact framework (App Router)
shadcn/uiComponent library (Radix primitives)
Tailwind CSSUtility-first styling
ReactFlowWorkflow builder canvas
ZustandState management (builder store)
React Hook FormForm handling with Zod integration
AxiosHTTP client with retry logic

Shared (packages/shared)

The shared package is the single source of truth for types and validation used by both apps:

ExportDescription
validatorsZod schemas for license plates, users, workflows
workflow-dslGraph schema, node config schemas, type definitions
builder-irIntermediate representation schema for compiled workflows
template-variablesVariable definitions, parser, and resolver
node-registryNode type registry with specs, ports, and config schemas
typesShared TypeScript types (User, Check, Workflow, Execution)
constantsLimits 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

ModelDescription
UserUser accounts with profile information (name, address, etc.)
CityAbbreviationAvailable German cities with reservation website URLs and allowed domains
LicenseplateCheckIndividual check requests with status, scheduling info, and workflow reference
WorkflowAutomation definitions with name, city, graph definition (JSON), and publish state
WorkflowExecutionExecution history with status, logs, outcome, duration, and error details

Database Schema