# bathri-x/chess-work-manager1 architecture

> Architecture diagram of the GitHub repository bathri-x/chess-work-manager1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bathri-x/chess-work-manager1
- Repository: https://github.com/bathri-x/chess-work-manager1

## Overview

My Chess Work Manager is a chess-coaching PWA for recording classes and demos, reviewing teaching activity, and sharing daily reports. Coaches enter or edit batches in the dashboard; the app maintains local data and optionally syncs authenticated users with Supabase. From there, date navigation, history search, statistics, and report generation support review and sharing, while protected deletion, account/configuration flows, offline indicators, and PWA installation provide supporting capabilities. The main app and utility relationships are supported by the excerpts and source index; backend endpoint details are documented but not shown in source excerpts.

Main entry points: [`src/App.tsx`](https://github.com/bathri-x/chess-work-manager1/blob/main/src/App.tsx) (Work Dashboard), [`src/lib/storage.ts`](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/storage.ts) (Batch Storage), [`src/lib/supabase.ts`](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/supabase.ts) (Supabase Client), [`src/components/DailyReportSection.tsx`](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DailyReportSection.tsx) (Daily Report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_work["Class Tracking"]
  node_dashboard["Work Dashboard<br/>[App.tsx]"]
  node_batchform["Batch Editor<br/>[BatchModal.tsx]"]
  node_batchcard["Batch Card<br/>[BatchCard.tsx]"]
  node_dates["Date Navigation<br/>[DateNavigation.tsx]"]
  node_themes["Weekday Themes<br/>[themes.ts]"]
end

subgraph group_review["Review And Reports"]
  node_history["History Search"]
  node_stats["Teaching Statistics<br/>[StatsTracker.tsx]"]
  node_dailyreport["Daily Report"]
  node_reportutils["Report Utilities<br/>[reportUtils.ts]"]
end

subgraph group_persistence["Storage And Sync"]
  node_storage["Batch Storage<br/>[storage.ts]"]
  node_localstore[("Browser Storage<br/>[storage.ts]")]
  node_supabaseclient["Supabase Client<br/>[supabase.ts]"]
  node_supabase[("Supabase Database")]
end

subgraph group_identity["Account And Security"]
  node_authmodal["Authentication<br/>[AuthModal.tsx]"]
  node_setupmodal["Cloud Setup"]
  node_deletepin["Delete PIN Prompt<br/>[DeletePinModal.tsx]"]
  node_backend["Backend Endpoints<br/>[server.ts]"]
end

subgraph group_experience["Offline And Install"]
  node_offline["Offline Status"]
  node_install["PWA Install"]
  node_installhook["Install Detection<br/>[usePWAInstall.ts]"]
end

node_coach(("Chess Coach"))
node_whatsapp(("WhatsApp"))

node_coach -->|"records classes"| node_dashboard
node_dashboard -->|"opens editor"| node_batchform
node_dashboard -->|"shows batches"| node_batchcard
node_dashboard -->|"navigates dates"| node_dates
node_dashboard -->|"uses weekday themes"| node_themes
node_dashboard -->|"opens history"| node_history
node_dashboard -->|"shows statistics"| node_stats
node_dashboard -->|"shows report"| node_dailyreport
node_dailyreport -->|"generates report"| node_reportutils
node_reportutils -->|"shares report"| node_whatsapp
node_dashboard -->|"saves batches"| node_storage
node_storage -->|"caches batches"| node_localstore
node_storage -->|"uses client"| node_supabaseclient
node_supabaseclient -.->|"syncs remotely"| node_supabase
node_dashboard -->|"opens sign-in"| node_authmodal
node_dashboard -->|"opens setup"| node_setupmodal
node_setupmodal -->|"tests connection"| node_supabaseclient
node_dashboard -->|"requests deletion"| node_deletepin
node_deletepin -.->|"verifies PIN"| node_backend
node_storage -->|"requests deletion"| node_backend
node_dashboard -->|"shows status"| node_offline
node_dashboard -->|"offers install"| node_install
node_install -->|"uses install hook"| node_installhook

click node_dashboard "https://github.com/bathri-x/chess-work-manager1/blob/main/src/App.tsx"
click node_batchform "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/BatchModal.tsx"
click node_batchcard "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/BatchCard.tsx"
click node_dates "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DateNavigation.tsx"
click node_themes "https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/themes.ts"
click node_history "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/HistorySearchModal.tsx"
click node_stats "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/StatsTracker.tsx"
click node_dailyreport "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DailyReportSection.tsx"
click node_reportutils "https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/reportUtils.ts"
click node_storage "https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/storage.ts"
click node_localstore "https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/storage.ts"
click node_supabaseclient "https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/supabase.ts"
click node_authmodal "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/AuthModal.tsx"
click node_setupmodal "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/SupabaseSetupModal.tsx"
click node_deletepin "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DeletePinModal.tsx"
click node_backend "https://github.com/bathri-x/chess-work-manager1/blob/main/server.ts"
click node_offline "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/OfflineIndicator.tsx"
click node_install "https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/PWAInstallButton.tsx"
click node_installhook "https://github.com/bathri-x/chess-work-manager1/blob/main/src/hooks/usePWAInstall.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_dashboard,node_batchform,node_batchcard,node_dates,node_themes toneBlue
class node_history,node_stats,node_dailyreport,node_reportutils toneAmber
class node_storage,node_localstore,node_supabaseclient,node_supabase toneMint
class node_authmodal,node_setupmodal,node_deletepin,node_backend toneRose
class node_offline,node_install,node_installhook,node_coach,node_whatsapp toneIndigo
```

## Components

### Class Tracking

- [Work Dashboard](https://github.com/bathri-x/chess-work-manager1/blob/main/src/App.tsx): `src/App.tsx`
- [Batch Editor](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/BatchModal.tsx): `src/components/BatchModal.tsx`
- [Batch Card](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/BatchCard.tsx): `src/components/BatchCard.tsx`
- [Date Navigation](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DateNavigation.tsx): `src/components/DateNavigation.tsx`
- [Weekday Themes](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/themes.ts): `src/lib/themes.ts`

### Review And Reports

- [History Search](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/HistorySearchModal.tsx): `src/components/HistorySearchModal.tsx`
- [Teaching Statistics](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/StatsTracker.tsx): `src/components/StatsTracker.tsx`
- [Daily Report](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DailyReportSection.tsx): `src/components/DailyReportSection.tsx`
- [Report Utilities](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/reportUtils.ts): `src/lib/reportUtils.ts`

### Storage And Sync

- [Batch Storage](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Browser Storage](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Supabase Client](https://github.com/bathri-x/chess-work-manager1/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase Database**

### Account And Security

- [Authentication](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Cloud Setup](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/SupabaseSetupModal.tsx): `src/components/SupabaseSetupModal.tsx`
- [Delete PIN Prompt](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/DeletePinModal.tsx): `src/components/DeletePinModal.tsx`
- [Backend Endpoints](https://github.com/bathri-x/chess-work-manager1/blob/main/server.ts): `server.ts`

### Offline And Install

- [Offline Status](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/OfflineIndicator.tsx): `src/components/OfflineIndicator.tsx`
- [PWA Install](https://github.com/bathri-x/chess-work-manager1/blob/main/src/components/PWAInstallButton.tsx): `src/components/PWAInstallButton.tsx`
- [Install Detection](https://github.com/bathri-x/chess-work-manager1/blob/main/src/hooks/usePWAInstall.ts): `src/hooks/usePWAInstall.ts`

### Other components

- **Chess Coach**
- **WhatsApp**

## Connections

- Chess Coach → Work Dashboard: records classes (evidence: `README.md`)
- Work Dashboard → Batch Editor: opens editor (evidence: `src/App.tsx`)
- Work Dashboard → Batch Card: shows batches (evidence: `src/App.tsx`)
- Work Dashboard → Date Navigation: navigates dates (evidence: `src/App.tsx`)
- Work Dashboard → Weekday Themes: uses weekday themes (evidence: `src/App.tsx`)
- Work Dashboard → History Search: opens history (evidence: `src/App.tsx`)
- Work Dashboard → Teaching Statistics: shows statistics (evidence: `src/App.tsx`)
- Work Dashboard → Daily Report: shows report (evidence: `src/App.tsx`)
- Daily Report → Report Utilities: generates report (evidence: `src/components/DailyReportSection.tsx`)
- Report Utilities → WhatsApp: shares report (evidence: `src/lib/reportUtils.ts`)
- Work Dashboard → Batch Storage: saves batches (evidence: `src/App.tsx`)
- Batch Storage → Browser Storage: caches batches (evidence: `src/lib/storage.ts`)
- Batch Storage → Supabase Client: uses client (evidence: `src/lib/storage.ts`)
- Supabase Client → Supabase Database: syncs remotely
- Work Dashboard → Authentication: opens sign-in (evidence: `src/App.tsx`)
- Work Dashboard → Cloud Setup: opens setup (evidence: `src/App.tsx`)
- Cloud Setup → Supabase Client: tests connection (evidence: `src/components/SupabaseSetupModal.tsx`)
- Work Dashboard → Delete PIN Prompt: requests deletion (evidence: `src/App.tsx`)
- Delete PIN Prompt → Backend Endpoints: verifies PIN (evidence: `README.md`)
- Batch Storage → Backend Endpoints: requests deletion (evidence: `src/lib/storage.ts`)
- Work Dashboard → Offline Status: shows status (evidence: `src/App.tsx`)
- Work Dashboard → PWA Install: offers install (evidence: `README.md`)
- PWA Install → Install Detection: uses install hook (evidence: `src/components/PWAInstallButton.tsx`)
