# mandavavasanth/trading-journal architecture

> Architecture diagram of the GitHub repository mandavavasanth/trading-journal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mandavavasanth/trading-journal
- Repository: https://github.com/mandavavasanth/trading-journal

## Overview

Discipline Trading Journal is a browser-only trading journal: users enter and tag trades, then review them through dashboard, calendar, history, psychology, and analytics views. The main UI controller routes between those views and opens trade entry from quick-add actions; the store persists trades and capital in localStorage and supports backup export. CSV export is implemented in analytics; the PDF control produces a mocked PDF download. The map follows the shown imports, calls, and README; unsampled view and modal behavior is not inferred beyond documented capabilities.

Main entry points: [`src/main.js`](https://github.com/mandavavasanth/trading-journal/blob/main/src/main.js) (UI Router), [`src/store.js`](https://github.com/mandavavasanth/trading-journal/blob/main/src/store.js) (Trade and Capital Store), [`src/views/analytics.js`](https://github.com/mandavavasanth/trading-journal/blob/main/src/views/analytics.js) (Performance Analytics), [`src/components/tradeModal.js`](https://github.com/mandavavasanth/trading-journal/blob/main/src/components/tradeModal.js) (Trade Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Trade Workflow"]
  node_controller["UI Router<br/>[main.js]"]
  node_trade_entry["Trade Entry<br/>[tradeModal.js]"]
end

subgraph group_reviews["Review Views"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_calendar["Trade Calendar<br/>[calendar.js]"]
  node_history["Trade History<br/>[history.js]"]
  node_psychology["Psychology Review<br/>[psychology.js]"]
  node_analytics["Performance Analytics<br/>[analytics.js]"]
end

subgraph group_data["Data and Exports"]
  node_trade_store[("Trade and Capital Store<br/>[store.js]")]
  node_browser_storage[("Browser localStorage")]
  node_backup["JSON Backup Export<br/>[store.js]"]
end

node_user(("Journal User"))

node_user -->|"uses journal"| node_controller
node_controller -->|"routes view"| node_dashboard
node_controller -->|"routes view"| node_calendar
node_controller -->|"routes view"| node_psychology
node_controller -->|"routes view"| node_history
node_controller -->|"routes view"| node_analytics
node_controller -->|"opens modal"| node_trade_entry
node_controller -->|"requests backup"| node_trade_store
node_trade_entry -->|"saves trades"| node_trade_store
node_dashboard -->|"reads stats"| node_trade_store
node_calendar -->|"reads trades"| node_trade_store
node_history -->|"reads trades"| node_trade_store
node_psychology -->|"reads trades"| node_trade_store
node_analytics -->|"reads trades"| node_trade_store
node_trade_store -->|"reads and writes"| node_browser_storage
node_trade_store -->|"provides data"| node_backup
node_analytics -->|"downloads CSV"| node_user
node_analytics -->|"downloads mock PDF"| node_user

click node_controller "https://github.com/mandavavasanth/trading-journal/blob/main/src/main.js"
click node_trade_entry "https://github.com/mandavavasanth/trading-journal/blob/main/src/components/tradeModal.js"
click node_dashboard "https://github.com/mandavavasanth/trading-journal/blob/main/src/views/dashboard.js"
click node_calendar "https://github.com/mandavavasanth/trading-journal/blob/main/src/views/calendar.js"
click node_history "https://github.com/mandavavasanth/trading-journal/blob/main/src/views/history.js"
click node_psychology "https://github.com/mandavavasanth/trading-journal/blob/main/src/views/psychology.js"
click node_analytics "https://github.com/mandavavasanth/trading-journal/blob/main/src/views/analytics.js"
click node_trade_store "https://github.com/mandavavasanth/trading-journal/blob/main/src/store.js"
click node_backup "https://github.com/mandavavasanth/trading-journal/blob/main/src/store.js"

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_controller,node_trade_entry,node_user toneBlue
class node_dashboard,node_calendar,node_history,node_psychology,node_analytics toneAmber
class node_trade_store,node_browser_storage,node_backup toneMint
```

## Components

### Trade Workflow

- [UI Router](https://github.com/mandavavasanth/trading-journal/blob/main/src/main.js): `src/main.js`
- [Trade Entry](https://github.com/mandavavasanth/trading-journal/blob/main/src/components/tradeModal.js): `src/components/tradeModal.js`

### Review Views

- [Dashboard](https://github.com/mandavavasanth/trading-journal/blob/main/src/views/dashboard.js): `src/views/dashboard.js`
- [Trade Calendar](https://github.com/mandavavasanth/trading-journal/blob/main/src/views/calendar.js): `src/views/calendar.js`
- [Trade History](https://github.com/mandavavasanth/trading-journal/blob/main/src/views/history.js): `src/views/history.js`
- [Psychology Review](https://github.com/mandavavasanth/trading-journal/blob/main/src/views/psychology.js): `src/views/psychology.js`
- [Performance Analytics](https://github.com/mandavavasanth/trading-journal/blob/main/src/views/analytics.js): `src/views/analytics.js`

### Data and Exports

- [Trade and Capital Store](https://github.com/mandavavasanth/trading-journal/blob/main/src/store.js): `src/store.js`
- **Browser localStorage**
- [JSON Backup Export](https://github.com/mandavavasanth/trading-journal/blob/main/src/store.js): `src/store.js`

### Other components

- **Journal User**

## Connections

- Journal User → UI Router: uses journal (evidence: `README.md`)
- UI Router → Dashboard: routes view (evidence: `src/main.js`)
- UI Router → Trade Calendar: routes view (evidence: `src/main.js`)
- UI Router → Psychology Review: routes view (evidence: `src/main.js`)
- UI Router → Trade History: routes view (evidence: `src/main.js`)
- UI Router → Performance Analytics: routes view (evidence: `src/main.js`)
- UI Router → Trade Entry: opens modal (evidence: `src/main.js`)
- UI Router → Trade and Capital Store: requests backup (evidence: `src/main.js`)
- Trade Entry → Trade and Capital Store: saves trades (evidence: `src/components/tradeModal.js`)
- Dashboard → Trade and Capital Store: reads stats (evidence: `src/views/dashboard.js`)
- Trade Calendar → Trade and Capital Store: reads trades (evidence: `src/views/calendar.js`)
- Trade History → Trade and Capital Store: reads trades (evidence: `src/views/history.js`)
- Psychology Review → Trade and Capital Store: reads trades (evidence: `src/views/psychology.js`)
- Performance Analytics → Trade and Capital Store: reads trades (evidence: `src/views/analytics.js`)
- Trade and Capital Store → Browser localStorage: reads and writes (evidence: `src/store.js`)
- Trade and Capital Store → JSON Backup Export: provides data (evidence: `src/store.js`)
- Performance Analytics → Journal User: downloads CSV (evidence: `src/views/analytics.js`)
- Performance Analytics → Journal User: downloads mock PDF (evidence: `src/views/analytics.js`)
