# adithyan0067/cafee architecture

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

- Interactive diagram: https://gitdiagram.com/adithyan0067/cafee
- Repository: https://github.com/adithyan0067/cafee

## Overview

This is a static, browser-only canteen pre-order website. Students register or log in, browse and filter available food, add items to a cart, place pickup orders, and view their order history. Admins use a separate login and dashboard to manage products, branding, and order status. The shared data layer stores users, cart, products, orders, and settings in the current browser; there is no shared backend. Page-to-script assignments and product capabilities follow the README; edges are limited to relationships visible in the excerpts or documented there.

Main entry points: [`data.js`](https://github.com/adithyan0067/cafee/blob/main/data.js) (Storage helpers and defaults), [`admin-login.js`](https://github.com/adithyan0067/cafee/blob/main/admin-login.js) (Admin login logic), [`admin.js`](https://github.com/adithyan0067/cafee/blob/main/admin.js) (Product and order management), [`menu.html`](https://github.com/adithyan0067/cafee/blob/main/menu.html) (Food menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student ordering"]
  node_home["Home<br/>[index.html]"]
  node_menu["Food menu<br/>[menu.html]"]
  node_cart["Cart checkout<br/>[cart.html]"]
  node_orders["Order history<br/>[orders.html]"]
  node_menulogic["Menu logic<br/>[menu.js]"]
  node_cartlogic["Checkout logic<br/>[cart.js]"]
  node_orderslogic["History logic<br/>[orders.js]"]
end

subgraph group_identity["Identity"]
  node_register["Registration<br/>[register.html]"]
  node_registerlogic["Register logic<br/>[register.js]"]
  node_login["Student login<br/>[login.html]"]
  node_loginlogic["Login logic<br/>[login.js]"]
end

subgraph group_admin["Administration"]
  node_adminlogin["Admin login<br/>[admin-login.html]"]
  node_adminloginlogic["Admin login logic<br/>[admin-login.js]"]
  node_dashboard["Admin dashboard<br/>[admin.html]"]
  node_adminlogic["Product and order management<br/>[admin.js]"]
end

subgraph group_shared["Browser data"]
  node_shareddata["Storage helpers and defaults<br/>[data.js]"]
  node_localstorage[("Browser localStorage")]
  node_sessionstorage[("Browser sessionStorage")]
end

node_student(("Student"))
node_adminactor(("Admin"))

node_student -->|"opens"| node_home
node_student -->|"registers"| node_register
node_student -->|"logs in"| node_login
node_student -->|"browses"| node_menu
node_student -->|"checks out"| node_cart
node_student -->|"views orders"| node_orders
node_adminactor -->|"opens"| node_adminlogin
node_register -->|"submits to"| node_registerlogic
node_login -->|"submits to"| node_loginlogic
node_menu -->|"uses"| node_menulogic
node_cart -->|"uses"| node_cartlogic
node_orders -->|"uses"| node_orderslogic
node_adminlogin -->|"submits to"| node_adminloginlogic
node_adminloginlogic -->|"redirects to"| node_dashboard
node_dashboard -->|"uses"| node_adminlogic
node_registerlogic -->|"uses user helpers"| node_shareddata
node_loginlogic -->|"uses user helpers"| node_shareddata
node_menulogic -->|"uses product and cart helpers"| node_shareddata
node_cartlogic -->|"uses cart and order helpers"| node_shareddata
node_orderslogic -->|"reads orders and user"| node_shareddata
node_adminlogic -->|"uses product and order helpers"| node_shareddata
node_shareddata -->|"reads and writes"| node_localstorage
node_adminloginlogic -->|"sets admin session"| node_sessionstorage
node_adminlogic -->|"checks and clears session"| node_sessionstorage

click node_home "https://github.com/adithyan0067/cafee/blob/main/index.html"
click node_menu "https://github.com/adithyan0067/cafee/blob/main/menu.html"
click node_cart "https://github.com/adithyan0067/cafee/blob/main/cart.html"
click node_orders "https://github.com/adithyan0067/cafee/blob/main/orders.html"
click node_register "https://github.com/adithyan0067/cafee/blob/main/register.html"
click node_registerlogic "https://github.com/adithyan0067/cafee/blob/main/register.js"
click node_login "https://github.com/adithyan0067/cafee/blob/main/login.html"
click node_loginlogic "https://github.com/adithyan0067/cafee/blob/main/login.js"
click node_menulogic "https://github.com/adithyan0067/cafee/blob/main/menu.js"
click node_cartlogic "https://github.com/adithyan0067/cafee/blob/main/cart.js"
click node_orderslogic "https://github.com/adithyan0067/cafee/blob/main/orders.js"
click node_adminlogin "https://github.com/adithyan0067/cafee/blob/main/admin-login.html"
click node_adminloginlogic "https://github.com/adithyan0067/cafee/blob/main/admin-login.js"
click node_dashboard "https://github.com/adithyan0067/cafee/blob/main/admin.html"
click node_adminlogic "https://github.com/adithyan0067/cafee/blob/main/admin.js"
click node_shareddata "https://github.com/adithyan0067/cafee/blob/main/data.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_home,node_menu,node_cart,node_orders,node_menulogic,node_cartlogic,node_orderslogic toneBlue
class node_register,node_registerlogic,node_login,node_loginlogic toneAmber
class node_adminlogin,node_adminloginlogic,node_dashboard,node_adminlogic toneMint
class node_shareddata,node_localstorage,node_sessionstorage toneRose
class node_student,node_adminactor toneIndigo
```

## Components

### Student ordering

- [Home](https://github.com/adithyan0067/cafee/blob/main/index.html): `index.html`
- [Food menu](https://github.com/adithyan0067/cafee/blob/main/menu.html): `menu.html`
- [Cart checkout](https://github.com/adithyan0067/cafee/blob/main/cart.html): `cart.html`
- [Order history](https://github.com/adithyan0067/cafee/blob/main/orders.html): `orders.html`
- [Menu logic](https://github.com/adithyan0067/cafee/blob/main/menu.js): `menu.js`
- [Checkout logic](https://github.com/adithyan0067/cafee/blob/main/cart.js): `cart.js`
- [History logic](https://github.com/adithyan0067/cafee/blob/main/orders.js): `orders.js`

### Identity

- [Registration](https://github.com/adithyan0067/cafee/blob/main/register.html): `register.html`
- [Register logic](https://github.com/adithyan0067/cafee/blob/main/register.js): `register.js`
- [Student login](https://github.com/adithyan0067/cafee/blob/main/login.html): `login.html`
- [Login logic](https://github.com/adithyan0067/cafee/blob/main/login.js): `login.js`

### Administration

- [Admin login](https://github.com/adithyan0067/cafee/blob/main/admin-login.html): `admin-login.html`
- [Admin login logic](https://github.com/adithyan0067/cafee/blob/main/admin-login.js): `admin-login.js`
- [Admin dashboard](https://github.com/adithyan0067/cafee/blob/main/admin.html): `admin.html`
- [Product and order management](https://github.com/adithyan0067/cafee/blob/main/admin.js): `admin.js`

### Browser data

- [Storage helpers and defaults](https://github.com/adithyan0067/cafee/blob/main/data.js): `data.js`
- **Browser localStorage**
- **Browser sessionStorage**

### Other components

- **Student**
- **Admin**

## Connections

- Student → Home: opens (evidence: `README.md`)
- Student → Registration: registers (evidence: `README.md`)
- Student → Student login: logs in (evidence: `README.md`)
- Student → Food menu: browses (evidence: `README.md`)
- Student → Cart checkout: checks out (evidence: `README.md`)
- Student → Order history: views orders (evidence: `README.md`)
- Admin → Admin login: opens (evidence: `README.md`)
- Registration → Register logic: submits to (evidence: `README.md`)
- Student login → Login logic: submits to (evidence: `README.md`)
- Food menu → Menu logic: uses (evidence: `README.md`)
- Cart checkout → Checkout logic: uses (evidence: `README.md`)
- Order history → History logic: uses (evidence: `README.md`)
- Admin login → Admin login logic: submits to (evidence: `README.md`)
- Admin login logic → Admin dashboard: redirects to (evidence: `admin-login.js`)
- Admin dashboard → Product and order management: uses (evidence: `README.md`)
- Register logic → Storage helpers and defaults: uses user helpers (evidence: `register.js`)
- Login logic → Storage helpers and defaults: uses user helpers (evidence: `login.js`)
- Menu logic → Storage helpers and defaults: uses product and cart helpers (evidence: `menu.js`)
- Checkout logic → Storage helpers and defaults: uses cart and order helpers (evidence: `cart.js`)
- History logic → Storage helpers and defaults: reads orders and user (evidence: `orders.js`)
- Product and order management → Storage helpers and defaults: uses product and order helpers (evidence: `admin.js`)
- Storage helpers and defaults → Browser localStorage: reads and writes (evidence: `data.js`)
- Admin login logic → Browser sessionStorage: sets admin session (evidence: `admin-login.js`)
- Product and order management → Browser sessionStorage: checks and clears session (evidence: `admin.js`)
