# clarencelanaria/laundrymatic architecture

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

- Interactive diagram: https://gitdiagram.com/clarencelanaria/laundrymatic
- Repository: https://github.com/clarencelanaria/laundrymatic

## Overview

LaundryMatic combines a laundry-shop admin dashboard, a customer app, and a scale-to-cloud weighing path. The principal shop workflow sends scale readings through Arduino and a Node.js bridge to Firebase, where the dashboard can use live weight to create and manage customer orders; the customer app supports registration, QR identification, tracking, and notifications. Dashboard subfeatures are documented but concentrated in one large web module. Some links below rely on README-level descriptions because web and hardware implementation excerpts were not provided.

Main entry points: [`LaundryMatic_Mobile/app/login.jsx`](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/login.jsx) (Customer access), [`LaundryMatic_Mobile/app/dashboard.jsx`](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/dashboard.jsx) (Order dashboard), [`laundrymatic/public/app.js`](https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/app.js) (Admin dashboard), [`LaundryMatic_Mobile/app/index.jsx`](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/index.jsx) (Session routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scale["Scale ingestion"]
  node_loadcell(("Load cell"))
  node_arduino["Scale firmware<br/>[DIGI_LWS.ino]"]
  node_bridge["Serial bridge<br/>[bridge.js]"]
end

subgraph group_admin["Shop administration"]
  node_webdashboard["Admin dashboard<br/>[app.js]"]
  node_webpages["Admin pages<br/>[dashboard.html]"]
  node_webauth["Admin authentication<br/>[auth.js]"]
  node_superadmin["Admin approvals<br/>[superadmin.js]"]
end

subgraph group_mobile["Customer app"]
  node_mobileauth["Customer access<br/>[login.jsx]"]
  node_registration["Customer registration<br/>[register.jsx]"]
  node_agreements["Terms and privacy<br/>[terms.jsx]"]
  node_mobileentry["Session routing<br/>[index.jsx]"]
  node_tracking["Order dashboard<br/>[dashboard.jsx]"]
  node_customerqr["Customer QR<br/>[showQR.jsx]"]
  node_notifications["Customer notifications<br/>[notifications.jsx]"]
  node_authwidgets["Auth controls<br/>[AuthButton.jsx]"]
  node_authinput["Auth fields<br/>[AuthInput.jsx]"]
  node_colors["Design tokens<br/>[colors.js]"]
  node_mobiledata["Mobile data access<br/>[firebase.js]"]
  node_pushhelper["Notification support<br/>[notifications.js]"]
  node_remembered["Remembered email<br/>[storage.js]"]
end

subgraph group_cloud["Firebase services"]
  node_firebase[("Firebase Auth and Realtime DB")]
end

node_shopstaff(("Shop staff"))
node_adminactor(("Administrator"))
node_superactor(("Super admin"))
node_customer(("Customer"))

node_loadcell -->|"senses weight"| node_arduino
node_arduino -->|"sends serial data"| node_bridge
node_bridge -->|"uploads weight"| node_firebase
node_firebase -->|"provides live weight"| node_webdashboard
node_adminactor -->|"registers or logs in"| node_webauth
node_webauth -->|"uses authentication"| node_firebase
node_adminactor -->|"manages shop"| node_webdashboard
node_webdashboard -->|"manages orders and records"| node_firebase
node_webdashboard -.->|"presents dashboard"| node_webpages
node_superactor -->|"reviews admins"| node_superadmin
node_superadmin -->|"approves or rejects"| node_firebase
node_customer -->|"signs in"| node_mobileauth
node_customer -->|"registers"| node_registration
node_registration -->|"creates account and profile"| node_firebase
node_mobileauth -->|"stores remembered email"| node_remembered
node_mobileauth -->|"authenticates"| node_firebase
node_mobileentry -->|"checks session and agreements"| node_firebase
node_mobileentry -->|"routes verified customers"| node_tracking
node_mobileentry -->|"routes incomplete agreements"| node_agreements
node_agreements -->|"records acceptance"| node_firebase
node_tracking -->|"loads profile and orders"| node_mobiledata
node_mobiledata -->|"reads customer data"| node_firebase
node_tracking -->|"shows customer QR"| node_customerqr
node_tracking -->|"uses notification support"| node_pushhelper
node_pushhelper -->|"listens and saves tokens"| node_firebase
node_customer -->|"views updates"| node_notifications
node_notifications -->|"reads and marks notifications"| node_pushhelper
node_mobileauth -->|"renders controls"| node_authwidgets
node_mobileauth -->|"renders fields"| node_authinput
node_authwidgets -->|"uses tokens"| node_colors
node_authinput -->|"uses tokens"| node_colors
node_mobiledata -->|"reads and writes data"| node_firebase

click node_arduino "https://github.com/clarencelanaria/laundrymatic/blob/master/Arduino/DIGI_LWS/DIGI_LWS.ino"
click node_bridge "https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic-bridge/bridge.js"
click node_webdashboard "https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/app.js"
click node_webpages "https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/dashboard.html"
click node_webauth "https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/auth.js"
click node_superadmin "https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/superadmin.js"
click node_mobileauth "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/login.jsx"
click node_registration "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/register.jsx"
click node_agreements "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/terms.jsx"
click node_mobileentry "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/index.jsx"
click node_tracking "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/dashboard.jsx"
click node_customerqr "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/showQR.jsx"
click node_notifications "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/notifications.jsx"
click node_authwidgets "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/components/AuthButton.jsx"
click node_authinput "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/components/AuthInput.jsx"
click node_colors "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/constants/colors.js"
click node_mobiledata "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/utils/firebase.js"
click node_pushhelper "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/utils/notifications.js"
click node_remembered "https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/utils/storage.js"

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_loadcell,node_arduino,node_bridge toneBlue
class node_webdashboard,node_webpages,node_webauth,node_superadmin toneAmber
class node_mobileauth,node_registration,node_agreements,node_mobileentry,node_tracking,node_customerqr,node_notifications,node_authwidgets,node_authinput,node_colors,node_mobiledata,node_pushhelper,node_remembered toneMint
class node_firebase toneRose
class node_shopstaff,node_adminactor,node_superactor,node_customer toneIndigo
```

## Components

### Scale ingestion

- **Load cell**
- [Scale firmware](https://github.com/clarencelanaria/laundrymatic/blob/master/Arduino/DIGI_LWS/DIGI_LWS.ino): `Arduino/DIGI_LWS/DIGI_LWS.ino`
- [Serial bridge](https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic-bridge/bridge.js): `laundrymatic-bridge/bridge.js`

### Shop administration

- [Admin dashboard](https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/app.js): `laundrymatic/public/app.js`
- [Admin pages](https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/dashboard.html): `laundrymatic/public/dashboard.html`
- [Admin authentication](https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/auth.js): `laundrymatic/public/auth.js`
- [Admin approvals](https://github.com/clarencelanaria/laundrymatic/blob/master/laundrymatic/public/superadmin.js): `laundrymatic/public/superadmin.js`

### Customer app

- [Customer access](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/login.jsx): `LaundryMatic_Mobile/app/login.jsx`
- [Customer registration](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/register.jsx): `LaundryMatic_Mobile/app/register.jsx`
- [Terms and privacy](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/terms.jsx): `LaundryMatic_Mobile/app/terms.jsx`
- [Session routing](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/index.jsx): `LaundryMatic_Mobile/app/index.jsx`
- [Order dashboard](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/dashboard.jsx): `LaundryMatic_Mobile/app/dashboard.jsx`
- [Customer QR](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/showQR.jsx): `LaundryMatic_Mobile/app/showQR.jsx`
- [Customer notifications](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/app/notifications.jsx): `LaundryMatic_Mobile/app/notifications.jsx`
- [Auth controls](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/components/AuthButton.jsx): `LaundryMatic_Mobile/components/AuthButton.jsx`
- [Auth fields](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/components/AuthInput.jsx): `LaundryMatic_Mobile/components/AuthInput.jsx`
- [Design tokens](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/constants/colors.js): `LaundryMatic_Mobile/constants/colors.js`
- [Mobile data access](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/utils/firebase.js): `LaundryMatic_Mobile/utils/firebase.js`
- [Notification support](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/utils/notifications.js): `LaundryMatic_Mobile/utils/notifications.js`
- [Remembered email](https://github.com/clarencelanaria/laundrymatic/blob/master/LaundryMatic_Mobile/utils/storage.js): `LaundryMatic_Mobile/utils/storage.js`

### Firebase services

- **Firebase Auth and Realtime DB**

### Other components

- **Shop staff**
- **Administrator**
- **Super admin**
- **Customer**

## Connections

- Load cell → Scale firmware: senses weight (evidence: `README.md`)
- Scale firmware → Serial bridge: sends serial data (evidence: `README.md`)
- Serial bridge → Firebase Auth and Realtime DB: uploads weight (evidence: `README.md`)
- Firebase Auth and Realtime DB → Admin dashboard: provides live weight (evidence: `README.md`)
- Administrator → Admin authentication: registers or logs in (evidence: `README.md`)
- Admin authentication → Firebase Auth and Realtime DB: uses authentication (evidence: `README.md`)
- Administrator → Admin dashboard: manages shop (evidence: `README.md`)
- Admin dashboard → Firebase Auth and Realtime DB: manages orders and records (evidence: `README.md`)
- Admin dashboard → Admin pages: presents dashboard
- Super admin → Admin approvals: reviews admins (evidence: `README.md`)
- Admin approvals → Firebase Auth and Realtime DB: approves or rejects (evidence: `README.md`)
- Customer → Customer access: signs in (evidence: `LaundryMatic_Mobile/app/login.jsx`)
- Customer → Customer registration: registers (evidence: `LaundryMatic_Mobile/app/register.jsx`)
- Customer registration → Firebase Auth and Realtime DB: creates account and profile (evidence: `LaundryMatic_Mobile/app/register.jsx`)
- Customer access → Remembered email: stores remembered email (evidence: `LaundryMatic_Mobile/app/login.jsx`)
- Customer access → Firebase Auth and Realtime DB: authenticates (evidence: `LaundryMatic_Mobile/app/login.jsx`)
- Session routing → Firebase Auth and Realtime DB: checks session and agreements (evidence: `LaundryMatic_Mobile/app/index.jsx`)
- Session routing → Order dashboard: routes verified customers (evidence: `LaundryMatic_Mobile/app/index.jsx`)
- Session routing → Terms and privacy: routes incomplete agreements (evidence: `LaundryMatic_Mobile/app/index.jsx`)
- Terms and privacy → Firebase Auth and Realtime DB: records acceptance (evidence: `LaundryMatic_Mobile/app/terms.jsx`)
- Order dashboard → Mobile data access: loads profile and orders (evidence: `LaundryMatic_Mobile/app/dashboard.jsx`)
- Mobile data access → Firebase Auth and Realtime DB: reads customer data (evidence: `LaundryMatic_Mobile/utils/firebase.js`)
- Order dashboard → Customer QR: shows customer QR (evidence: `LaundryMatic_Mobile/app/dashboard.jsx`)
- Order dashboard → Notification support: uses notification support (evidence: `LaundryMatic_Mobile/app/dashboard.jsx`)
- Notification support → Firebase Auth and Realtime DB: listens and saves tokens (evidence: `LaundryMatic_Mobile/utils/notifications.js`)
- Customer → Customer notifications: views updates (evidence: `README.md`)
- Customer notifications → Notification support: reads and marks notifications (evidence: `LaundryMatic_Mobile/utils/notifications.js`)
- Customer access → Auth controls: renders controls (evidence: `LaundryMatic_Mobile/app/login.jsx`)
- Customer access → Auth fields: renders fields (evidence: `LaundryMatic_Mobile/app/login.jsx`)
- Auth controls → Design tokens: uses tokens (evidence: `LaundryMatic_Mobile/components/AuthButton.jsx`)
- Auth fields → Design tokens: uses tokens (evidence: `LaundryMatic_Mobile/components/AuthInput.jsx`)
- Mobile data access → Firebase Auth and Realtime DB: reads and writes data (evidence: `LaundryMatic_Mobile/utils/firebase.js`)
