Skip to content

Architecture Overview

Doug Fennell edited this page Sep 29, 2025 · 1 revision

Architecture Overview

This page explains how the RDCP demo is structured and how data flows through the system.

Links: Quick Start Guide β€’ Validation Scripts β€’ Troubleshooting β€’ Demo Scenarios

Package map

  • @rdcp.dev/core (packages/rdcp-core)
    • Protocol constants, headers, error codes, validation schemas, fixtures
  • @rdcp.dev/client (packages/rdcp-client)
    • Fetch-based client that calls RDCP endpoints (discovery/status/control/health)
  • @rdcp.dev/admin-ui (packages/rdcp-admin-ui)
    • Headless builder that produces an AdminUISpec from RDCP discovery
  • @rdcp.dev/admin-ui-react (packages/rdcp-admin-ui-react)
    • React components that render AdminUISpec server-side
  • @rdcp.dev/admin-app (packages/rdcp-admin-app)
    • Express server that exposes:
      • /admin (SSR HTML)
      • /admin/spec (AdminUISpec JSON using headless builder)
      • /admin/json (discovery + status JSON using the client SDK)
  • Demo App (packages/rdcp-demo-app)
    • RDCP-compliant endpoints on port 3000

Data flow (JSON)

Browser / Tool
    |                 (HTTP)
    v                    
http://localhost:3100/admin/json   http://localhost:3100/admin/spec
          |                                  |
          | (calls @rdcp.dev/client)         | (calls @rdcp.dev/admin-ui)
          v                                  v
      RDCP Server (port 3000) <β€”β€” discovery β€”β€” @rdcp.dev/admin-ui
           ^  ^                                    |
           |  β””β€” status                            | uses
           β””β€”β€” control (POST)                      β””β€” discovery JSON

Data flow (SSR)

GET /admin (3100)
  -> Admin App SSR handler
      -> creates RDCP client (baseUrl: http://localhost:3000)
      -> fetches discovery
      -> builds AdminUISpec via @rdcp.dev/admin-ui
      -> renders with @rdcp.dev/admin-ui-react and react-dom/server
      -> returns HTML including polling + Apply inline script

Why the Admin App is separate from the Demo App

  • Clean separation of concerns:
    • Demo App (port 3000): implements RDCP protocol; minimal, framework-agnostic
    • Admin App (port 3100): presentation layer; SSR + client hydration; consumes the protocol
  • Realistic deployment model:
    • In production, operational UI often lives outside service processes
  • Dogfooding both sides:
    • Validates the client SDK and the headless builder independently of the server implementation
Clone this wiki locally