# cisneros-f/bocadillos architecture

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

- Interactive diagram: https://gitdiagram.com/cisneros-f/bocadillos
- Repository: https://github.com/cisneros-f/bocadillos

## Overview

Bocatas is a browser-based sandwich-ordering app with a team ordering view and an administrator view. Users load their team’s daily menu, place or update an order, and see unpaid balances; administrators manage whether ordering is open, mark orders paid, and collect outstanding balances. Both views send actions through the app’s API caller. A service worker caches the app shell for offline launch, while order data remains network-only. The excerpts show the client-side workflows, but not the backend implementation or the HTML wiring.

Main entry points: [`app.js`](https://github.com/cisneros-f/bocadillos/blob/main/app.js) (Team order view), [`sw.js`](https://github.com/cisneros-f/bocadillos/blob/main/sw.js) (Service worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ordering["Team ordering"]
  node_team_view["Team order view<br/>[app.js]"]
  node_team_state[("Team code and name<br/>[app.js]")]
  node_daily_menu["Daily menu and order<br/>[app.js]"]
  node_balances["Unpaid balances<br/>[app.js]"]
end

subgraph group_admin["Administration"]
  node_admin_view["Admin dashboard<br/>[app.js]"]
  node_order_controls["Order controls<br/>[app.js]"]
  node_payment_tracking["Payment tracking<br/>[app.js]"]
end

subgraph group_runtime["App runtime"]
  node_api_transport["API caller<br/>[app.js]"]
  node_service_worker["Service worker<br/>[sw.js]"]
  node_app_shell["Cached app shell<br/>[sw.js]"]
end

node_team(("Team member"))
node_admin_user(("Administrator"))
node_apps_script{{"Apps Script API"}}
node_browser_storage[("Browser local storage")]

node_team -->|"uses"| node_team_view
node_team_view -->|"loads code"| node_team_state
node_team_view -->|"renders"| node_daily_menu
node_team_view -->|"requests data"| node_api_transport
node_team_view -->|"submits order"| node_api_transport
node_team_view -->|"renders"| node_balances
node_team_state -->|"reads and writes"| node_browser_storage
node_admin_user -->|"uses"| node_admin_view
node_admin_view -->|"loads dashboard"| node_api_transport
node_admin_view -->|"dispatches actions"| node_order_controls
node_admin_view -->|"dispatches actions"| node_payment_tracking
node_admin_view -->|"reads code"| node_browser_storage
node_order_controls -->|"sends actions"| node_api_transport
node_payment_tracking -->|"sends actions"| node_api_transport
node_api_transport -->|"posts actions"| node_apps_script
node_service_worker -->|"caches assets"| node_app_shell
node_team_view -->|"registers"| node_service_worker

click node_team_view "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_team_state "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_daily_menu "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_balances "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_admin_view "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_order_controls "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_payment_tracking "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_api_transport "https://github.com/cisneros-f/bocadillos/blob/main/app.js"
click node_service_worker "https://github.com/cisneros-f/bocadillos/blob/main/sw.js"
click node_app_shell "https://github.com/cisneros-f/bocadillos/blob/main/sw.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_team_view,node_team_state,node_daily_menu,node_balances toneBlue
class node_admin_view,node_order_controls,node_payment_tracking,node_browser_storage toneAmber
class node_api_transport,node_service_worker,node_app_shell,node_apps_script toneMint
class node_team,node_admin_user toneIndigo
```

## Components

### Team ordering

- [Team order view](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`
- [Team code and name](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`
- [Daily menu and order](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`
- [Unpaid balances](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`

### Administration

- [Admin dashboard](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`
- [Order controls](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`
- [Payment tracking](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`

### App runtime

- [API caller](https://github.com/cisneros-f/bocadillos/blob/main/app.js): `app.js`
- [Service worker](https://github.com/cisneros-f/bocadillos/blob/main/sw.js): `sw.js`
- [Cached app shell](https://github.com/cisneros-f/bocadillos/blob/main/sw.js): `sw.js`

### Other components

- **Team member**
- **Administrator**
- **Apps Script API**
- **Browser local storage**

## Connections

- Team member → Team order view: uses (evidence: `app.js`)
- Team order view → Team code and name: loads code (evidence: `app.js`)
- Team order view → Daily menu and order: renders (evidence: `app.js`)
- Team order view → API caller: requests data (evidence: `app.js`)
- Team order view → API caller: submits order (evidence: `app.js`)
- Team order view → Unpaid balances: renders (evidence: `app.js`)
- Team code and name → Browser local storage: reads and writes (evidence: `app.js`)
- Administrator → Admin dashboard: uses (evidence: `app.js`)
- Admin dashboard → API caller: loads dashboard (evidence: `app.js`)
- Admin dashboard → Order controls: dispatches actions (evidence: `app.js`)
- Admin dashboard → Payment tracking: dispatches actions (evidence: `app.js`)
- Admin dashboard → Browser local storage: reads code (evidence: `app.js`)
- Order controls → API caller: sends actions (evidence: `app.js`)
- Payment tracking → API caller: sends actions (evidence: `app.js`)
- API caller → Apps Script API: posts actions (evidence: `app.js`)
- Service worker → Cached app shell: caches assets (evidence: `sw.js`)
- Team order view → Service worker: registers (evidence: `app.js`)
