# diky-without-c/mnm-daily-report architecture

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

- Interactive diagram: https://gitdiagram.com/diky-without-c/mnm-daily-report
- Repository: https://github.com/diky-without-c/mnm-daily-report

## Overview

MNM Daily Report is a browser app for turning a daily Excel stock sheet into a formatted report, enriched with Supabase order/container data and optional MPO sales. The main workflow parses the uploaded workbook, applies report transformations, combines the domain data, and produces copyable text. Separate order, sales, and stuffing screens support managing the contributing data. The README documents the product flow; some page-to-service wiring and unsampled report internals are not shown, so those links are omitted or marked unverified.

Main entry points: [`src/routes/index.tsx`](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/routes/index.tsx) (Page routing), [`src/features/report`](https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/report) (Report transformations), [`src/components/Input/InputFile/index.tsx`](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/components/Input/InputFile/index.tsx) (Workbook upload), [`src/libs/xlsx/parseCache.ts`](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parseCache.ts) (Parse cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_routes["Page routing<br/>[index.tsx]"]
end

subgraph group_excel["Excel ingestion"]
  node_upload["Workbook upload<br/>[index.tsx]"]
  node_persistence[("File persistence<br/>[index.ts]")]
  node_excelhook["Excel parse hook<br/>[useExcelParser.ts]"]
  node_parsecache["Parse cache<br/>[parseCache.ts]"]
  node_xlsxparser["Workbook reader<br/>[xlsx.parser.ts]"]
  node_reportparser["Stock sheet parser<br/>[report.parser.ts]"]
  node_salesparser["MPO sales parser<br/>[sales.parser.ts]"]
end

subgraph group_report["Report generation"]
  node_reportflow["Report transformations"]
  node_reporttext["Text formatter<br/>[report.builder.ts]"]
  node_reportpreview["Report preview<br/>[index.tsx]"]
end

subgraph group_operations["Stock operations"]
  node_orderpage["Orders page<br/>[index.tsx]"]
  node_salespage["Sales page<br/>[index.tsx]"]
  node_stuffingpage["Stuffing page<br/>[index.tsx]"]
  node_orderlogic["Order management"]
  node_saleslogic["Sales analysis"]
  node_stuffinglogic["Container stuffing<br/>[useStuffing.ts]"]
end

subgraph group_data["Data services"]
  node_orderstore[("Orders state<br/>[useOrders.store.ts]")]
  node_supabaseservice["Supabase service<br/>[service.ts]"]
  node_supabase[("Supabase backend<br/>[supabase.ts]")]
  node_indexeddb[("Browser IndexedDB")]
end

node_user(("Operator"))

node_user -->|"opens app"| node_routes
node_routes -->|"routes to"| node_orderpage
node_routes -->|"routes to"| node_salespage
node_routes -->|"routes to"| node_stuffingpage
node_user -.->|"uploads workbook"| node_upload
node_upload -.->|"persists file"| node_persistence
node_persistence -.->|"stores file"| node_indexeddb
node_upload -.->|"provides file"| node_excelhook
node_excelhook -->|"parses sheets"| node_parsecache
node_parsecache -->|"dispatches report"| node_reportparser
node_parsecache -->|"dispatches sales"| node_salesparser
node_salesparser -->|"reads workbook"| node_xlsxparser
node_reportparser -.->|"feeds report data"| node_reportflow
node_reportflow -.->|"formats report"| node_reporttext
node_reporttext -.->|"provides report text"| node_reportpreview
node_reportflow -.->|"merges orders"| node_orderlogic
node_reportflow -.->|"merges sales"| node_saleslogic
node_orderlogic -.->|"uses order data"| node_supabaseservice
node_stuffinglogic -->|"creates and updates"| node_supabaseservice
node_stuffinglogic -->|"updates state"| node_orderstore
node_supabaseservice -->|"queries client"| node_supabase
node_salespage -.->|"uses sales features"| node_saleslogic

click node_routes "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/routes/index.tsx"
click node_orderpage "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/pages/Order/index.tsx"
click node_salespage "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/pages/Sales/index.tsx"
click node_stuffingpage "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/pages/Stuffing/index.tsx"
click node_upload "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/components/Input/InputFile/index.tsx"
click node_persistence "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/fileStorage/index.ts"
click node_excelhook "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/useExcelParser.ts"
click node_parsecache "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parseCache.ts"
click node_xlsxparser "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/xlsx.parser.ts"
click node_reportparser "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parser/report.parser.ts"
click node_salesparser "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parser/sales.parser.ts"
click node_reportflow "https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/report"
click node_reporttext "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/features/report/dataToText/report.builder.ts"
click node_reportpreview "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/features/report/components/PreviewPanel/index.tsx"
click node_orderlogic "https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/orders"
click node_saleslogic "https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/sales"
click node_stuffinglogic "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/features/stuffing/useStuffing.ts"
click node_orderstore "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/stores/useOrders.store.ts"
click node_supabaseservice "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/apps/supabase/service.ts"
click node_supabase "https://github.com/diky-without-c/mnm-daily-report/blob/main/src/apps/supabase/supabase.ts"

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_routes toneBlue
class node_upload,node_persistence,node_excelhook,node_parsecache,node_xlsxparser,node_reportparser,node_salesparser toneAmber
class node_reportflow,node_reporttext,node_reportpreview toneMint
class node_orderpage,node_salespage,node_stuffingpage,node_orderlogic,node_saleslogic,node_stuffinglogic toneRose
class node_orderstore,node_supabaseservice,node_supabase,node_indexeddb,node_user toneIndigo
```

## Components

### App shell

- [Page routing](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/routes/index.tsx): `src/routes/index.tsx`

### Excel ingestion

- [Workbook upload](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/components/Input/InputFile/index.tsx): `src/components/Input/InputFile/index.tsx`
- [File persistence](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/fileStorage/index.ts): `src/libs/fileStorage/index.ts`
- [Excel parse hook](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/useExcelParser.ts): `src/libs/xlsx/useExcelParser.ts`
- [Parse cache](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parseCache.ts): `src/libs/xlsx/parseCache.ts`
- [Workbook reader](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/xlsx.parser.ts): `src/libs/xlsx/xlsx.parser.ts`
- [Stock sheet parser](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parser/report.parser.ts): `src/libs/xlsx/parser/report.parser.ts`
- [MPO sales parser](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/libs/xlsx/parser/sales.parser.ts): `src/libs/xlsx/parser/sales.parser.ts`

### Report generation

- [Report transformations](https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/report): `src/features/report`
- [Text formatter](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/features/report/dataToText/report.builder.ts): `src/features/report/dataToText/report.builder.ts`
- [Report preview](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/features/report/components/PreviewPanel/index.tsx): `src/features/report/components/PreviewPanel/index.tsx`

### Stock operations

- [Orders page](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/pages/Order/index.tsx): `src/pages/Order/index.tsx`
- [Sales page](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/pages/Sales/index.tsx): `src/pages/Sales/index.tsx`
- [Stuffing page](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/pages/Stuffing/index.tsx): `src/pages/Stuffing/index.tsx`
- [Order management](https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/orders): `src/features/orders`
- [Sales analysis](https://github.com/diky-without-c/mnm-daily-report/tree/main/src/features/sales): `src/features/sales`
- [Container stuffing](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/features/stuffing/useStuffing.ts): `src/features/stuffing/useStuffing.ts`

### Data services

- [Orders state](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/stores/useOrders.store.ts): `src/stores/useOrders.store.ts`
- [Supabase service](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/apps/supabase/service.ts): `src/apps/supabase/service.ts`
- [Supabase backend](https://github.com/diky-without-c/mnm-daily-report/blob/main/src/apps/supabase/supabase.ts): `src/apps/supabase/supabase.ts`
- **Browser IndexedDB**

### Other components

- **Operator**

## Connections

- Operator → Page routing: opens app
- Page routing → Orders page: routes to (evidence: `src/routes/index.tsx`)
- Page routing → Sales page: routes to (evidence: `src/routes/index.tsx`)
- Page routing → Stuffing page: routes to (evidence: `src/routes/index.tsx`)
- Operator → Workbook upload: uploads workbook
- Workbook upload → File persistence: persists file
- File persistence → Browser IndexedDB: stores file
- Workbook upload → Excel parse hook: provides file
- Excel parse hook → Parse cache: parses sheets (evidence: `src/libs/xlsx/useExcelParser.ts`)
- Parse cache → Stock sheet parser: dispatches report (evidence: `src/libs/xlsx/parseCache.ts`)
- Parse cache → MPO sales parser: dispatches sales (evidence: `src/libs/xlsx/parseCache.ts`)
- MPO sales parser → Workbook reader: reads workbook (evidence: `src/libs/xlsx/parser/sales.parser.ts`)
- Stock sheet parser → Report transformations: feeds report data
- Report transformations → Text formatter: formats report
- Text formatter → Report preview: provides report text
- Report transformations → Order management: merges orders
- Report transformations → Sales analysis: merges sales
- Order management → Supabase service: uses order data
- Container stuffing → Supabase service: creates and updates (evidence: `src/features/stuffing/useStuffing.ts`)
- Container stuffing → Orders state: updates state (evidence: `src/features/stuffing/useStuffing.ts`)
- Supabase service → Supabase backend: queries client (evidence: `src/apps/supabase/service.ts`)
- Sales page → Sales analysis: uses sales features
