# chungcb4444-alt/scamgraph-demo architecture

> Architecture diagram of the GitHub repository chungcb4444-alt/scamgraph-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chungcb4444-alt/scamgraph-demo
- Repository: https://github.com/chungcb4444-alt/scamgraph-demo

## Overview

ScamGraph is a simulated, browser-only case review application. Residents submit reports; reception staff review and route them for analysis; analysts inspect extracted details and links, then create cases for assignment, handling, and report review. Leaders manage assignments and review reports; supervisors inspect audit history, while administrators manage accounts and permissions. State is stored in origin-scoped localStorage. The supplied excerpts show only parts of the application coordinator and operations layer, so documented workflow links are cited to the README; unsampled implementation details are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/App.tsx) (Application workspace), [`src/CaseWorkPanel.tsx`](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/CaseWorkPanel.tsx) (Casework and reports), [`src/operations.ts`](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/operations.ts) (Business operations), [`src/ReportPeople.tsx`](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportPeople.tsx) (Report people)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app_entry["React entry<br/>[main.tsx]"]
  node_app_shell["Application workspace<br/>[App.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_permissions["Access rules<br/>[access.ts]"]
  node_operations["Business operations<br/>[operations.ts]"]
  node_data_types["Domain data types<br/>[types.ts]"]
end

subgraph group_intake["Report intake and analysis"]
  node_intake_form["Report intake<br/>[ReportIntake.tsx]"]
  node_report_people["Report people<br/>[ReportPeople.tsx]"]
  node_privacy["Sensitive data controls<br/>[ReportPrivacy.tsx]"]
  node_sensitive_value["Sensitive value display<br/>[SensitiveValue.tsx]"]
  node_analysis_graph["Link analysis graph<br/>[LinkGraph.tsx]"]
  node_reception["Reception workflow<br/>[ReceptionPanel.tsx]"]
end

subgraph group_cases["Casework and review"]
  node_case_panel["Casework and reports<br/>[CaseWorkPanel.tsx]"]
  node_case_messages["Opinions and requests<br/>[CaseMessages.tsx]"]
  node_source_requests["Source requests<br/>[SourceRequests.tsx]"]
  node_role_work["Role workspaces<br/>[RoleWork.tsx]"]
  node_report_history["Report history<br/>[ReportHistory.tsx]"]
  node_receipt_rules["Receipt workflow rules<br/>[receiptWorkflow.ts]"]
end

subgraph group_oversight["Administration and audit"]
  node_account_admin["Account administration<br/>[AccountManager.tsx]"]
  node_summary["Work summary<br/>[WorkSummary.tsx]"]
end

node_users(("Residents and staff"))
node_browser_store[("Browser localStorage")]

node_app_entry -->|"renders"| node_app_shell
node_users -->|"signs in"| node_login
node_login -->|"enters workspace"| node_app_shell
node_app_shell -->|"checks access"| node_permissions
node_app_shell -->|"opens intake"| node_intake_form
node_app_shell -->|"routes report work"| node_reception
node_users -->|"submits report"| node_intake_form
node_intake_form -->|"creates report for review"| node_reception
node_reception -->|"hands off for analysis"| node_analysis_graph
node_app_shell -->|"opens link view"| node_analysis_graph
node_app_shell -->|"shows report parties"| node_report_people
node_report_people -->|"renders values"| node_sensitive_value
node_report_people -->|"uses privacy controls"| node_privacy
node_analysis_graph -.->|"supports link decisions"| node_operations
node_app_shell -->|"opens casework"| node_case_panel
node_case_panel -->|"checks receipt status"| node_receipt_rules
node_case_panel -->|"submits case actions"| node_operations
node_case_panel -->|"shows case opinions"| node_case_messages
node_case_panel -->|"handles source requests"| node_source_requests
node_users -->|"works by role"| node_role_work
node_role_work -->|"opens assigned cases"| node_case_panel
node_case_panel -->|"preserves report versions"| node_report_history
node_operations -->|"enforces permissions"| node_permissions
node_operations -->|"checks receipt rules"| node_receipt_rules
node_app_shell -->|"opens administration"| node_account_admin
node_account_admin -->|"submits account changes"| node_operations
node_app_shell -.->|"shows work overview"| node_summary
node_app_shell -->|"persists application state"| node_browser_store
node_operations -->|"uses domain records"| node_data_types

click node_app_entry "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/main.tsx"
click node_app_shell "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/App.tsx"
click node_login "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/Login.tsx"
click node_permissions "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/access.ts"
click node_operations "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/operations.ts"
click node_intake_form "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportIntake.tsx"
click node_report_people "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportPeople.tsx"
click node_privacy "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportPrivacy.tsx"
click node_sensitive_value "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/SensitiveValue.tsx"
click node_analysis_graph "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/LinkGraph.tsx"
click node_reception "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReceptionPanel.tsx"
click node_case_panel "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/CaseWorkPanel.tsx"
click node_case_messages "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/CaseMessages.tsx"
click node_source_requests "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/SourceRequests.tsx"
click node_role_work "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/RoleWork.tsx"
click node_report_history "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportHistory.tsx"
click node_receipt_rules "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/receiptWorkflow.ts"
click node_account_admin "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/AccountManager.tsx"
click node_summary "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/WorkSummary.tsx"
click node_data_types "https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/types.ts"

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_app_entry,node_app_shell,node_login,node_permissions,node_operations,node_data_types toneBlue
class node_intake_form,node_report_people,node_privacy,node_sensitive_value,node_analysis_graph,node_reception,node_browser_store toneAmber
class node_case_panel,node_case_messages,node_source_requests,node_role_work,node_report_history,node_receipt_rules toneMint
class node_account_admin,node_summary toneRose
class node_users toneIndigo
```

## Components

### Application and access

- [React entry](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/main.tsx): `src/main.tsx`
- [Application workspace](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/Login.tsx): `src/Login.tsx`
- [Access rules](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/access.ts): `src/access.ts`
- [Business operations](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/operations.ts): `src/operations.ts`
- [Domain data types](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/types.ts): `src/types.ts`

### Report intake and analysis

- [Report intake](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportIntake.tsx): `src/ReportIntake.tsx`
- [Report people](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportPeople.tsx): `src/ReportPeople.tsx`
- [Sensitive data controls](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportPrivacy.tsx): `src/ReportPrivacy.tsx`
- [Sensitive value display](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/SensitiveValue.tsx): `src/SensitiveValue.tsx`
- [Link analysis graph](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/LinkGraph.tsx): `src/LinkGraph.tsx`
- [Reception workflow](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReceptionPanel.tsx): `src/ReceptionPanel.tsx`

### Casework and review

- [Casework and reports](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/CaseWorkPanel.tsx): `src/CaseWorkPanel.tsx`
- [Opinions and requests](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/CaseMessages.tsx): `src/CaseMessages.tsx`
- [Source requests](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/SourceRequests.tsx): `src/SourceRequests.tsx`
- [Role workspaces](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/RoleWork.tsx): `src/RoleWork.tsx`
- [Report history](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/ReportHistory.tsx): `src/ReportHistory.tsx`
- [Receipt workflow rules](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/receiptWorkflow.ts): `src/receiptWorkflow.ts`

### Administration and audit

- [Account administration](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/AccountManager.tsx): `src/AccountManager.tsx`
- [Work summary](https://github.com/chungcb4444-alt/scamgraph-demo/blob/H%E1%BB%87-Th%E1%BB%91ng-Truy-V%E1%BA%BFt-Demo/src/WorkSummary.tsx): `src/WorkSummary.tsx`

### Other components

- **Residents and staff**
- **Browser localStorage**

## Connections

- React entry → Application workspace: renders (evidence: `src/main.tsx`)
- Residents and staff → Login: signs in (evidence: `README.md`)
- Login → Application workspace: enters workspace (evidence: `README.md`)
- Application workspace → Access rules: checks access (evidence: `src/App.tsx`)
- Application workspace → Report intake: opens intake (evidence: `src/App.tsx`)
- Application workspace → Reception workflow: routes report work (evidence: `README.md`)
- Residents and staff → Report intake: submits report (evidence: `README.md`)
- Report intake → Reception workflow: creates report for review (evidence: `README.md`)
- Reception workflow → Link analysis graph: hands off for analysis (evidence: `README.md`)
- Application workspace → Link analysis graph: opens link view (evidence: `src/App.tsx`)
- Application workspace → Report people: shows report parties (evidence: `src/App.tsx`)
- Report people → Sensitive value display: renders values (evidence: `src/ReportPeople.tsx`)
- Report people → Sensitive data controls: uses privacy controls (evidence: `src/ReportPeople.tsx`)
- Link analysis graph → Business operations: supports link decisions
- Application workspace → Casework and reports: opens casework (evidence: `src/App.tsx`)
- Casework and reports → Receipt workflow rules: checks receipt status (evidence: `src/CaseWorkPanel.tsx`)
- Casework and reports → Business operations: submits case actions (evidence: `README.md`)
- Casework and reports → Opinions and requests: shows case opinions (evidence: `README.md`)
- Casework and reports → Source requests: handles source requests (evidence: `README.md`)
- Residents and staff → Role workspaces: works by role (evidence: `README.md`)
- Role workspaces → Casework and reports: opens assigned cases (evidence: `README.md`)
- Casework and reports → Report history: preserves report versions (evidence: `README.md`)
- Business operations → Access rules: enforces permissions (evidence: `src/operations.ts`)
- Business operations → Receipt workflow rules: checks receipt rules (evidence: `src/operations.ts`)
- Application workspace → Account administration: opens administration (evidence: `README.md`)
- Account administration → Business operations: submits account changes (evidence: `src/AccountManager.tsx`)
- Application workspace → Work summary: shows work overview (evidence: `src/App.tsx`)
- Application workspace → Browser localStorage: persists application state (evidence: `README.md`)
- Business operations → Domain data types: uses domain records (evidence: `src/operations.ts`)
