# crash-override-z/working_shelfy_app architecture

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

- Interactive diagram: https://gitdiagram.com/crash-override-z/working_shelfy_app
- Repository: https://github.com/crash-override-z/working_shelfy_app

## Overview

Shelfy is a sushi-ordering and pickup application with web and console interfaces, plus an older CSV-based console implementation. In the web flow, customers review and confirm an order, which is persisted for staff to manage; customers can also look up orders by ticket. Staff sign in to view orders and update their status. The excerpts show the main web persistence and admin operations; the small README and unsampled page markup limit evidence about presentation and some wiring.

Main entry points: [`DATA/ShelfyDbContext.cs`](https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/ShelfyDbContext.cs) (EF data context), [`ShelfyWeb/Pages/Index.cshtml.cs`](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Index.cshtml.cs) (Order review), [`ShelfyWeb/Pages/Admin.cshtml.cs`](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Admin.cshtml.cs) (Order dashboard), [`DATA/Order.cs`](https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/Order.cs) (Order entity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web ordering"]
  node_webapp["Web app<br/>[Program.cs]"]
  node_orderpage["Order review<br/>[Index.cshtml.cs]"]
  node_lookup["Ticket lookup<br/>[Lookup.cshtml.cs]"]
end

subgraph group_operations["Order operations"]
  node_login["Admin login<br/>[Login.cshtml.cs]"]
  node_admin["Order dashboard<br/>[Admin.cshtml.cs]"]
  node_auth["Cookie authentication<br/>[Program.cs]"]
end

subgraph group_domain["Order data"]
  node_context["EF data context<br/>[ShelfyDbContext.cs]"]
  node_order["Order entity<br/>[Order.cs]"]
  node_orderitem["Order item<br/>[OrderItem.cs]"]
  node_database[("SQLite database<br/>[shelfy.db]")]
end

subgraph group_console["Console ordering"]
  node_console["Console ordering<br/>[Program.cs]"]
  node_legacy["CSV ordering<br/>[Program.cs]"]
  node_legacyorders["Legacy order model<br/>[Orders.cs]"]
  node_csv["CSV order file<br/>[orders.csv]"]
end

node_customer(("Customer"))
node_staff(("Staff"))

node_customer -.->|"uses"| node_webapp
node_webapp -->|"routes pages"| node_orderpage
node_webapp -->|"registers context"| node_context
node_orderpage -->|"saves order"| node_context
node_orderpage -->|"creates order"| node_order
node_orderpage -->|"creates items"| node_orderitem
node_lookup -->|"searches tickets"| node_context
node_admin -->|"loads and updates"| node_context
node_admin -->|"reads orders"| node_order
node_context -->|"maps entity"| node_order
node_context -->|"uses SQLite"| node_database
node_staff -.->|"signs in"| node_login
node_login -->|"signs in"| node_auth
node_auth -.->|"protects page"| node_admin
node_staff -.->|"manages orders"| node_admin
node_customer -.->|"searches ticket"| node_lookup
node_console -->|"saves orders"| node_context
node_console -->|"creates order"| node_order
node_legacy -->|"appends orders"| node_csv
node_legacy -.->|"uses cart model"| node_legacyorders

click node_webapp "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Program.cs"
click node_orderpage "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Index.cshtml.cs"
click node_lookup "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Lookup.cshtml.cs"
click node_login "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Login.cshtml.cs"
click node_admin "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Admin.cshtml.cs"
click node_auth "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Program.cs"
click node_context "https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/ShelfyDbContext.cs"
click node_order "https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/Order.cs"
click node_orderitem "https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/OrderItem.cs"
click node_database "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/shelfy.db"
click node_console "https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyConsole/Program.cs"
click node_legacy "https://github.com/crash-override-z/working_shelfy_app/blob/main/Program.cs"
click node_legacyorders "https://github.com/crash-override-z/working_shelfy_app/blob/main/models/Orders.cs"
click node_csv "https://github.com/crash-override-z/working_shelfy_app/blob/main/orders.csv"

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_webapp,node_orderpage,node_lookup toneBlue
class node_login,node_admin,node_auth toneAmber
class node_context,node_order,node_orderitem,node_database toneMint
class node_console,node_legacy,node_legacyorders,node_csv toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Web ordering

- [Web app](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Program.cs): `ShelfyWeb/Program.cs`
- [Order review](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Index.cshtml.cs): `ShelfyWeb/Pages/Index.cshtml.cs`
- [Ticket lookup](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Lookup.cshtml.cs): `ShelfyWeb/Pages/Lookup.cshtml.cs`

### Order operations

- [Admin login](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Login.cshtml.cs): `ShelfyWeb/Pages/Login.cshtml.cs`
- [Order dashboard](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Pages/Admin.cshtml.cs): `ShelfyWeb/Pages/Admin.cshtml.cs`
- [Cookie authentication](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/Program.cs): `ShelfyWeb/Program.cs`

### Order data

- [EF data context](https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/ShelfyDbContext.cs): `DATA/ShelfyDbContext.cs`
- [Order entity](https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/Order.cs): `DATA/Order.cs`
- [Order item](https://github.com/crash-override-z/working_shelfy_app/blob/main/DATA/OrderItem.cs): `DATA/OrderItem.cs`
- [SQLite database](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyWeb/shelfy.db): `ShelfyWeb/shelfy.db`

### Console ordering

- [Console ordering](https://github.com/crash-override-z/working_shelfy_app/blob/main/ShelfyConsole/Program.cs): `ShelfyConsole/Program.cs`
- [CSV ordering](https://github.com/crash-override-z/working_shelfy_app/blob/main/Program.cs): `Program.cs`
- [Legacy order model](https://github.com/crash-override-z/working_shelfy_app/blob/main/models/Orders.cs): `models/Orders.cs`
- [CSV order file](https://github.com/crash-override-z/working_shelfy_app/blob/main/orders.csv): `orders.csv`

### Other components

- **Customer**
- **Staff**

## Connections

- Customer → Web app: uses
- Web app → Order review: routes pages (evidence: `ShelfyWeb/Program.cs`)
- Web app → EF data context: registers context (evidence: `ShelfyWeb/Program.cs`)
- Order review → EF data context: saves order (evidence: `ShelfyWeb/Pages/Index.cshtml.cs`)
- Order review → Order entity: creates order (evidence: `ShelfyWeb/Pages/Index.cshtml.cs`)
- Order review → Order item: creates items (evidence: `ShelfyWeb/Pages/Index.cshtml.cs`)
- Ticket lookup → EF data context: searches tickets (evidence: `ShelfyWeb/Pages/Lookup.cshtml.cs`)
- Order dashboard → EF data context: loads and updates (evidence: `ShelfyWeb/Pages/Admin.cshtml.cs`)
- Order dashboard → Order entity: reads orders (evidence: `ShelfyWeb/Pages/Admin.cshtml.cs`)
- EF data context → Order entity: maps entity (evidence: `DATA/ShelfyDbContext.cs`)
- EF data context → SQLite database: uses SQLite (evidence: `DATA/ShelfyDbContext.cs`)
- Staff → Admin login: signs in
- Admin login → Cookie authentication: signs in (evidence: `ShelfyWeb/Pages/Login.cshtml.cs`)
- Cookie authentication → Order dashboard: protects page
- Staff → Order dashboard: manages orders
- Customer → Ticket lookup: searches ticket
- Console ordering → EF data context: saves orders (evidence: `ShelfyConsole/Program.cs`)
- Console ordering → Order entity: creates order (evidence: `ShelfyConsole/Program.cs`)
- CSV ordering → CSV order file: appends orders (evidence: `Program.cs`)
- CSV ordering → Legacy order model: uses cart model
