Appearance
Dispatch โ Project Overview & Architecture Reference โ
This document captures the project context, architecture, and conventions for the Dispatch design system. It mirrors the guidance in the repo's
CLAUDE.mdand is intended as a standalone reference for contributors.
What this repo is โ
Dispatch is the operating system for an AI-augmented BPO cooperative: member-partners are matched to client mandates, complete tasks (validated by AI + managing partners), earn GACx (a $1-pegged on-chain credit), run pulse surveys / OKRs, and govern via one-member-one-vote proposals.
This repository is not the shipping app โ it is a design system + visual/behavioral reference: the theme/token source of truth plus a set of vanilla HTML/CSS/JS templates that the real app follows. The production app is built separately on the latest Angular (standalone + signals, zoneless, SSR/SSG). When asked to "implement in Angular," treat this repo as the spec, not the codebase โ the full mapping is in design-system/design.md ยง8.
All real content lives in
design-system/. The git root only tracksREADME.md+.gitignore;design-system/is currently untracked. Run all commands fromdesign-system/.
Authoritative docs (read these first) โ
design-system/design.mdโ full product + architecture spec, and the Angular handoff (ยง8) with confirmed decisions (bootstrap, routing, SSR-safe patterns). The source of truth for intent.design-system/STATUS.mdโ live "pick up from here" working notes: what's built, what's open, cache-buster versions in use, recent gotchas. The source of truth for current state. Update it as work progresses.
Commands (run from design-system/) โ
bash
npm run build # tailwindcss CLI: src/app.css -> dist/app.css (minified) โ the real build
npm run dev # same, --watchThere is no test runner and no lint script. To preview a template, open its index.html directly in a browser โ pages self-bootstrap by CDN-loading Tailwind + DaisyUI at runtime (no build step needed for preview). The _ds_*.{json,js} files and _adherence.oxlintrc.json are generated tooling artifacts (design-system harness); do not hand-edit them.
Architecture โ
Bootstrap chain (every page) โ
Each page loads one line: templates/<slug>/ds-base.js. That shim resolves the project root and loads the shared runtime app-shell.js, which:
- injects the Tailwind v4 browser build + DaisyUI v5 from CDN,
- loads
styles.css+bespoke.css+ brand fonts, - mounts the connection indicator pill on
<body>, - registers the PWA service worker + manifest.
ds-base.js is the single line a consumer edits to point at the design system.
Theme is defined in THREE places โ keep them in sync โ
A change to any brand token (color/radius/font) must be mirrored in all three:
styles.cssโ[data-theme="dispatch"]/[data-theme="dispatch-dark"]CSS vars (preview).src/app.cssโ the same values via@plugin "daisyui/theme"(production build).app-shell.jsโ an inlinetype="text/tailwindcss"@themeblock (so the browser runtime generatesbg-primary,font-serif, โฆ utilities).
Two themes: dispatch (light, default) and dispatch-dark. Toggling sets data-theme on <html> (desktop) or on #device-screen (mobile); persisted in localStorage under dispatch_theme.
CSS layering โ
- DaisyUI components (
btn,card,navbar,progress,toast, โฆ) are used as plain classes โ these port to Angular templates unchanged. bespoke.cssholds everything DaisyUI doesn't: device frame, solar loader, connection pill, and the admin styles (.adm-*/.reg-*/.dash-*). Notedesign.mdreferences anadmin.cssthat does not exist โ admin styling lives inbespoke.css.
Templates โ
templates/desktop/โ member web app: navbar + 6 tabbed panels (Dispatch / Mandates / Pulse / OKRs / Vote / GACx Wallet) + the Dispatch AI chat.templates/mobile/โ 390px device frame, dark interior, 5 bottom-tab screens.templates/admin/โ back-office (index.html+admin.js) +register.html(first-run onboarding). Simulated Google Workspace SSO gate.
Controllers are vanilla JS with inline onclick="" handlers and direct DOM manipulation โ there is no framework or reactive state. (In the Angular port, onclick โ (click), state โ signals.)
Admin CRUD engine (templates/admin/admin.js) โ
A single SCHEMA object drives table columns, the create/edit modal fields, stat strips, and seed data for each entity (orgs, mandates, tasks, votes, users). Adding a field or entity = edit SCHEMA only. State persists to localStorage:
dispatch_admin_v3โ CRUD store. Bump the version suffix to reseed with fresh demo data.dispatch_notifs_v1โ notifications.dispatch_pending_usersโ registrations awaiting merge.sessionStorage dispatch_admin_authedโ simulated SSO session.
Domain rules to preserve (web + Angular must agree) โ
- Completion is derived live from a mandate's tasks, weighted by status: Passed 100% ยท Live 60% ยท Progress 50% ยท Queued/Failed 0%.
- Skill scores are on a 0.00โ10.00 scale, 2 decimals, with a self-assessed score and a separate MP-validated score; validation happens after the fact in the Validation queue, not at registration.
- Each user-skill carries a
coefficient(default0= unassigned) for scheduling, set by an MP later. - Dispatch AI chat is wired to the in-prototype bridge
window.claude.completewith a canned fallback if unavailable.
Conventions & gotchas โ
- Cache-busters: preview pages pin versions in the script
src(e.g.admin.js?v=8,ds-base.js?v=7); the?v=propagates HTML โ ds-base โ app-shell โ CSS. Bump the version when stale behavior appears after an edit. Current values are tracked inSTATUS.md. - No raw hex or px in styles โ the adherence ruleset flags raw
#rrggbbandNpx; use design tokens viavar(--color-*)/ the--radius-*/--size-*tokens. Don't importapp-shell.js/postcss.config.mjs/service-worker.jsinternals directly. - Template-string trap: avoid backticks or
${}inside HTML comments that sit inside a JS template literal (this brokeregister.htmltwice โ the backticks terminate the outer string). - Page background: the Tailwind/DaisyUI runtime injects
html,body{background:transparent}after our sheets;styles.cssbeats it with the higher-specificityhtml body{background:var(--color-base-100)}. Keep that rule if touching global background. - Everything backend-shaped is simulated/local: SSO sign-in, the connection heartbeat (
pingInfra()โ mock), notifications, and all data (localStorage). These become real in the Angular build; don't mistake them for live integrations.