# laptop-iq/food-bills architecture

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

- Interactive diagram: https://gitdiagram.com/laptop-iq/food-bills
- Repository: https://github.com/laptop-iq/food-bills

## Overview

This is a React receipt, invoice, and expense-form application, not a library. The main workflow is to enter and style a thermal restaurant bill, preview the receipt, then save or review bills; separate routes provide food bills, hotel expenses, invoices, and payment-provider receipt designs. The graph reflects imports and calls visible in the excerpts or SOURCE INDEX. Several page capabilities are represented by their source files, but their internal behavior was not sampled.

Main entry points: [`src/App.jsx`](https://github.com/laptop-iq/food-bills/blob/main/src/App.jsx) (Route selection), [`src/sections/ThermalBill.jsx`](https://github.com/laptop-iq/food-bills/blob/main/src/sections/ThermalBill.jsx) (Thermal bill workflow), [`src/components/Foods/FoodBill.jsx`](https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/FoodBill.jsx) (Food bill editor), [`src/components/Hotels/SFDyesExpenseForm.jsx`](https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/SFDyesExpenseForm.jsx) (Expense form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_router["Route selection<br/>[App.jsx]"]
  node_layout["Shared layout<br/>[Layout.jsx]"]
end

subgraph group_thermal["Thermal billing"]
  node_thermal_bill["Thermal bill workflow<br/>[ThermalBill.jsx]"]
  node_editor["Bill editor<br/>[BillEditorView.jsx]"]
  node_preview["Receipt preview"]
  node_receipt["Receipt rendering<br/>[BillReceipt.jsx]"]
  node_style_controls["Text styling"]
  node_saved_bills["Saved bill browser"]
  node_templates["Bill templates"]
  node_billing_state[("Billing state storage<br/>[api.js]")]
  node_dashboard["Billing dashboard<br/>[BillDashboard.jsx]"]
  node_thermal_defaults["Receipt defaults and styles<br/>[constants.js]"]
  node_feedback["Feedback dialogs<br/>[FeedbackUI.jsx]"]
end

subgraph group_food["Food billing"]
  node_food_bill["Food bill editor<br/>[FoodBill.jsx]"]
  node_food_toolbar["Bill toolbar"]
  node_food_header["Receipt header<br/>[ReceiptHeader.jsx]"]
  node_food_saved["Saved food bills<br/>[SavedBillsList.jsx]"]
  node_food_store[("Food bill storage")]
end

subgraph group_expense["Hotel expenses"]
  node_expense_form["Expense form"]
  node_expense_rows["Expense row definitions<br/>[expenseRows.js]"]
  node_expense_math["Amount utilities<br/>[numberUtils.js]"]
  node_expense_print["Print document generation<br/>[printTemplate.js]"]
  node_expense_records[("Expense record storage<br/>[recordsApi.js]")]
end

subgraph group_documents["Invoices and receipts"]
  node_tax_invoice["Tax invoice<br/>[TaxInvoice.jsx]"]
  node_hotel_invoice["Hotel invoice<br/>[Hotels.jsx]"]
  node_agoda_receipt["Agoda receipt"]
  node_phonepe["PhonePe receipt<br/>[PhonePe.jsx]"]
  node_gpay["GPay receipt<br/>[Gpay.jsx]"]
end

node_user(("User"))

node_user -->|"selects route"| node_router
node_router -->|"renders routes"| node_layout
node_router -->|"routes to"| node_thermal_bill
node_router -->|"routes to"| node_expense_form
node_router -->|"routes to"| node_food_bill
node_router -->|"routes to"| node_tax_invoice
node_router -->|"routes to"| node_hotel_invoice
node_router -->|"routes to"| node_agoda_receipt
node_router -->|"routes to"| node_phonepe
node_router -->|"routes to"| node_gpay
node_router -->|"routes to"| node_dashboard
node_layout -->|"hosts outlet"| node_router
node_thermal_bill -->|"renders"| node_editor
node_thermal_bill -->|"renders"| node_preview
node_thermal_bill -->|"renders"| node_saved_bills
node_thermal_bill -->|"opens manager"| node_templates
node_thermal_bill -->|"loads and saves"| node_billing_state
node_thermal_bill -->|"opens dashboard"| node_dashboard
node_thermal_bill -->|"renders dialogs"| node_feedback
node_thermal_bill -->|"uses defaults"| node_thermal_defaults
node_editor -->|"renders controls"| node_style_controls
node_editor -->|"renders panel"| node_preview
node_preview -->|"renders receipt"| node_receipt
node_preview -->|"renders controls"| node_style_controls
node_receipt -->|"uses text styles"| node_thermal_defaults
node_dashboard -->|"loads saved bills"| node_billing_state
node_templates -.->|"returns selection"| node_thermal_bill
node_food_bill -->|"renders toolbar"| node_food_toolbar
node_food_bill -->|"renders header"| node_food_header
node_food_bill -->|"renders saved list"| node_food_saved
node_food_bill -->|"uses bill storage"| node_food_store
node_food_saved -->|"reads and updates"| node_food_store
node_expense_form -->|"uses row definitions"| node_expense_rows
node_expense_form -->|"calculates amounts"| node_expense_math
node_expense_form -->|"generates print HTML"| node_expense_print
node_expense_form -->|"loads and saves"| node_expense_records

click node_router "https://github.com/laptop-iq/food-bills/blob/main/src/App.jsx"
click node_layout "https://github.com/laptop-iq/food-bills/blob/main/src/components/Layout.jsx"
click node_thermal_bill "https://github.com/laptop-iq/food-bills/blob/main/src/sections/ThermalBill.jsx"
click node_editor "https://github.com/laptop-iq/food-bills/blob/main/src/components/BillEditorView.jsx"
click node_preview "https://github.com/laptop-iq/food-bills/blob/main/src/components/BillPreviewView.jsx"
click node_receipt "https://github.com/laptop-iq/food-bills/blob/main/src/components/BillReceipt.jsx"
click node_style_controls "https://github.com/laptop-iq/food-bills/blob/main/src/components/TextStyleControls.jsx"
click node_saved_bills "https://github.com/laptop-iq/food-bills/blob/main/src/components/SavedBillsListView.jsx"
click node_templates "https://github.com/laptop-iq/food-bills/blob/main/src/components/BillTemplateManager.jsx"
click node_billing_state "https://github.com/laptop-iq/food-bills/blob/main/src/components/api/api.js"
click node_dashboard "https://github.com/laptop-iq/food-bills/blob/main/src/pages/BillDashboard.jsx"
click node_food_bill "https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/FoodBill.jsx"
click node_food_toolbar "https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/FoodBillToolbar.jsx"
click node_food_header "https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/ReceiptHeader.jsx"
click node_food_saved "https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/SavedBillsList.jsx"
click node_food_store "https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/savedBillsStorage.js"
click node_expense_form "https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/SFDyesExpenseForm.jsx"
click node_expense_rows "https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/expenseRows.js"
click node_expense_math "https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/numberUtils.js"
click node_expense_print "https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/printTemplate.js"
click node_expense_records "https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/recordsApi.js"
click node_tax_invoice "https://github.com/laptop-iq/food-bills/blob/main/src/pages/TaxInvoice.jsx"
click node_hotel_invoice "https://github.com/laptop-iq/food-bills/blob/main/src/pages/Hotels.jsx"
click node_agoda_receipt "https://github.com/laptop-iq/food-bills/blob/main/src/pages/AgodaReceiptOriginal.jsx"
click node_phonepe "https://github.com/laptop-iq/food-bills/blob/main/src/pages/PhonePe.jsx"
click node_gpay "https://github.com/laptop-iq/food-bills/blob/main/src/pages/Gpay.jsx"
click node_thermal_defaults "https://github.com/laptop-iq/food-bills/blob/main/src/layout/constants.js"
click node_feedback "https://github.com/laptop-iq/food-bills/blob/main/src/components/FeedbackUI.jsx"

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_router,node_layout,node_user toneBlue
class node_thermal_bill,node_editor,node_preview,node_receipt,node_style_controls,node_saved_bills,node_templates,node_billing_state,node_dashboard,node_thermal_defaults,node_feedback toneAmber
class node_food_bill,node_food_toolbar,node_food_header,node_food_saved,node_food_store toneMint
class node_expense_form,node_expense_rows,node_expense_math,node_expense_print,node_expense_records toneRose
class node_tax_invoice,node_hotel_invoice,node_agoda_receipt,node_phonepe,node_gpay toneIndigo
```

## Components

### Application shell

- [Route selection](https://github.com/laptop-iq/food-bills/blob/main/src/App.jsx): `src/App.jsx`
- [Shared layout](https://github.com/laptop-iq/food-bills/blob/main/src/components/Layout.jsx): `src/components/Layout.jsx`

### Thermal billing

- [Thermal bill workflow](https://github.com/laptop-iq/food-bills/blob/main/src/sections/ThermalBill.jsx): `src/sections/ThermalBill.jsx`
- [Bill editor](https://github.com/laptop-iq/food-bills/blob/main/src/components/BillEditorView.jsx): `src/components/BillEditorView.jsx`
- [Receipt preview](https://github.com/laptop-iq/food-bills/blob/main/src/components/BillPreviewView.jsx): `src/components/BillPreviewView.jsx`
- [Receipt rendering](https://github.com/laptop-iq/food-bills/blob/main/src/components/BillReceipt.jsx): `src/components/BillReceipt.jsx`
- [Text styling](https://github.com/laptop-iq/food-bills/blob/main/src/components/TextStyleControls.jsx): `src/components/TextStyleControls.jsx`
- [Saved bill browser](https://github.com/laptop-iq/food-bills/blob/main/src/components/SavedBillsListView.jsx): `src/components/SavedBillsListView.jsx`
- [Bill templates](https://github.com/laptop-iq/food-bills/blob/main/src/components/BillTemplateManager.jsx): `src/components/BillTemplateManager.jsx`
- [Billing state storage](https://github.com/laptop-iq/food-bills/blob/main/src/components/api/api.js): `src/components/api/api.js`
- [Billing dashboard](https://github.com/laptop-iq/food-bills/blob/main/src/pages/BillDashboard.jsx): `src/pages/BillDashboard.jsx`
- [Receipt defaults and styles](https://github.com/laptop-iq/food-bills/blob/main/src/layout/constants.js): `src/layout/constants.js`
- [Feedback dialogs](https://github.com/laptop-iq/food-bills/blob/main/src/components/FeedbackUI.jsx): `src/components/FeedbackUI.jsx`

### Food billing

- [Food bill editor](https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/FoodBill.jsx): `src/components/Foods/FoodBill.jsx`
- [Bill toolbar](https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/FoodBillToolbar.jsx): `src/components/Foods/FoodBillToolbar.jsx`
- [Receipt header](https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/ReceiptHeader.jsx): `src/components/Foods/ReceiptHeader.jsx`
- [Saved food bills](https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/SavedBillsList.jsx): `src/components/Foods/SavedBillsList.jsx`
- [Food bill storage](https://github.com/laptop-iq/food-bills/blob/main/src/components/Foods/savedBillsStorage.js): `src/components/Foods/savedBillsStorage.js`

### Hotel expenses

- [Expense form](https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/SFDyesExpenseForm.jsx): `src/components/Hotels/SFDyesExpenseForm.jsx`
- [Expense row definitions](https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/expenseRows.js): `src/components/Hotels/expenseRows.js`
- [Amount utilities](https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/numberUtils.js): `src/components/Hotels/numberUtils.js`
- [Print document generation](https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/printTemplate.js): `src/components/Hotels/printTemplate.js`
- [Expense record storage](https://github.com/laptop-iq/food-bills/blob/main/src/components/Hotels/recordsApi.js): `src/components/Hotels/recordsApi.js`

### Invoices and receipts

- [Tax invoice](https://github.com/laptop-iq/food-bills/blob/main/src/pages/TaxInvoice.jsx): `src/pages/TaxInvoice.jsx`
- [Hotel invoice](https://github.com/laptop-iq/food-bills/blob/main/src/pages/Hotels.jsx): `src/pages/Hotels.jsx`
- [Agoda receipt](https://github.com/laptop-iq/food-bills/blob/main/src/pages/AgodaReceiptOriginal.jsx): `src/pages/AgodaReceiptOriginal.jsx`
- [PhonePe receipt](https://github.com/laptop-iq/food-bills/blob/main/src/pages/PhonePe.jsx): `src/pages/PhonePe.jsx`
- [GPay receipt](https://github.com/laptop-iq/food-bills/blob/main/src/pages/Gpay.jsx): `src/pages/Gpay.jsx`

### Other components

- **User**

## Connections

- User → Route selection: selects route (evidence: `src/App.jsx`)
- Route selection → Shared layout: renders routes (evidence: `src/App.jsx`)
- Route selection → Thermal bill workflow: routes to (evidence: `src/App.jsx`)
- Route selection → Expense form: routes to (evidence: `src/App.jsx`)
- Route selection → Food bill editor: routes to (evidence: `src/App.jsx`)
- Route selection → Tax invoice: routes to (evidence: `src/App.jsx`)
- Route selection → Hotel invoice: routes to (evidence: `src/App.jsx`)
- Route selection → Agoda receipt: routes to (evidence: `src/App.jsx`)
- Route selection → PhonePe receipt: routes to (evidence: `src/App.jsx`)
- Route selection → GPay receipt: routes to (evidence: `src/App.jsx`)
- Route selection → Billing dashboard: routes to (evidence: `src/App.jsx`)
- Shared layout → Route selection: hosts outlet (evidence: `src/components/Layout.jsx`)
- Thermal bill workflow → Bill editor: renders (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Receipt preview: renders (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Saved bill browser: renders (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Bill templates: opens manager (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Billing state storage: loads and saves (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Billing dashboard: opens dashboard (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Feedback dialogs: renders dialogs (evidence: `src/sections/ThermalBill.jsx`)
- Thermal bill workflow → Receipt defaults and styles: uses defaults (evidence: `src/sections/ThermalBill.jsx`)
- Bill editor → Text styling: renders controls (evidence: `src/components/BillEditorView.jsx`)
- Bill editor → Receipt preview: renders panel (evidence: `src/components/BillEditorView.jsx`)
- Receipt preview → Receipt rendering: renders receipt (evidence: `src/components/BillPreviewView.jsx`)
- Receipt preview → Text styling: renders controls (evidence: `src/components/BillPreviewView.jsx`)
- Receipt rendering → Receipt defaults and styles: uses text styles (evidence: `src/components/BillReceipt.jsx`)
- Billing dashboard → Billing state storage: loads saved bills (evidence: `src/pages/BillDashboard.jsx`)
- Bill templates → Thermal bill workflow: returns selection (evidence: `src/sections/ThermalBill.jsx`)
- Food bill editor → Bill toolbar: renders toolbar (evidence: `src/components/Foods/FoodBill.jsx`)
- Food bill editor → Receipt header: renders header (evidence: `src/components/Foods/FoodBill.jsx`)
- Food bill editor → Saved food bills: renders saved list (evidence: `src/components/Foods/FoodBill.jsx`)
- Food bill editor → Food bill storage: uses bill storage (evidence: `src/components/Foods/FoodBill.jsx`)
- Saved food bills → Food bill storage: reads and updates (evidence: `src/components/Foods/SavedBillsList.jsx`)
- Expense form → Expense row definitions: uses row definitions (evidence: `src/components/Hotels/SFDyesExpenseForm.jsx`)
- Expense form → Amount utilities: calculates amounts (evidence: `src/components/Hotels/SFDyesExpenseForm.jsx`)
- Expense form → Print document generation: generates print HTML (evidence: `src/components/Hotels/SFDyesExpenseForm.jsx`)
- Expense form → Expense record storage: loads and saves (evidence: `src/components/Hotels/SFDyesExpenseForm.jsx`)
