# david-gy/mea-id architecture

> Architecture diagram of the GitHub repository david-gy/mea-id, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/david-gy/mea-id
- Repository: https://github.com/david-gy/mea-id

## Overview

MEA App is a static, mobile-first PWA for ID operations, room inventory, and a sheet-backed SUS Dashboard. Users sign in and use the ID Tracker to look up or operate on IDs; inventory users browse items and submit orders; authorized Admin/Dashboard users load normalized tracker data for totals, project rosters, readiness, and activity. Google Sheets are the shared stores, accessed through separate tracker and inventory Apps Script backends. Dashboard details are supported by the README and sampled client/model code; the Apps Script and inventory backend wiring is documented but not fully sampled.

Main entry points: [`index.html`](https://github.com/david-gy/mea-id/blob/main/index.html) (PWA shell), [`apps-script/sus-dashboard-reference.gs`](https://github.com/david-gy/mea-id/blob/main/apps-script/sus-dashboard-reference.gs) (Tracker API), [`dashboard.js`](https://github.com/david-gy/mea-id/blob/main/dashboard.js) (Dashboard client), [`id-tracker.html`](https://github.com/david-gy/mea-id/blob/main/id-tracker.html) (ID Tracker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pwa["PWA and Tracker"]
  node_pwa_shell["PWA shell<br/>[index.html]"]
  node_tracker_ui["ID Tracker<br/>[id-tracker.html]"]
  node_app_logic["App logic<br/>[inventory.js]"]
  node_service_worker["Offline shell<br/>[sw.js]"]
end

subgraph group_inventory["Room Inventory"]
  node_inventory_ui["Inventory catalog<br/>[index.html]"]
  node_inventory_logic["Inventory and orders<br/>[inventory.js]"]
end

subgraph group_dashboard["SUS Dashboard"]
  node_dashboard_ui["Dashboard and activity views<br/>[index.html]"]
  node_dashboard_client["Dashboard client<br/>[dashboard.js]"]
  node_dashboard_model["Normalization and metrics<br/>[dashboard-model.js]"]
  node_dashboard_rules["Readiness rules<br/>[dashboard-rules.js]"]
end

subgraph group_backends["Sheet Backends"]
  node_inventory_backend["Inventory backend"]
  node_inventory_sheets[("Inventory sheets")]
  node_tracker_backend["Tracker API"]
  node_tracker_sheets[("Tracker sheets")]
end

node_user(("App user"))

node_user -->|"opens"| node_pwa_shell
node_pwa_shell -->|"displays"| node_tracker_ui
node_pwa_shell -->|"displays"| node_inventory_ui
node_pwa_shell -->|"displays"| node_dashboard_ui
node_tracker_ui -->|"uses"| node_app_logic
node_inventory_ui -->|"uses"| node_inventory_logic
node_inventory_logic -->|"requests inventory and orders"| node_inventory_backend
node_inventory_backend -->|"reads and writes"| node_inventory_sheets
node_dashboard_ui -->|"uses"| node_dashboard_client
node_dashboard_client -->|"requests dashboard data and activity"| node_tracker_backend
node_dashboard_client -->|"normalizes and derives"| node_dashboard_model
node_dashboard_model -->|"applies rules"| node_dashboard_rules
node_tracker_backend -->|"reads tracker data"| node_tracker_sheets
node_tracker_backend -->|"records activity"| node_tracker_sheets
node_app_logic -->|"looks up and tracks IDs"| node_tracker_backend
node_service_worker -->|"caches shell fallback"| node_pwa_shell

click node_pwa_shell "https://github.com/david-gy/mea-id/blob/main/index.html"
click node_tracker_ui "https://github.com/david-gy/mea-id/blob/main/id-tracker.html"
click node_app_logic "https://github.com/david-gy/mea-id/blob/main/inventory.js"
click node_service_worker "https://github.com/david-gy/mea-id/blob/main/sw.js"
click node_inventory_ui "https://github.com/david-gy/mea-id/blob/main/index.html"
click node_inventory_logic "https://github.com/david-gy/mea-id/blob/main/inventory.js"
click node_inventory_backend "https://github.com/david-gy/mea-id/tree/main/apps-script"
click node_dashboard_ui "https://github.com/david-gy/mea-id/blob/main/index.html"
click node_dashboard_client "https://github.com/david-gy/mea-id/blob/main/dashboard.js"
click node_dashboard_model "https://github.com/david-gy/mea-id/blob/main/dashboard-model.js"
click node_dashboard_rules "https://github.com/david-gy/mea-id/blob/main/dashboard-rules.js"
click node_tracker_backend "https://github.com/david-gy/mea-id/blob/main/apps-script/sus-dashboard-reference.gs"

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_pwa_shell,node_tracker_ui,node_app_logic,node_service_worker,node_user toneBlue
class node_inventory_ui,node_inventory_logic toneAmber
class node_dashboard_ui,node_dashboard_client,node_dashboard_model,node_dashboard_rules toneMint
class node_inventory_backend,node_inventory_sheets,node_tracker_backend,node_tracker_sheets toneRose
```

## Components

### PWA and Tracker

- [PWA shell](https://github.com/david-gy/mea-id/blob/main/index.html): `index.html`
- [ID Tracker](https://github.com/david-gy/mea-id/blob/main/id-tracker.html): `id-tracker.html`
- [App logic](https://github.com/david-gy/mea-id/blob/main/inventory.js): `inventory.js`
- [Offline shell](https://github.com/david-gy/mea-id/blob/main/sw.js): `sw.js`

### Room Inventory

- [Inventory catalog](https://github.com/david-gy/mea-id/blob/main/index.html): `index.html`
- [Inventory and orders](https://github.com/david-gy/mea-id/blob/main/inventory.js): `inventory.js`

### SUS Dashboard

- [Dashboard and activity views](https://github.com/david-gy/mea-id/blob/main/index.html): `index.html`
- [Dashboard client](https://github.com/david-gy/mea-id/blob/main/dashboard.js): `dashboard.js`
- [Normalization and metrics](https://github.com/david-gy/mea-id/blob/main/dashboard-model.js): `dashboard-model.js`
- [Readiness rules](https://github.com/david-gy/mea-id/blob/main/dashboard-rules.js): `dashboard-rules.js`

### Sheet Backends

- [Inventory backend](https://github.com/david-gy/mea-id/tree/main/apps-script): `apps-script`
- **Inventory sheets**
- [Tracker API](https://github.com/david-gy/mea-id/blob/main/apps-script/sus-dashboard-reference.gs): `apps-script/sus-dashboard-reference.gs`
- **Tracker sheets**

### Other components

- **App user**

## Connections

- App user → PWA shell: opens
- PWA shell → ID Tracker: displays
- PWA shell → Inventory catalog: displays
- PWA shell → Dashboard and activity views: displays
- ID Tracker → App logic: uses
- Inventory catalog → Inventory and orders: uses
- Inventory and orders → Inventory backend: requests inventory and orders
- Inventory backend → Inventory sheets: reads and writes
- Dashboard and activity views → Dashboard client: uses
- Dashboard client → Tracker API: requests dashboard data and activity
- Dashboard client → Normalization and metrics: normalizes and derives
- Normalization and metrics → Readiness rules: applies rules
- Tracker API → Tracker sheets: reads tracker data
- Tracker API → Tracker sheets: records activity
- App logic → Tracker API: looks up and tracks IDs
- Offline shell → PWA shell: caches shell fallback
