# khorshedcgpt-source/lsfc-v1.0 architecture

> Architecture diagram of the GitHub repository khorshedcgpt-source/lsfc-v1.0, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khorshedcgpt-source/lsfc-v1.0
- Repository: https://github.com/khorshedcgpt-source/lsfc-v1.0
- Video tour (about a minute): https://gitdiagram.com/khorshedcgpt-source/lsfc-v1.0/video

## Overview

LSFC is a Bengali land-service-center management app, delivered as a web UI and an Electron desktop window. Staff navigate from the application shell to application entry, customer ledger, expenses, reports, and settings; the service calculator prices selected services, while invoice and report screens provide printable/PDF outputs. Local authentication gates ledger and settings access, and local stores hold operational data and configuration. The tree and excerpts support the main navigation and several utility calls; unsampled feature internals and some screen-to-store wiring are therefore not expanded.

Main entry points: [`src/App.tsx`](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/App.tsx) (Navigation shell), [`src/components/CustomerLedger.tsx`](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/CustomerLedger.tsx) (Customer ledger), [`src/components/settings/SettingsHub.tsx`](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/SettingsHub.tsx) (Settings hub), [`src/components/reports/ReportsHub.tsx`](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/ReportsHub.tsx) (Reports hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["React entry<br/>[main.tsx]"]
  node_appshell["Navigation shell<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_operations["Service operations"]
  node_application["Application form"]
  node_calculator["Service fee tester"]
  node_feeengine["Fee calculation"]
  node_feesettings["Service fee settings"]
end

subgraph group_records["Records and access"]
  node_ledger["Customer ledger<br/>[CustomerLedger.tsx]"]
  node_customers[("Customer store<br/>[customerStore.ts]")]
  node_invoices[("Invoice store<br/>[invoiceStore.ts]")]
  node_expenses["Expense tracker<br/>[ExpenseTracker.tsx]"]
  node_expense_store[("Expense store<br/>[expenseStore.ts]")]
  node_authgate["Authentication gate<br/>[AuthGate.tsx]"]
  node_auth[("Local authentication<br/>[authStore.ts]")]
  node_settingsgate["Settings role gate"]
  node_settings["Settings hub<br/>[SettingsHub.tsx]"]
  node_institution[("Institution settings")]
  node_backup["Backup and restore<br/>[BackupRestore.tsx]"]
end

subgraph group_outputs["Reports and documents"]
  node_reports["Reports hub<br/>[ReportsHub.tsx]"]
  node_summary["Center summary report"]
  node_statement["Customer statement"]
  node_invoiceprint["Invoice printing<br/>[InvoicePrint.tsx]"]
  node_invoicefields["Invoice text shaping"]
end

subgraph group_platform["Desktop runtime"]
  node_shell["Electron window<br/>[main.cjs]"]
end

node_user(("Staff user"))

node_user -->|"uses"| node_appshell
node_entry -->|"renders"| node_appshell
node_appshell -->|"selects"| node_dashboard
node_appshell -->|"selects"| node_application
node_appshell -->|"selects"| node_ledger
node_appshell -->|"selects"| node_expenses
node_appshell -->|"selects"| node_reports
node_appshell -->|"selects"| node_settingsgate
node_appshell -->|"opens"| node_calculator
node_calculator -->|"calculates"| node_feeengine
node_feesettings -->|"reads and saves"| node_institution
node_authgate -->|"checks session"| node_auth
node_authgate -->|"gates access"| node_ledger
node_settingsgate -->|"gates access"| node_settings
node_settings -->|"shows"| node_feesettings
node_settings -->|"shows"| node_backup
node_ledger -->|"customer records"| node_customers
node_ledger -->|"invoice records"| node_invoices
node_expenses -->|"expense records"| node_expense_store
node_reports -->|"opens"| node_summary
node_reports -->|"opens"| node_statement
node_invoiceprint -->|"shapes text with"| node_invoicefields
node_shell -->|"loads app"| node_entry

click node_entry "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/main.tsx"
click node_appshell "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/App.tsx"
click node_application "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/ApplicationForm.tsx"
click node_calculator "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/ServiceTestModal.tsx"
click node_feeengine "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/serviceCalculator.ts"
click node_feesettings "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/ServiceFeeSettings.tsx"
click node_ledger "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/CustomerLedger.tsx"
click node_customers "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/customerStore.ts"
click node_invoices "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/invoiceStore.ts"
click node_expenses "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/expenses/ExpenseTracker.tsx"
click node_expense_store "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/expenseStore.ts"
click node_authgate "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/auth/AuthGate.tsx"
click node_auth "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/authStore.ts"
click node_settingsgate "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/auth/SettingsRoleGate.tsx"
click node_settings "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/SettingsHub.tsx"
click node_institution "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/institutionSettings.ts"
click node_backup "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/BackupRestore.tsx"
click node_reports "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/ReportsHub.tsx"
click node_summary "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/CenterSummaryReportView.tsx"
click node_statement "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/CustomerStatementView.tsx"
click node_invoiceprint "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/InvoicePrint.tsx"
click node_invoicefields "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/banglaShaping/invoiceTextFields.ts"
click node_shell "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/electron/main.cjs"
click node_dashboard "https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/Dashboard.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_entry,node_appshell,node_dashboard,node_user toneBlue
class node_application,node_calculator,node_feeengine,node_feesettings toneAmber
class node_ledger,node_customers,node_invoices,node_expenses,node_expense_store,node_authgate,node_auth,node_settingsgate,node_settings,node_institution,node_backup toneMint
class node_reports,node_summary,node_statement,node_invoiceprint,node_invoicefields toneRose
class node_shell toneIndigo
```

## Components

### App shell

- [React entry](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/main.tsx): `src/main.tsx`
- [Navigation shell](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`

### Service operations

- [Application form](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/ApplicationForm.tsx): `src/components/ApplicationForm.tsx`
- [Service fee tester](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/ServiceTestModal.tsx): `src/components/ServiceTestModal.tsx`
- [Fee calculation](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/serviceCalculator.ts): `src/utils/serviceCalculator.ts`
- [Service fee settings](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/ServiceFeeSettings.tsx): `src/components/settings/ServiceFeeSettings.tsx`

### Records and access

- [Customer ledger](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/CustomerLedger.tsx): `src/components/CustomerLedger.tsx`
- [Customer store](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/customerStore.ts): `src/utils/customerStore.ts`
- [Invoice store](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/invoiceStore.ts): `src/utils/invoiceStore.ts`
- [Expense tracker](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/expenses/ExpenseTracker.tsx): `src/components/expenses/ExpenseTracker.tsx`
- [Expense store](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/expenseStore.ts): `src/utils/expenseStore.ts`
- [Authentication gate](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/auth/AuthGate.tsx): `src/components/auth/AuthGate.tsx`
- [Local authentication](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/authStore.ts): `src/utils/authStore.ts`
- [Settings role gate](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/auth/SettingsRoleGate.tsx): `src/components/auth/SettingsRoleGate.tsx`
- [Settings hub](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/SettingsHub.tsx): `src/components/settings/SettingsHub.tsx`
- [Institution settings](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/institutionSettings.ts): `src/utils/institutionSettings.ts`
- [Backup and restore](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/settings/BackupRestore.tsx): `src/components/settings/BackupRestore.tsx`

### Reports and documents

- [Reports hub](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/ReportsHub.tsx): `src/components/reports/ReportsHub.tsx`
- [Center summary report](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/CenterSummaryReportView.tsx): `src/components/reports/CenterSummaryReportView.tsx`
- [Customer statement](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/reports/CustomerStatementView.tsx): `src/components/reports/CustomerStatementView.tsx`
- [Invoice printing](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/components/InvoicePrint.tsx): `src/components/InvoicePrint.tsx`
- [Invoice text shaping](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/src/utils/banglaShaping/invoiceTextFields.ts): `src/utils/banglaShaping/invoiceTextFields.ts`

### Desktop runtime

- [Electron window](https://github.com/khorshedcgpt-source/lsfc-v1.0/blob/main/electron/main.cjs): `electron/main.cjs`

### Other components

- **Staff user**

## Connections

- Staff user → Navigation shell: uses
- React entry → Navigation shell: renders
- Navigation shell → Dashboard: selects
- Navigation shell → Application form: selects
- Navigation shell → Customer ledger: selects
- Navigation shell → Expense tracker: selects
- Navigation shell → Reports hub: selects
- Navigation shell → Settings role gate: selects
- Navigation shell → Service fee tester: opens
- Service fee tester → Fee calculation: calculates
- Service fee settings → Institution settings: reads and saves
- Authentication gate → Local authentication: checks session
- Authentication gate → Customer ledger: gates access
- Settings role gate → Settings hub: gates access
- Settings hub → Service fee settings: shows
- Settings hub → Backup and restore: shows
- Customer ledger → Customer store: customer records
- Customer ledger → Invoice store: invoice records
- Expense tracker → Expense store: expense records
- Reports hub → Center summary report: opens
- Reports hub → Customer statement: opens
- Invoice printing → Invoice text shaping: shapes text with
- Electron window → React entry: loads app
