# mixro/tang-submeter-project-tracker architecture

> Architecture diagram of the GitHub repository mixro/tang-submeter-project-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mixro/tang-submeter-project-tracker
- Repository: https://github.com/mixro/tang-submeter-project-tracker

## Overview

This is a passcode-gated React tracker for the Digitalized Electrical Meter System project. A visitor submits a passcode, the app checks and persists authentication, then routes authenticated users to a progress overview and phase details. The overview presents progress computed from the eight phase records; phase cards link to detail pages. Theme state is separately persisted in browser storage. The README documents project milestones and capabilities; payment, meter, QA, and rollout are tracked phases, not implemented integrations in this repository. Connections reflect excerpts, the source index, or README statements.

Main entry points: [`src/App.tsx`](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/App.tsx) (Routes and Providers), [`src/pages/Home.tsx`](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/Home.tsx) (Progress Overview), [`src/pages/Login.tsx`](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/Login.tsx) (Passcode Login), [`src/components/icons.tsx`](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/icons.tsx) (SVG Icons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App Runtime"]
  node_entry["React Entry<br/>[main.tsx]"]
  node_app["Routes and Providers<br/>[App.tsx]"]
  node_layout["Protected Layout<br/>[Layout.tsx]"]
  node_icons["SVG Icons<br/>[icons.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
end

subgraph group_access["Access and Preferences"]
  node_auth["Authentication State<br/>[AuthContext.tsx]"]
  node_login["Passcode Login<br/>[Login.tsx]"]
  node_theme["Theme State<br/>[ThemeContext.tsx]"]
  node_theme_toggle["Theme Toggle<br/>[ThemeToggle.tsx]"]
end

subgraph group_tracker["Progress Tracker"]
  node_home["Progress Overview<br/>[Home.tsx]"]
  node_phase_data["Phase Records<br/>[phases.ts]"]
  node_progress["Progress Bar<br/>[ProgressBar.tsx]"]
  node_phase_card["Phase Card<br/>[PhaseCard.tsx]"]
  node_phase_detail["Phase Details<br/>[PhaseDetail.tsx]"]
end

node_visitor(("Visitor"))
node_browser[("Browser Storage")]

node_visitor -->|"submits passcode"| node_login
node_entry -->|"renders"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"provides theme"| node_theme
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_phase_detail
node_login -->|"checks passcode"| node_auth
node_auth -->|"persists auth"| node_browser
node_theme -->|"persists theme"| node_browser
node_login -->|"renders"| node_theme_toggle
node_theme_toggle -->|"toggles theme"| node_theme
node_layout -->|"renders"| node_theme_toggle
node_layout -->|"renders"| node_footer
node_home -->|"reads phases"| node_phase_data
node_home -->|"renders progress"| node_progress
node_home -->|"renders cards"| node_phase_card
node_phase_card -->|"uses phase type"| node_phase_data
node_phase_card -->|"links to"| node_phase_detail
node_phase_detail -->|"finds phase"| node_phase_data
node_login -->|"uses icons"| node_icons
node_home -->|"uses icons"| node_icons
node_phase_card -->|"uses icons"| node_icons
node_phase_detail -->|"uses icons"| node_icons
node_theme_toggle -->|"uses icons"| node_icons

click node_entry "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/main.tsx"
click node_app "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/App.tsx"
click node_layout "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/Layout.tsx"
click node_auth "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/context/AuthContext.tsx"
click node_login "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/Login.tsx"
click node_theme "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/context/ThemeContext.tsx"
click node_theme_toggle "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/ThemeToggle.tsx"
click node_home "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/Home.tsx"
click node_phase_data "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/data/phases.ts"
click node_progress "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/ProgressBar.tsx"
click node_phase_card "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/PhaseCard.tsx"
click node_phase_detail "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/PhaseDetail.tsx"
click node_icons "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/icons.tsx"
click node_footer "https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/Footer.tsx"

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_entry,node_app,node_layout,node_icons,node_footer toneBlue
class node_auth,node_login,node_theme,node_theme_toggle,node_browser toneAmber
class node_home,node_phase_data,node_progress,node_phase_card,node_phase_detail toneMint
class node_visitor toneIndigo
```

## Components

### App Runtime

- [React Entry](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/main.tsx): `src/main.tsx`
- [Routes and Providers](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/App.tsx): `src/App.tsx`
- [Protected Layout](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/Layout.tsx): `src/components/Layout.tsx`
- [SVG Icons](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/icons.tsx): `src/components/icons.tsx`
- [Footer](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`

### Access and Preferences

- [Authentication State](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Passcode Login](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Theme State](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`
- [Theme Toggle](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/ThemeToggle.tsx): `src/components/ThemeToggle.tsx`

### Progress Tracker

- [Progress Overview](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Phase Records](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/data/phases.ts): `src/data/phases.ts`
- [Progress Bar](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/ProgressBar.tsx): `src/components/ProgressBar.tsx`
- [Phase Card](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/components/PhaseCard.tsx): `src/components/PhaseCard.tsx`
- [Phase Details](https://github.com/mixro/tang-submeter-project-tracker/blob/main/src/pages/PhaseDetail.tsx): `src/pages/PhaseDetail.tsx`

### Other components

- **Visitor**
- **Browser Storage**

## Connections

- Visitor → Passcode Login: submits passcode (evidence: `src/pages/Login.tsx`)
- React Entry → Routes and Providers: renders (evidence: `src/main.tsx`)
- Routes and Providers → Authentication State: provides auth (evidence: `src/App.tsx`)
- Routes and Providers → Theme State: provides theme (evidence: `src/App.tsx`)
- Routes and Providers → Passcode Login: routes to (evidence: `src/App.tsx`)
- Routes and Providers → Progress Overview: routes to (evidence: `src/App.tsx`)
- Routes and Providers → Phase Details: routes to (evidence: `src/App.tsx`)
- Passcode Login → Authentication State: checks passcode (evidence: `src/pages/Login.tsx`)
- Authentication State → Browser Storage: persists auth (evidence: `src/context/AuthContext.tsx`)
- Theme State → Browser Storage: persists theme (evidence: `src/context/ThemeContext.tsx`)
- Passcode Login → Theme Toggle: renders (evidence: `src/pages/Login.tsx`)
- Theme Toggle → Theme State: toggles theme (evidence: `src/components/ThemeToggle.tsx`)
- Protected Layout → Theme Toggle: renders (evidence: `src/components/Layout.tsx`)
- Protected Layout → Footer: renders (evidence: `src/components/Layout.tsx`)
- Progress Overview → Phase Records: reads phases (evidence: `src/pages/Home.tsx`)
- Progress Overview → Progress Bar: renders progress (evidence: `src/pages/Home.tsx`)
- Progress Overview → Phase Card: renders cards (evidence: `src/pages/Home.tsx`)
- Phase Card → Phase Records: uses phase type (evidence: `src/components/PhaseCard.tsx`)
- Phase Card → Phase Details: links to (evidence: `src/components/PhaseCard.tsx`)
- Phase Details → Phase Records: finds phase (evidence: `src/pages/PhaseDetail.tsx`)
- Passcode Login → SVG Icons: uses icons (evidence: `src/pages/Login.tsx`)
- Progress Overview → SVG Icons: uses icons (evidence: `src/pages/Home.tsx`)
- Phase Card → SVG Icons: uses icons (evidence: `src/components/PhaseCard.tsx`)
- Phase Details → SVG Icons: uses icons (evidence: `src/pages/PhaseDetail.tsx`)
- Theme Toggle → SVG Icons: uses icons (evidence: `src/components/ThemeToggle.tsx`)
