# projectinmaker/frontend-asahi-books architecture

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

- Interactive diagram: https://gitdiagram.com/projectinmaker/frontend-asahi-books
- Repository: https://github.com/projectinmaker/frontend-asahi-books

## Overview

ASAHI Books is a browser-based ERP frontend covering accounting, sales, purchasing, inventory, cash and banking, production, fixed assets, preferences, and reporting. Users enter through the app shell, authenticate, open modules in a tabbed workspace, and perform business workflows that use a shared API client. The graph preserves major modules named in the tree, but unsampled features are represented at their exact component paths without guessed call links. Relationships are limited to those visible in excerpts or the SOURCE INDEX.

Main entry points: [`src/app/page.tsx`](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/app/page.tsx) (App Shell), [`src/components/erp/workflow-components.tsx`](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/workflow-components.tsx) (Workflow Actions), [`src/lib/api.ts`](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/api.ts) (API Client), [`src/store/auth-store.ts`](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/store/auth-store.ts) (Authentication State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and Session"]
  node_app["App Shell<br/>[page.tsx]"]
  node_auth["Authentication State<br/>[auth-store.ts]"]
  node_tabs["Tabbed Workspace<br/>[tab-store.ts]"]
  node_dashboard["Dashboard<br/>[dashboard.tsx]"]
end

subgraph group_finance["Finance and Controls"]
  node_cash["Cash and Bank<br/>[index.tsx]"]
  node_ledger["General Ledger<br/>[index.tsx]"]
  node_settlements["Receivables Settlement<br/>[index.tsx]"]
  node_reports["Reports and Audit<br/>[reports.tsx]"]
end

subgraph group_operations["Business Operations"]
  node_sales["Sales<br/>[index.tsx]"]
  node_purchasing["Purchasing<br/>[index.tsx]"]
  node_inventory["Inventory<br/>[index.tsx]"]
  node_production["Production<br/>[index.tsx]"]
  node_assets["Fixed Assets<br/>[index.tsx]"]
  node_settings["Configuration<br/>[settings.tsx]"]
  node_preferences["Preferences<br/>[preferensi.tsx]"]
end

subgraph group_shared["Shared Runtime"]
  node_api["API Client<br/>[api.ts]"]
  node_types["API Contracts<br/>[api.ts]"]
  node_workflow["Workflow Actions"]
  node_workflowapi["Workflow API<br/>[workflow-api.ts]"]
  node_draft["Form Drafts<br/>[use-form-draft.ts]"]
  node_draftindicator["Draft Indicator"]
  node_deletedialog["Delete Confirmation"]
  node_money["Money Formatting<br/>[money.ts]"]
  node_pdf["PDF Utilities<br/>[pdf-utils.ts]"]
  node_dropdown["Searchable Dropdown"]
  node_button["Button Primitive<br/>[button.tsx]"]
  node_alertdialog["Alert Dialog<br/>[alert-dialog.tsx]"]
  node_select["Select Primitive<br/>[select.tsx]"]
  node_table["Table Primitive<br/>[table.tsx]"]
end

node_user(("ERP User"))
node_backend["ERP API"]

node_user -->|"uses"| node_app
node_app -->|"reads session"| node_auth
node_app -->|"reads tabs"| node_tabs
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_cash
node_app -->|"renders"| node_sales
node_app -->|"renders"| node_purchasing
node_auth -->|"calls"| node_api
node_api -->|"sends requests"| node_backend
node_workflow -->|"uses"| node_api
node_workflow -->|"calls"| node_workflowapi
node_workflow -->|"uses contracts"| node_types
node_pdf -->|"formats amounts"| node_money
node_dropdown -->|"renders"| node_button
node_alertdialog -->|"uses variants"| node_button

click node_app "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/app/page.tsx"
click node_auth "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/store/auth-store.ts"
click node_tabs "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/store/tab-store.ts"
click node_dashboard "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/dashboard.tsx"
click node_api "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/api.ts"
click node_types "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/types/api.ts"
click node_workflow "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/workflow-components.tsx"
click node_workflowapi "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/workflow-api.ts"
click node_draft "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/hooks/use-form-draft.ts"
click node_draftindicator "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/draft-indicator.tsx"
click node_deletedialog "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/hard-delete-cancel-dialog.tsx"
click node_money "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/money.ts"
click node_pdf "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/pdf-utils.ts"
click node_dropdown "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/searchable-dropdown.tsx"
click node_button "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/button.tsx"
click node_alertdialog "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/alert-dialog.tsx"
click node_select "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/select.tsx"
click node_table "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/table.tsx"
click node_cash "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/cash-bank/index.tsx"
click node_ledger "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/general-ledger/index.tsx"
click node_settlements "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/pelunasan/index.tsx"
click node_reports "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/reports.tsx"
click node_sales "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/sales/index.tsx"
click node_purchasing "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/purchasing/index.tsx"
click node_inventory "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/inventory/index.tsx"
click node_production "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/production/index.tsx"
click node_assets "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/fixed-assets/index.tsx"
click node_settings "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/settings.tsx"
click node_preferences "https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/preferensi.tsx"

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_app,node_auth,node_tabs,node_dashboard,node_user toneBlue
class node_cash,node_ledger,node_settlements,node_reports toneAmber
class node_sales,node_purchasing,node_inventory,node_production,node_assets,node_settings,node_preferences,node_backend toneMint
class node_api,node_types,node_workflow,node_workflowapi,node_draft,node_draftindicator,node_deletedialog,node_money,node_pdf,node_dropdown,node_button,node_alertdialog,node_select,node_table toneRose
```

## Components

### App and Session

- [App Shell](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Authentication State](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/store/auth-store.ts): `src/store/auth-store.ts`
- [Tabbed Workspace](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/store/tab-store.ts): `src/store/tab-store.ts`
- [Dashboard](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/dashboard.tsx): `src/components/erp/dashboard.tsx`

### Finance and Controls

- [Cash and Bank](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/cash-bank/index.tsx): `src/components/erp/cash-bank/index.tsx`
- [General Ledger](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/general-ledger/index.tsx): `src/components/erp/general-ledger/index.tsx`
- [Receivables Settlement](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/pelunasan/index.tsx): `src/components/erp/pelunasan/index.tsx`
- [Reports and Audit](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/reports.tsx): `src/components/erp/reports.tsx`

### Business Operations

- [Sales](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/sales/index.tsx): `src/components/erp/sales/index.tsx`
- [Purchasing](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/purchasing/index.tsx): `src/components/erp/purchasing/index.tsx`
- [Inventory](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/inventory/index.tsx): `src/components/erp/inventory/index.tsx`
- [Production](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/production/index.tsx): `src/components/erp/production/index.tsx`
- [Fixed Assets](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/fixed-assets/index.tsx): `src/components/erp/fixed-assets/index.tsx`
- [Configuration](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/settings.tsx): `src/components/erp/settings.tsx`
- [Preferences](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/preferensi.tsx): `src/components/erp/preferensi.tsx`

### Shared Runtime

- [API Client](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [API Contracts](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/types/api.ts): `src/types/api.ts`
- [Workflow Actions](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/workflow-components.tsx): `src/components/erp/workflow-components.tsx`
- [Workflow API](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/workflow-api.ts): `src/lib/workflow-api.ts`
- [Form Drafts](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/hooks/use-form-draft.ts): `src/hooks/use-form-draft.ts`
- [Draft Indicator](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/draft-indicator.tsx): `src/components/erp/draft-indicator.tsx`
- [Delete Confirmation](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/erp/hard-delete-cancel-dialog.tsx): `src/components/erp/hard-delete-cancel-dialog.tsx`
- [Money Formatting](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/money.ts): `src/lib/money.ts`
- [PDF Utilities](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/lib/pdf-utils.ts): `src/lib/pdf-utils.ts`
- [Searchable Dropdown](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/searchable-dropdown.tsx): `src/components/ui/searchable-dropdown.tsx`
- [Button Primitive](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Alert Dialog](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/alert-dialog.tsx): `src/components/ui/alert-dialog.tsx`
- [Select Primitive](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/select.tsx): `src/components/ui/select.tsx`
- [Table Primitive](https://github.com/projectinmaker/frontend-asahi-books/blob/main/src/components/ui/table.tsx): `src/components/ui/table.tsx`

### Other components

- **ERP User**
- **ERP API**

## Connections

- ERP User → App Shell: uses (evidence: `src/app/page.tsx`)
- App Shell → Authentication State: reads session (evidence: `src/app/page.tsx`)
- App Shell → Tabbed Workspace: reads tabs (evidence: `src/app/page.tsx`)
- App Shell → Dashboard: renders (evidence: `src/app/page.tsx`)
- App Shell → Cash and Bank: renders (evidence: `src/app/page.tsx`)
- App Shell → Sales: renders (evidence: `src/app/page.tsx`)
- App Shell → Purchasing: renders (evidence: `src/app/page.tsx`)
- Authentication State → API Client: calls (evidence: `src/store/auth-store.ts`)
- API Client → ERP API: sends requests (evidence: `src/lib/api.ts`)
- Workflow Actions → API Client: uses (evidence: `src/components/erp/workflow-components.tsx`)
- Workflow Actions → Workflow API: calls (evidence: `src/components/erp/workflow-components.tsx`)
- Workflow Actions → API Contracts: uses contracts (evidence: `src/components/erp/workflow-components.tsx`)
- PDF Utilities → Money Formatting: formats amounts (evidence: `src/lib/pdf-utils.ts`)
- Searchable Dropdown → Button Primitive: renders (evidence: `src/components/ui/searchable-dropdown.tsx`)
- Alert Dialog → Button Primitive: uses variants (evidence: `src/components/ui/alert-dialog.tsx`)
