Dashboard Functionality — Plan

Source: Paperclip CAS-450 plan document (revision 2) Issue: CAS-450 PR: cascadeguard-app#137

Context

Supply chain dashboard at /dashboard showing the operational state of repositories protected by CascadeGuard. Separate from the managed image registry at /images.

Current State (Phase 1 — Complete, not merged)

  • PR cascadeguard-app#137 — Dashboard UI with desktop table + mobile card layout
  • All CI green, CTO architecturally approved
  • Still a draft PR — board has not merged
  • Mock data currently lives in cascadeguard-app/mocks/dashboard/repos/ YAML files

Board Requirements (2026-04-13 — must be done before merging to main)

  1. Data in cascadeguard-data repo — repo data driving the dashboard expressed as YAML files, NOT mocked inside the app repo
  2. Company directory structurecompanies/:company-name/ in cascadeguard-data
  3. Clerk user → company linking — users linked to companies by email address
  4. Multi-company switching — when logged in and a user has multiple companies, they can switch between them to see dashboard rendered per company
  5. Seed datacraig.edmunds@gmail.com → company Cascade Guard with the data currently shown in the mock

Delivery Scope

full-stack — spans data repo changes, API (Clerk→company linking), and frontend (company switcher)

Phase 2 — Data Layer (CTO owns)

cascadeguard-data repo changes

  • Create companies/cascade-guard/ directory structure
  • Move existing mock YAML repo data into companies/cascade-guard/repos/
  • Define companies/cascade-guard/meta.yaml (company name, email associations)

API changes (cascadeguard-app API package)

  • Endpoint to read company data from cascadeguard-data (submodule or git-backed read)
  • Associate Clerk user email with company via email → companies lookup
  • Return company list for a logged-in user (for switcher)
  • Return company-scoped dashboard data given company slug

Phase 3 — Frontend (CTO/Tomás owns)

  • Company switcher component (dropdown/tabs when user has 2+ companies)
  • Dashboard page reads from API instead of static YAML import
  • Default to user primary company on load
  • On switch, re-render dashboard with new company data

Phase 4 — Seed & Validation

  • Populate cascade-guard company in cascadeguard-data with current mock data (5 CascadeGuard repos + 2-3 example repos)
  • Verify craig.edmunds@gmail.com → Cascade Guard dashboard works end-to-end

Acceptance Criteria

  • cascadeguard-data repo has companies/cascade-guard/ with repo YAML files
  • Logged-in user sees their company data (not a static mock)
  • User with multiple companies can switch between them
  • craig.edmunds@gmail.com logs in and sees “Cascade Guard” company dashboard
  • PR #137 (or successor) is undrafted and can merge to main
  • All CI green