diff --git a/web/components/architecture-diagram.tsx b/web/components/architecture-diagram.tsx index d089d0b..00d5b1b 100644 --- a/web/components/architecture-diagram.tsx +++ b/web/components/architecture-diagram.tsx @@ -1,11 +1,16 @@ "use client"; import { - ARCH_EDGES, - ARCH_NODES, + ARCH_BRANCH, + ARCH_MAIN, + ARCH_ROW_1, + ARCH_ROW_2, + nodeById, type ArchNode, type ArchNodeId, } from "@/lib/architecture"; +import { ArrowDownIcon, ArrowRightIcon } from "@/components/icons"; +import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; type Props = { @@ -16,33 +21,8 @@ type Props = { groupName?: string; }; -const SLOT: Record = { - partner: "lg:col-start-1 lg:row-start-1", - hmac: "lg:col-start-2 lg:row-start-1", - ingest: "lg:col-start-3 lg:row-start-1", - outbox: "lg:col-start-4 lg:row-start-1", - kafka: "lg:col-start-5 lg:row-start-1", - worker: "lg:col-start-1 lg:row-start-2", - rules: "lg:col-start-2 lg:row-start-2", - ledger: "lg:col-start-3 lg:row-start-2", - read: "lg:col-start-4 lg:row-start-2", - dlq: "lg:col-start-1 lg:row-start-3", -}; - -const COLS = 5; -const ROWS = 3; -const SLOT_XY: Record = { - partner: { col: 1, row: 1 }, - hmac: { col: 2, row: 1 }, - ingest: { col: 3, row: 1 }, - outbox: { col: 4, row: 1 }, - kafka: { col: 5, row: 1 }, - worker: { col: 1, row: 2 }, - rules: { col: 2, row: 2 }, - ledger: { col: 3, row: 2 }, - read: { col: 4, row: 2 }, - dlq: { col: 1, row: 3 }, -}; +const PATH_GRID = + "lg:grid-cols-[minmax(0,1fr)_1.5rem_minmax(0,1fr)_1.5rem_minmax(0,1fr)_1.5rem_minmax(0,1fr)_1.5rem_minmax(0,1fr)]"; export function ArchitectureDiagram({ selected, @@ -53,66 +33,224 @@ export function ArchitectureDiagram({ }: Props) { const hot = new Set(hotIds); const compact = variant === "compact"; + const stepOf = new Map(ARCH_MAIN.map((node, i) => [node.id, i + 1])); + const wrapLit = hopLit("kafka", "worker", selected, hot); return (
-
- Partner to GET player. HMAC is signed in the BFF and verified in Go. - Worker retries three times, then DLQ. +
+ Happy path 1 to 9. DLQ only after retry ×3.
-
- - {ARCH_EDGES.map(([from, to]) => ( - - ))} - -
    - {ARCH_NODES.map((node) => ( -
  1. + +
    + + + +

    Then the worker.

    + +
    + +
    +
    +

    After retry ×3

    +
    + + {ARCH_BRANCH.map((node) => ( -
  2. - ))} -
+ ))} +
+
); } -function edgePoints(from: ArchNodeId, to: ArchNodeId): string { - const a = SLOT_XY[from]; - const b = SLOT_XY[to]; - const x1 = ((a.col - 0.5) / COLS) * 100; - const y1 = ((a.row - 0.5) / ROWS) * 60; - const x2 = ((b.col - 0.5) / COLS) * 100; - const y2 = ((b.row - 0.5) / ROWS) * 60; - if (from === "kafka" && to === "worker") { - const midY = (1.5 / ROWS) * 60; - return `${x1},${y1} ${x1},${midY} ${x2},${midY} ${x2},${y2}`; - } - return `${x1},${y1} ${x2},${y2}`; +function PathRow({ + ids, + selected, + hot, + compact, + groupName, + stepOf, + onSelect, +}: { + ids: ArchNodeId[]; + selected: ArchNodeId; + hot: Set; + compact: boolean; + groupName: string; + stepOf: Map; + onSelect: (id: ArchNodeId) => void; +}) { + return ( +
    + {ids.map((id, i) => { + const node = nodeById(id); + const next = ids[i + 1]; + return ( +
  1. +
    + + {next ? ( + + ) : null} +
    + {next ? ( +
    + +
    + ) : null} +
  2. + ); + })} +
+ ); +} + +function WrapRail({ lit }: { lit: boolean }) { + const stroke = lit ? "bg-primary" : "bg-muted-foreground"; + const icon = lit ? "text-primary" : "text-muted-foreground"; + return ( + + ); +} + +function hopLit( + from: ArchNodeId, + to: ArchNodeId, + selected: ArchNodeId, + hot: Set, +): boolean { + return selected === from || selected === to || (hot.has(from) && hot.has(to)); +} + +function Hop({ + dir, + lit, + className, +}: { + dir: "right" | "down"; + lit: boolean; + className?: string; +}) { + const Icon = dir === "right" ? ArrowRightIcon : ArrowDownIcon; + return ( + + + + ); } function PathNode({ node, + step, selected, hot, compact, @@ -120,6 +258,7 @@ function PathNode({ onSelect, }: { node: ArchNode; + step: number | null; selected: boolean; hot: boolean; compact: boolean; @@ -148,13 +287,26 @@ function PathNode({ onChange={() => onSelect(node.id)} className="sr-only" /> - + + {step != null ? ( + + {step} + + ) : ( + + fail + + )} {node.label} {hot ? ( - - hot + + live ) : null} diff --git a/web/components/icons/.library.json b/web/components/icons/.library.json index 022a4cd..15b20c9 100644 --- a/web/components/icons/.library.json +++ b/web/components/icons/.library.json @@ -5,6 +5,8 @@ "installedAt": "2026-09-17T08:38:37.954Z", "icons": [ "activity", + "arrow-down", + "arrow-right", "chart-line", "checkmark", "compare", diff --git a/web/components/icons/arrow-down.tsx b/web/components/icons/arrow-down.tsx new file mode 100644 index 0000000..24edf49 --- /dev/null +++ b/web/components/icons/arrow-down.tsx @@ -0,0 +1,12 @@ +import type { SVGProps } from "react"; + +export function ArrowDownIcon(props: SVGProps) { + return ( + + + + ); +} diff --git a/web/components/icons/arrow-right.tsx b/web/components/icons/arrow-right.tsx new file mode 100644 index 0000000..631a6be --- /dev/null +++ b/web/components/icons/arrow-right.tsx @@ -0,0 +1,12 @@ +import type { SVGProps } from "react"; + +export function ArrowRightIcon(props: SVGProps) { + return ( + + + + ); +} diff --git a/web/components/icons/index.ts b/web/components/icons/index.ts index 2163900..b68f801 100644 --- a/web/components/icons/index.ts +++ b/web/components/icons/index.ts @@ -13,3 +13,5 @@ export { RenewIcon } from "./renew"; export { FlashIcon } from "./flash"; export { Network4Icon } from "./network-4"; export { DataTableIcon } from "./data-table"; +export { ArrowRightIcon } from "./arrow-right"; +export { ArrowDownIcon } from "./arrow-down"; diff --git a/web/components/pulse-theater.tsx b/web/components/pulse-theater.tsx index 7e39fda..afb7876 100644 --- a/web/components/pulse-theater.tsx +++ b/web/components/pulse-theater.tsx @@ -255,7 +255,7 @@ export function PulseTheater() {
Event path

- HMAC sign in the BFF, verify in Go, outbox, Kafka, worker tx. + HMAC, outbox, Kafka, worker. DLQ is off this path.