# not-brajesh/finc architecture

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

- Interactive diagram: https://gitdiagram.com/not-brajesh/finc
- Repository: https://github.com/not-brajesh/finc

## Overview

FINc is a local-first personal finance web app. A user works through the browser interface to manage accounts and transactions, review financial summaries, and use budgeting, loans, goals, assets and liabilities; statement upload, reports and data controls extend that workflow. The JavaScript app manages interface state and IndexedDB persistence, with an optional WebAssembly finance engine. The README documents offline PWA support. Feature modules largely share app.js; their individual internal calls are not fully visible in the excerpts, so the graph avoids implying those connections.

Main entry points: [`app.js`](https://github.com/not-brajesh/finc/blob/main/app.js) (App state and UI), [`finc.js`](https://github.com/not-brajesh/finc/blob/main/finc.js) (Wasm glue), [`sw.js`](https://github.com/not-brajesh/finc/blob/main/sw.js) (Service worker), [`index.html`](https://github.com/not-brajesh/finc/blob/main/index.html) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Finance features"]
  node_interface["Web interface<br/>[index.html]"]
  node_dashboard["Dashboard<br/>[app.js]"]
  node_accounts["Accounts<br/>[app.js]"]
  node_transactions["Transactions<br/>[app.js]"]
  node_statements["Statement analyzer<br/>[app.js]"]
  node_budgets["Budgets<br/>[app.js]"]
  node_loans["Loans and EMIs<br/>[app.js]"]
  node_goals["Savings goals<br/>[app.js]"]
  node_networth["Assets and liabilities<br/>[app.js]"]
  node_reports["Reports and export<br/>[app.js]"]
  node_data["Data controls<br/>[app.js]"]
end

subgraph group_runtime["App runtime"]
  node_app["App state and UI<br/>[app.js]"]
  node_storage[("IndexedDB<br/>[app.js]")]
  node_engine["Finance engine<br/>[main.cpp]"]
  node_glue["Wasm glue<br/>[finc.js]"]
  node_wasm["Wasm binary<br/>[finc.wasm]"]
end

subgraph group_offline["Offline app"]
  node_serviceworker["Service worker<br/>[sw.js]"]
  node_manifest["App manifest<br/>[manifest.json]"]
end

node_user(("User"))
node_browser(("Browser"))

node_user -->|"uses"| node_interface
node_interface -->|"hosts"| node_app
node_app -->|"persists state"| node_storage
node_app -.->|"initializes optionally"| node_glue
node_glue -->|"loads"| node_wasm
node_engine -->|"exports bindings"| node_glue
node_app -->|"uses offline support"| node_serviceworker
node_serviceworker -.->|"caches"| node_manifest
node_browser -->|"runs"| node_serviceworker
node_browser -->|"installs app"| node_manifest

click node_interface "https://github.com/not-brajesh/finc/blob/main/index.html"
click node_dashboard "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_accounts "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_transactions "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_statements "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_budgets "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_loans "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_goals "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_networth "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_reports "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_data "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_app "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_storage "https://github.com/not-brajesh/finc/blob/main/app.js"
click node_engine "https://github.com/not-brajesh/finc/blob/main/main.cpp"
click node_glue "https://github.com/not-brajesh/finc/blob/main/finc.js"
click node_wasm "https://github.com/not-brajesh/finc/blob/main/finc.wasm"
click node_serviceworker "https://github.com/not-brajesh/finc/blob/main/sw.js"
click node_manifest "https://github.com/not-brajesh/finc/blob/main/manifest.json"

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_interface,node_dashboard,node_accounts,node_transactions,node_statements,node_budgets,node_loans,node_goals,node_networth,node_reports,node_data,node_user,node_browser toneBlue
class node_app,node_storage,node_engine,node_glue,node_wasm toneAmber
class node_serviceworker,node_manifest toneMint
```

## Components

### Finance features

- [Web interface](https://github.com/not-brajesh/finc/blob/main/index.html): `index.html`
- [Dashboard](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Accounts](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Transactions](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Statement analyzer](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Budgets](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Loans and EMIs](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Savings goals](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Assets and liabilities](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Reports and export](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Data controls](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`

### App runtime

- [App state and UI](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [IndexedDB](https://github.com/not-brajesh/finc/blob/main/app.js): `app.js`
- [Finance engine](https://github.com/not-brajesh/finc/blob/main/main.cpp): `main.cpp`
- [Wasm glue](https://github.com/not-brajesh/finc/blob/main/finc.js): `finc.js`
- [Wasm binary](https://github.com/not-brajesh/finc/blob/main/finc.wasm): `finc.wasm`

### Offline app

- [Service worker](https://github.com/not-brajesh/finc/blob/main/sw.js): `sw.js`
- [App manifest](https://github.com/not-brajesh/finc/blob/main/manifest.json): `manifest.json`

### Other components

- **User**
- **Browser**

## Connections

- User → Web interface: uses (evidence: `README.md`)
- Web interface → App state and UI: hosts (evidence: `README.md`)
- App state and UI → IndexedDB: persists state (evidence: `README.md`)
- App state and UI → Wasm glue: initializes optionally (evidence: `app.js`)
- Wasm glue → Wasm binary: loads (evidence: `finc.js`)
- Finance engine → Wasm glue: exports bindings (evidence: `README.md`)
- App state and UI → Service worker: uses offline support (evidence: `README.md`)
- Service worker → App manifest: caches (evidence: `sw.js`)
- Browser → Service worker: runs (evidence: `README.md`)
- Browser → App manifest: installs app (evidence: `README.md`)
