# cheerc/talented-easyorder architecture

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

- Interactive diagram: https://gitdiagram.com/cheerc/talented-easyorder
- Repository: https://github.com/cheerc/talented-easyorder

## Overview

Talented EasyOrder is a React-based cloud dinner-counter POS backed by Firebase; the README says production accounting operations are not yet open. Its main workflow is operator sign-in and single-user lease acquisition, followed by counter/admin work such as orders, student and vendor maintenance, and day close, with ledger and report views. Typed cloud commands and Firestore repositories provide the internal command and persistence layers. The graph preserves documented product areas, but several page-to-repository links are not visible in the sampled excerpts and are marked unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/App.tsx) (App navigation), [`frontend/src/firebase/cloudCommandRepository.ts`](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudCommandRepository.ts) (Command repository), [`frontend/src/firebase/cloudDayCloseRepository.ts`](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudDayCloseRepository.ts) (Day close repository), [`frontend/src/firebase/cloudOrderRepository.ts`](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudOrderRepository.ts) (Order repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_main["Application startup<br/>[main.tsx]"]
  node_app_ui["App navigation<br/>[App.tsx]"]
  node_firebase_provider["Firebase session and lease"]
  node_auth_gate["Operator sign-in gate<br/>[AuthGate.tsx]"]
  node_auth_service["Authentication service<br/>[authService.ts]"]
  node_lease["Active account lease"]
end

subgraph group_operations["Counter operations"]
  node_orders_page["Orders counter"]
  node_students_page["Student management"]
  node_vendors_page["Day vendors"]
  node_orders_repo["Order repository"]
  node_student_repo["Student repository"]
  node_vendor_repo["Day vendor repository"]
end

subgraph group_accounting["Day close and reports"]
  node_close_page["Day close"]
  node_report_page["Reports and ledger"]
  node_ledger_hook["Ledger snapshot hook<br/>[useCloudLedger.ts]"]
  node_close_repo["Day close repository"]
  node_ledger_report["Ledger report logic"]
end

subgraph group_data["Commands and data"]
  node_command_repo["Command repository"]
  node_command_schema["Command validation and schema"]
  node_commands["Business command types<br/>[cloudCommands.ts]"]
  node_transaction_mutation["Transaction mutations"]
  node_pending_journal[("Pending command journal")]
  node_recovery_reader["Recovery reader"]
end

subgraph group_support["Administration"]
  node_backup_page["Cloud backup"]
  node_diagnostics_page["Cloud diagnostics"]
  node_errors["Error reporting<br/>[errorLogger.ts]"]
end

node_operator(("Operator"))
node_firestore[("Firebase Firestore")]

node_operator -->|"opens app"| node_main
node_main -->|"renders"| node_app_ui
node_app_ui -->|"uses session"| node_firebase_provider
node_app_ui -->|"gates access"| node_auth_gate
node_auth_gate -->|"signs in"| node_auth_service
node_auth_gate -->|"checks lease"| node_lease
node_firebase_provider -->|"subscribes access"| node_auth_service
node_firebase_provider -->|"manages lease"| node_lease
node_auth_service -->|"reads operator"| node_firestore
node_app_ui -->|"routes to"| node_orders_page
node_app_ui -->|"routes to"| node_students_page
node_app_ui -->|"routes to"| node_vendors_page
node_app_ui -->|"routes to"| node_close_page
node_app_ui -->|"routes to"| node_report_page
node_app_ui -->|"routes to"| node_backup_page
node_app_ui -->|"routes to"| node_diagnostics_page
node_orders_page -.->|"uses repository"| node_orders_repo
node_orders_repo -->|"lists students"| node_student_repo
node_orders_repo -->|"reads day vendors"| node_vendor_repo
node_orders_repo -->|"checks backfill"| node_close_repo
node_students_page -.->|"uses repository"| node_student_repo
node_vendors_page -.->|"uses repository"| node_vendor_repo
node_close_page -.->|"uses repository"| node_close_repo
node_report_page -.->|"reads ledger"| node_ledger_hook
node_ledger_hook -->|"reads snapshot"| node_close_repo
node_close_repo -->|"reads day records"| node_firestore
node_close_repo -.->|"uses report logic"| node_ledger_report
node_orders_repo -->|"submits commands"| node_command_repo
node_vendor_repo -->|"uses commands"| node_command_repo
node_close_repo -->|"uses commands"| node_command_repo
node_command_repo -->|"validates input"| node_command_schema
node_command_schema -->|"uses types"| node_commands
node_command_schema -->|"applies mutation"| node_transaction_mutation
node_command_repo -->|"journals pending"| node_pending_journal
node_command_repo -->|"checks recovery"| node_recovery_reader
node_command_repo -->|"commits transaction"| node_firestore
node_main -->|"installs listeners"| node_errors

click node_main "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/main.tsx"
click node_app_ui "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/App.tsx"
click node_firebase_provider "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/providers/FirebaseProvider.tsx"
click node_auth_gate "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/auth/AuthGate.tsx"
click node_auth_service "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/authService.ts"
click node_lease "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/activeAccountLease.ts"
click node_orders_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudOrdersPage.tsx"
click node_students_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudStudentsPage.tsx"
click node_vendors_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudDayVendorsPage.tsx"
click node_orders_repo "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudOrderRepository.ts"
click node_student_repo "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudStudentRepository.ts"
click node_vendor_repo "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudDayVendorRepository.ts"
click node_close_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudDayClosePage.tsx"
click node_report_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudReportPage.tsx"
click node_ledger_hook "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/hooks/useCloudLedger.ts"
click node_close_repo "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudDayCloseRepository.ts"
click node_ledger_report "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudLedgerReport.ts"
click node_command_repo "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudCommandRepository.ts"
click node_command_schema "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudCommandSchema.ts"
click node_commands "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudCommands.ts"
click node_transaction_mutation "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudTransactionMutation.ts"
click node_pending_journal "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudPendingJournal.ts"
click node_recovery_reader "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudRecoveryReader.ts"
click node_backup_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudBackupPage.tsx"
click node_diagnostics_page "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudDiagnosticsPage.tsx"
click node_errors "https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/errors/errorLogger.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_main,node_app_ui,node_firebase_provider,node_auth_gate,node_auth_service,node_lease toneBlue
class node_orders_page,node_students_page,node_vendors_page,node_orders_repo,node_student_repo,node_vendor_repo,node_firestore toneAmber
class node_close_page,node_report_page,node_ledger_hook,node_close_repo,node_ledger_report toneMint
class node_command_repo,node_command_schema,node_commands,node_transaction_mutation,node_pending_journal,node_recovery_reader toneRose
class node_backup_page,node_diagnostics_page,node_errors,node_operator toneIndigo
```

## Components

### App and access

- [Application startup](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [App navigation](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Firebase session and lease](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/providers/FirebaseProvider.tsx): `frontend/src/providers/FirebaseProvider.tsx`
- [Operator sign-in gate](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/auth/AuthGate.tsx): `frontend/src/auth/AuthGate.tsx`
- [Authentication service](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/authService.ts): `frontend/src/firebase/authService.ts`
- [Active account lease](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/activeAccountLease.ts): `frontend/src/firebase/activeAccountLease.ts`

### Counter operations

- [Orders counter](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudOrdersPage.tsx): `frontend/src/components/cloud/CloudOrdersPage.tsx`
- [Student management](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudStudentsPage.tsx): `frontend/src/components/cloud/CloudStudentsPage.tsx`
- [Day vendors](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudDayVendorsPage.tsx): `frontend/src/components/cloud/CloudDayVendorsPage.tsx`
- [Order repository](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudOrderRepository.ts): `frontend/src/firebase/cloudOrderRepository.ts`
- [Student repository](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudStudentRepository.ts): `frontend/src/firebase/cloudStudentRepository.ts`
- [Day vendor repository](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudDayVendorRepository.ts): `frontend/src/firebase/cloudDayVendorRepository.ts`

### Day close and reports

- [Day close](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudDayClosePage.tsx): `frontend/src/components/cloud/CloudDayClosePage.tsx`
- [Reports and ledger](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudReportPage.tsx): `frontend/src/components/cloud/CloudReportPage.tsx`
- [Ledger snapshot hook](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/hooks/useCloudLedger.ts): `frontend/src/hooks/useCloudLedger.ts`
- [Day close repository](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudDayCloseRepository.ts): `frontend/src/firebase/cloudDayCloseRepository.ts`
- [Ledger report logic](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudLedgerReport.ts): `frontend/src/domain/cloudLedgerReport.ts`

### Commands and data

- [Command repository](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudCommandRepository.ts): `frontend/src/firebase/cloudCommandRepository.ts`
- [Command validation and schema](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudCommandSchema.ts): `frontend/src/domain/cloudCommandSchema.ts`
- [Business command types](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudCommands.ts): `frontend/src/domain/cloudCommands.ts`
- [Transaction mutations](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/domain/cloudTransactionMutation.ts): `frontend/src/domain/cloudTransactionMutation.ts`
- [Pending command journal](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudPendingJournal.ts): `frontend/src/firebase/cloudPendingJournal.ts`
- [Recovery reader](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/firebase/cloudRecoveryReader.ts): `frontend/src/firebase/cloudRecoveryReader.ts`

### Administration

- [Cloud backup](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudBackupPage.tsx): `frontend/src/components/cloud/CloudBackupPage.tsx`
- [Cloud diagnostics](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/components/cloud/CloudDiagnosticsPage.tsx): `frontend/src/components/cloud/CloudDiagnosticsPage.tsx`
- [Error reporting](https://github.com/cheerc/talented-easyorder/blob/main/frontend/src/errors/errorLogger.ts): `frontend/src/errors/errorLogger.ts`

### Other components

- **Operator**
- **Firebase Firestore**

## Connections

- Operator → Application startup: opens app (evidence: `frontend/src/main.tsx`)
- Application startup → App navigation: renders (evidence: `frontend/src/main.tsx`)
- App navigation → Firebase session and lease: uses session (evidence: `frontend/src/App.tsx`)
- App navigation → Operator sign-in gate: gates access (evidence: `frontend/src/App.tsx`)
- Operator sign-in gate → Authentication service: signs in (evidence: `frontend/src/auth/AuthGate.tsx`)
- Operator sign-in gate → Active account lease: checks lease (evidence: `frontend/src/auth/AuthGate.tsx`)
- Firebase session and lease → Authentication service: subscribes access (evidence: `frontend/src/providers/FirebaseProvider.tsx`)
- Firebase session and lease → Active account lease: manages lease (evidence: `frontend/src/providers/FirebaseProvider.tsx`)
- Authentication service → Firebase Firestore: reads operator (evidence: `frontend/src/firebase/authService.ts`)
- App navigation → Orders counter: routes to (evidence: `frontend/src/App.tsx`)
- App navigation → Student management: routes to (evidence: `frontend/src/App.tsx`)
- App navigation → Day vendors: routes to (evidence: `frontend/src/App.tsx`)
- App navigation → Day close: routes to (evidence: `frontend/src/App.tsx`)
- App navigation → Reports and ledger: routes to (evidence: `frontend/src/App.tsx`)
- App navigation → Cloud backup: routes to (evidence: `frontend/src/App.tsx`)
- App navigation → Cloud diagnostics: routes to (evidence: `frontend/src/App.tsx`)
- Orders counter → Order repository: uses repository
- Order repository → Student repository: lists students (evidence: `frontend/src/firebase/cloudOrderRepository.ts`)
- Order repository → Day vendor repository: reads day vendors (evidence: `frontend/src/firebase/cloudOrderRepository.ts`)
- Order repository → Day close repository: checks backfill (evidence: `frontend/src/firebase/cloudOrderRepository.ts`)
- Student management → Student repository: uses repository
- Day vendors → Day vendor repository: uses repository
- Day close → Day close repository: uses repository
- Reports and ledger → Ledger snapshot hook: reads ledger
- Ledger snapshot hook → Day close repository: reads snapshot (evidence: `frontend/src/hooks/useCloudLedger.ts`)
- Day close repository → Firebase Firestore: reads day records (evidence: `frontend/src/firebase/cloudDayCloseRepository.ts`)
- Day close repository → Ledger report logic: uses report logic
- Order repository → Command repository: submits commands (evidence: `frontend/src/firebase/cloudOrderRepository.ts`)
- Day vendor repository → Command repository: uses commands (evidence: `frontend/src/firebase/cloudDayVendorRepository.ts`)
- Day close repository → Command repository: uses commands (evidence: `frontend/src/firebase/cloudDayCloseRepository.ts`)
- Command repository → Command validation and schema: validates input (evidence: `frontend/src/firebase/cloudCommandRepository.ts`)
- Command validation and schema → Business command types: uses types (evidence: `frontend/src/domain/cloudCommandSchema.ts`)
- Command validation and schema → Transaction mutations: applies mutation (evidence: `frontend/src/domain/cloudCommandSchema.ts`)
- Command repository → Pending command journal: journals pending (evidence: `frontend/src/firebase/cloudCommandRepository.ts`)
- Command repository → Recovery reader: checks recovery (evidence: `frontend/src/firebase/cloudCommandRepository.ts`)
- Command repository → Firebase Firestore: commits transaction (evidence: `frontend/src/firebase/cloudCommandRepository.ts`)
- Application startup → Error reporting: installs listeners (evidence: `frontend/src/main.tsx`)
