How alan-youngzhe/ordine-fork works
1. What this repo is
Ordine is a monorepo for an AI-agent orchestration platform. The core idea is: users define typed objects, operations, and DAG pipelines; the system executes them with configurable AI agents or scripts and records jobs, traces, and results.
2. Primary runtime surfaces
There are four real entry points: the main browser app in apps/app, the API server in apps/server, the local bootstrap/installer flow in apps/create, and the desktop shell in apps/desktop-app (Tauri + bundled server). apps/cli is a small command-line control surface, mostly for daemon/API interactions and local workflows.
3. User-facing product boundary
The main UI is a React/Vite app using TanStack Router, tRPC client calls, and a large set of page modules under apps/app/src/pages. The key interactive areas are pipelines, operations, jobs, skills, agents, connectors, settings, and the workspace canvas. The workspace page is the most orchestration-heavy UI: it edits pipeline graphs, manages agent conversations, and polls run state.
4. API boundary
The app exposes API routes under apps/app/src/routes/api for auth, local session, and tRPC. The server exposes the shared backend routes under apps/server/src/routes and apps/server/src/integrations/trpc. In practice, the browser UI talks to backend data and actions through tRPC, while some server-side agent endpoints are also available for non-browser consumers.
5. Core domain logic lives in packages/services
This package is the main business-logic layer. It contains services for pipelines, operations, jobs, projects, skills, settings, usage, connectors, distillations, refinements, routine scheduling, filesystem access, GitHub projects, and agent runtimes. Most app/server route handlers should be thin adapters over these services.
6. Execution engines
Two packages do the heavy runtime work:
- packages/pipeline-engine executes DAG pipelines, resolves node/edge semantics, applies actions, and validates connection rules.
- packages/agent-engine and packages/agent wrap external AI runtimes and tool protocols such as Claude, Codex, Hermes, OpenClaw, and MCP-style integrations.
The pipeline runner service in packages/services/src/pipelineRunnerService bridges these engines to the product domain: it converts pipeline definitions into executions, controls run phases, and persists run progress.
7. Persistence and data model
Database structure is defined in packages/db-schema, with DAOs in packages/models, a DB wrapper in packages/db, and generated migrations in apps/app/drizzle. The schema covers pipelines, jobs, operations, skills, agents, connectors, projects, runtime configs, conversations, annotations, traces, distillations, refinements, and usage. This is the primary source of truth for the application state.
8. Local vs hosted database topology
The system can run against either embedded PGLite or a PostgreSQL instance. The apps/create package exists to provision a local single-user installation with embedded PostgreSQL, run migrations, and start the app without external setup. The README’s “local mode” is effectively a self-hosted topology where auth is skipped and a default user is created.
9. Desktop distribution
apps/desktop-app wraps the web UI in a Tauri shell and bundles a server process via a custom sidecar/server integration. This makes the product runnable as a local desktop application while still reusing the same app and backend concepts.
10. Extensibility model
Plugins are first-class. packages/plugin defines the plugin contract, packages/plugins contains built-in plugins like the GitHub project plugin, and the app’s plugin pages manage installed/available plugin features. Plugins extend object types, operations, and workflow capabilities rather than acting as isolated extensions.
11. Content and prompt assets
apps/docs and skills/ are not runtime code paths, but they matter architecturally because they define the product’s operational knowledge: how to create pipelines, run operations, manage jobs, and use the agent system. apps/scripts seeds and migrates content like best practices, operations, rules, and skill pipelines into the database.
12. Shared infrastructure packages
Several packages provide cross-cutting infrastructure: packages/schemas for Zod schemas and contract types, packages/ui for shared components, packages/views for reusable page views, packages/shared for generic helpers and environment handling, packages/logger for logging, and packages/obs for tracing/observability. These packages keep the app/server/domain layers aligned on types and runtime behavior.
13. Important architectural boundary
The active system is split cleanly into: presentation (apps/app, apps/desktop-app), application/API (apps/server, app API routes), domain services (packages/services), execution engines (packages/pipeline-engine, packages/agent*), and persistence (packages/db*, apps/app/drizzle). Legacy implementations live under archive/ and are not part of the current mainline architecture.
Main entry points: services Domain services · app Web app · server API server · pipelineRunnerService Pipeline runner
Components 21
Apps
Runtime entry points and user-facing surfaces
- Web app · Primary browser application with routes, pages, and client-side API calls
apps/app - API server · Shared backend server exposing route handlers and tRPC endpoints
apps/server - Installer · Provisioning flow for embedded PostgreSQL, migrations, and first launch
apps/create - Desktop shell · Desktop distribution that embeds the web app and bundles a server sidecar
apps/desktop-app - CLI · Command-line interface for daemon and API workflows
apps/cli - App API · Browser-app API routes for auth, local session, and tRPC
apps/app/src/routes/api - Product pages · Primary product pages for pipelines, operations, jobs, skills, agents, connectors, settings, plugins, and workspace
apps/app/src/pages - Workspace · Canvas-centric editor for pipeline graphs, agent conversations, and run polling
apps/app/src/pages/WorkspacePage - Server routes · Backend route handlers for core resources and product actions
apps/server/src/routes - Server tRPC · Server-side tRPC composition and router integration
apps/server/src/integrations/trpc
Packages
Shared domain, execution, persistence, and infrastructure
- Domain services · Main service layer for pipelines, operations, jobs, projects, skills, connectors, routines, settings, usage, and agent runtimes
packages/services - Pipeline runner · Bridges product pipelines to execution phases, run progress, and persistence
packages/services/src/pipelineRunnerService - Pipeline engine · Executes DAG pipelines, resolves node and edge semantics, and applies actions
packages/pipeline-engine - Agent runtimes · Claude, Codex, Hermes, OpenClaw, MCP, scan, and structured-agent integrations
packages/agent/src - DB schema · Database schema for pipelines, jobs, operations, skills, agents, connectors, projects, traces, distillations, refinements, settings, and usage
packages/db-schema - DAOs · Entity-level persistence objects used by services
packages/models - DB wrapper · Database wrapper used by DAOs and application code
packages/db - Contracts · Shared runtime schemas and contract types across domain layers
packages/schemas - Plugins · Plugin contract, registry, and built-in extensions such as GitHub project support
packages/plugin - Infra packages · Shared UI, views, helpers, logging, observability, and filesystem utilities
packages/shared
Content
Docs, skills, and seeded operational knowledge
- Docs & skills · Documentation, skill guides, and seeded operational content
apps/docs
Connections 27
- Web app → App API: uses · Browser UI reaches auth, local session, and tRPC entrypoints
- Web app → Product pages: renders · Top-level browser app is composed from product pages
- Product pages → Workspace: contains · Workspace is the orchestration-heavy product surface
- Desktop shell → Web app: hosts · Desktop shell embeds the browser app
- Desktop shell → API server: bundles · Desktop distribution includes a server sidecar
- Installer → Web app: boots · Installer provisions and launches the local app
- Installer → DB wrapper: initializes · Local setup prepares embedded PostgreSQL and migrations
- CLI → API server: drives · CLI interacts with daemon and API workflows
- API server → Server routes: exposes · Server HTTP surface is composed from route handlers
- API server → Server tRPC: hosts · Server tRPC integration powers remote calls
- Server routes → Domain services: adapts · Route handlers are thin adapters over services
- Server tRPC → Domain services: calls · RPC layer delegates business actions to services
- App API → Domain services: calls · Browser-side API routes delegate to backend services
- Domain services → Pipeline runner: orchestrates · Pipeline service coordinates execution and persistence
- Pipeline runner → Pipeline engine: executes · Runner bridges product pipelines into DAG execution
- Pipeline runner → Agent runtimes: invokes · Runner uses agent runtimes and tool protocols for AI steps
- Domain services → DAOs: persists via · Services read and write entities through DAOs
- DAOs → DB wrapper: uses · DAOs use the DB wrapper for storage access
- DB wrapper → DB schema: maps to · Database wrapper operates over the canonical schema
- Domain services → Contracts: shares contracts · Services rely on shared schemas and domain types
- Product pages → Plugins: extends via · Plugin pages manage installed and available extensions
- Domain services → Plugins: loads plugins · Plugin contract influences object, operation, and workflow capabilities
- Docs & skills → Domain services: guides · Docs and skills encode intended operational workflows
- Docs & skills → Pipeline runner: teaches · Skill assets describe how to run and compose pipelines and operations
- Infra packages → Web app: supports · Shared UI and helper packages underpin the browser app
- Infra packages → API server: supports · Shared logging, env, and utility packages support backend runtime
- Infra packages → Domain services: supports · Cross-cutting helpers and schemas keep domain layers aligned