# jojoasta381-max/span-qc architecture

> Architecture diagram of the GitHub repository jojoasta381-max/span-qc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jojoasta381-max/span-qc
- Repository: https://github.com/jojoasta381-max/span-qc

## Overview

SpanQC is a wiring-diagram quality-control SaaS. The principal workflow is an engineer uploading a schematic, selecting a project and standard, then reviewing a generated report and its findings. The README describes deterministic and OCR-based verification, coordinate-anchored evidence review, cryptographic sealing, and CSV/printable exports; the excerpts show upload, hashing, report creation, report storage, and review, but not the underlying verification engine. Several dashboard and account capabilities are represented at their enclosing page paths because their implementations were not sampled.

Main entry points: [`src/app/app/check/page.tsx`](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/check/page.tsx) (Diagram upload), [`src/lib/services/report-store.ts`](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/services/report-store.ts) (Report and export service), [`src/app/page.tsx`](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/page.tsx) (Product discovery), [`src/lib/api/qc.ts`](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/qc.ts) (Hybrid verification engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_qc["Quality control"]
  node_upload["Diagram upload<br/>[page.tsx]"]
  node_qc_engine["Hybrid verification engine<br/>[qc.ts]"]
  node_standards["Verification standards<br/>[index.ts]"]
  node_sample_cases["Sample QC cases<br/>[sample-data.ts]"]
end

subgraph group_reports["Evidence and reports"]
  node_report_store[("Report and export service<br/>[report-store.ts]")]
  node_report_review["Finding review<br/>[page.tsx]"]
  node_report_history["Report history<br/>[page.tsx]"]
end

subgraph group_account["Identity and workspace"]
  node_dashboard["QC dashboard<br/>[page.tsx]"]
  node_auth_context["Authentication context<br/>[auth-context.tsx]"]
  node_auth_api["Auth API client<br/>[auth.ts]"]
  node_api_client["HTTP API client<br/>[client.ts]"]
  node_auth_routes["Auth endpoints<br/>[route.ts]"]
  node_project_workspace["Projects<br/>[page.tsx]"]
  node_team_settings["Team and settings<br/>[page.tsx]"]
  node_billing_usage["Billing and usage<br/>[page.tsx]"]
end

subgraph group_experience["Product experience"]
  node_marketing["Product discovery<br/>[page.tsx]"]
  node_marketing_nav["Marketing navigation<br/>[MarketingNav.tsx]"]
  node_marketing_footer["Marketing links"]
  node_standards_catalog["Standards catalogue<br/>[page.tsx]"]
  node_pricing["Pricing<br/>[page.tsx]"]
  node_ui_primitives["UI components"]
end

node_engineer(("Engineer"))

node_engineer -->|"explores"| node_marketing
node_marketing -->|"renders"| node_marketing_nav
node_marketing -->|"renders"| node_marketing_footer
node_engineer -.->|"uploads diagram"| node_upload
node_dashboard -->|"links to"| node_upload
node_upload -->|"creates report"| node_report_store
node_upload -.->|"requests verification"| node_qc_engine
node_qc_engine -.->|"checks against"| node_standards
node_upload -->|"offers examples"| node_sample_cases
node_report_store -->|"loads cases"| node_sample_cases
node_report_store -->|"supplies report"| node_report_review
node_engineer -.->|"reviews findings"| node_report_review
node_report_store -.->|"provides history"| node_report_history
node_engineer -.->|"signs in"| node_auth_context
node_auth_context -->|"calls"| node_auth_api
node_auth_api -->|"uses"| node_api_client
node_api_client -.->|"sends requests"| node_auth_routes
node_engineer -.->|"browses standards"| node_standards_catalog
node_engineer -->|"views pricing"| node_pricing
node_engineer -.->|"manages projects"| node_project_workspace
node_engineer -.->|"manages workspace"| node_team_settings
node_engineer -.->|"checks usage"| node_billing_usage

click node_marketing "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/page.tsx"
click node_marketing_nav "https://github.com/jojoasta381-max/span-qc/blob/main/src/components/layout/MarketingNav.tsx"
click node_marketing_footer "https://github.com/jojoasta381-max/span-qc/blob/main/src/components/layout/MarketingFooter.tsx"
click node_standards_catalog "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/standards/page.tsx"
click node_pricing "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/pricing/page.tsx"
click node_dashboard "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/page.tsx"
click node_auth_context "https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/context/auth-context.tsx"
click node_auth_api "https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/auth.ts"
click node_api_client "https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/client.ts"
click node_auth_routes "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/api/v1/auth/login/route.ts"
click node_upload "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/check/page.tsx"
click node_qc_engine "https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/qc.ts"
click node_standards "https://github.com/jojoasta381-max/span-qc/blob/main/src/types/index.ts"
click node_sample_cases "https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/data/sample-data.ts"
click node_report_store "https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/services/report-store.ts"
click node_report_review "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/reports/%5BreportId%5D/page.tsx"
click node_report_history "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/history/page.tsx"
click node_project_workspace "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/projects/page.tsx"
click node_team_settings "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/team/page.tsx"
click node_billing_usage "https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/billing/page.tsx"
click node_ui_primitives "https://github.com/jojoasta381-max/span-qc/tree/main/src/components/ui"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_upload,node_qc_engine,node_standards,node_sample_cases toneBlue
class node_report_store,node_report_review,node_report_history toneAmber
class node_dashboard,node_auth_context,node_auth_api,node_api_client,node_auth_routes,node_project_workspace,node_team_settings,node_billing_usage toneMint
class node_marketing,node_marketing_nav,node_marketing_footer,node_standards_catalog,node_pricing,node_ui_primitives toneRose
class node_engineer toneIndigo
```

## Components

### Quality control

- [Diagram upload](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/check/page.tsx): `src/app/app/check/page.tsx`
- [Hybrid verification engine](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/qc.ts): `src/lib/api/qc.ts`
- [Verification standards](https://github.com/jojoasta381-max/span-qc/blob/main/src/types/index.ts): `src/types/index.ts`
- [Sample QC cases](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/data/sample-data.ts): `src/lib/data/sample-data.ts`

### Evidence and reports

- [Report and export service](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/services/report-store.ts): `src/lib/services/report-store.ts`
- [Finding review](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/reports/%5BreportId%5D/page.tsx): `src/app/app/reports/[reportId]/page.tsx`
- [Report history](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/history/page.tsx): `src/app/app/history/page.tsx`

### Identity and workspace

- [QC dashboard](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/page.tsx): `src/app/app/page.tsx`
- [Authentication context](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/context/auth-context.tsx): `src/lib/context/auth-context.tsx`
- [Auth API client](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/auth.ts): `src/lib/api/auth.ts`
- [HTTP API client](https://github.com/jojoasta381-max/span-qc/blob/main/src/lib/api/client.ts): `src/lib/api/client.ts`
- [Auth endpoints](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/api/v1/auth/login/route.ts): `src/app/api/v1/auth/login/route.ts`
- [Projects](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/projects/page.tsx): `src/app/app/projects/page.tsx`
- [Team and settings](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/team/page.tsx): `src/app/app/team/page.tsx`
- [Billing and usage](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/app/billing/page.tsx): `src/app/app/billing/page.tsx`

### Product experience

- [Product discovery](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Marketing navigation](https://github.com/jojoasta381-max/span-qc/blob/main/src/components/layout/MarketingNav.tsx): `src/components/layout/MarketingNav.tsx`
- [Marketing links](https://github.com/jojoasta381-max/span-qc/blob/main/src/components/layout/MarketingFooter.tsx): `src/components/layout/MarketingFooter.tsx`
- [Standards catalogue](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/standards/page.tsx): `src/app/standards/page.tsx`
- [Pricing](https://github.com/jojoasta381-max/span-qc/blob/main/src/app/pricing/page.tsx): `src/app/pricing/page.tsx`
- [UI components](https://github.com/jojoasta381-max/span-qc/tree/main/src/components/ui): `src/components/ui`

### Other components

- **Engineer**

## Connections

- Engineer → Product discovery: explores (evidence: `src/app/page.tsx`)
- Product discovery → Marketing navigation: renders (evidence: `src/app/page.tsx`)
- Product discovery → Marketing links: renders (evidence: `src/app/page.tsx`)
- Engineer → Diagram upload: uploads diagram (evidence: `README.md`)
- QC dashboard → Diagram upload: links to (evidence: `src/app/app/page.tsx`)
- Diagram upload → Report and export service: creates report (evidence: `src/app/app/check/page.tsx`)
- Diagram upload → Hybrid verification engine: requests verification
- Hybrid verification engine → Verification standards: checks against (evidence: `README.md`)
- Diagram upload → Sample QC cases: offers examples (evidence: `src/app/app/check/page.tsx`)
- Report and export service → Sample QC cases: loads cases (evidence: `src/lib/services/report-store.ts`)
- Report and export service → Finding review: supplies report (evidence: `src/app/app/reports/[reportId]/page.tsx`)
- Engineer → Finding review: reviews findings (evidence: `README.md`)
- Report and export service → Report history: provides history
- Engineer → Authentication context: signs in (evidence: `README.md`)
- Authentication context → Auth API client: calls (evidence: `src/lib/context/auth-context.tsx`)
- Auth API client → HTTP API client: uses (evidence: `src/lib/api/auth.ts`)
- HTTP API client → Auth endpoints: sends requests
- Engineer → Standards catalogue: browses standards (evidence: `README.md`)
- Engineer → Pricing: views pricing (evidence: `src/app/pricing/page.tsx`)
- Engineer → Projects: manages projects
- Engineer → Team and settings: manages workspace
- Engineer → Billing and usage: checks usage
