# abinbyanjankar-hellrider/portfolio-ledger-automate architecture

> Architecture diagram of the GitHub repository abinbyanjankar-hellrider/portfolio-ledger-automate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abinbyanjankar-hellrider/portfolio-ledger-automate
- Repository: https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate

## Overview

NEPSE Ledger is a browser-only portfolio tracker. Users import broker trade exports or enter transactions manually; the app stores that data in the browser and recomputes holdings, realized profit/loss, commission reporting, and period summaries. The README documents these capabilities and data flows, but no source excerpts were available, so internal implementation details and unconfirmed connections are omitted.

Main entry points: [`index.html`](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html) (Realized P&L)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Data entry"]
  node_page["Tracker page<br/>[index.html]"]
  node_trade_import["Trade import<br/>[index.html]"]
  node_manual_entry["Manual entry<br/>[index.html]"]
end

subgraph group_portfolio["Portfolio calculations"]
  node_holdings["Holdings<br/>[index.html]"]
  node_realized_pnl["Realized P&amp;L<br/>[index.html]"]
  node_fifo_basis["FIFO estimate<br/>[index.html]"]
  node_capital_gain["Capital Gain Certificate<br/>[index.html]"]
end

subgraph group_reporting["Reports"]
  node_commission_report["Commission report<br/>[index.html]"]
  node_period_summary["Monthly/yearly summary<br/>[index.html]"]
end

node_user(("User"))
node_browser_storage[("Browser storage")]

node_user -->|"opens"| node_page
node_user -->|"selects export"| node_trade_import
node_user -->|"adds trades"| node_manual_entry
node_trade_import -->|"stores imported data"| node_browser_storage
node_manual_entry -->|"stores transactions"| node_browser_storage
node_browser_storage -->|"recomputes from"| node_holdings
node_browser_storage -->|"recomputes from"| node_realized_pnl
node_fifo_basis -->|"estimates when needed"| node_realized_pnl
node_capital_gain -->|"provides preferred basis"| node_realized_pnl
node_browser_storage -->|"recomputes from"| node_commission_report
node_browser_storage -->|"recomputes from"| node_period_summary

click node_page "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_trade_import "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_manual_entry "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_holdings "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_realized_pnl "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_fifo_basis "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_capital_gain "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_commission_report "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"
click node_period_summary "https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html"

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_page,node_trade_import,node_manual_entry,node_user toneBlue
class node_holdings,node_realized_pnl,node_fifo_basis,node_capital_gain,node_browser_storage toneAmber
class node_commission_report,node_period_summary toneMint
```

## Components

### Data entry

- [Tracker page](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`
- [Trade import](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`
- [Manual entry](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`

### Portfolio calculations

- [Holdings](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`
- [Realized P&L](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`
- [FIFO estimate](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`
- [Capital Gain Certificate](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`

### Reports

- [Commission report](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`
- [Monthly/yearly summary](https://github.com/abinbyanjankar-hellrider/portfolio-ledger-automate/blob/master/index.html): `index.html`

### Other components

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

## Connections

- User → Tracker page: opens
- User → Trade import: selects export
- User → Manual entry: adds trades
- Trade import → Browser storage: stores imported data
- Manual entry → Browser storage: stores transactions
- Browser storage → Holdings: recomputes from
- Browser storage → Realized P&L: recomputes from
- FIFO estimate → Realized P&L: estimates when needed
- Capital Gain Certificate → Realized P&L: provides preferred basis
- Browser storage → Commission report: recomputes from
- Browser storage → Monthly/yearly summary: recomputes from
