# sushantshinde7/finsights architecture

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

- Interactive diagram: https://gitdiagram.com/sushantshinde7/finsights
- Repository: https://github.com/sushantshinde7/finsights

## Overview

Finsights is a React personal-finance and analytics application. Users can explore sample data as guests or sign in, then manage transaction datasets, import/export CSV, and view dashboard and insight summaries. The frontend owns transaction state and browser persistence; Firebase handles authentication. The README identifies the backend as a nonfunctional scaffold, so it is not represented as a working API. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled feature internals are grouped at their exact directories.

Main entry points: [`src/context/TransactionContext.jsx`](https://github.com/sushantshinde7/finsights/blob/main/src/context/TransactionContext.jsx) (Transaction state), [`src/main.jsx`](https://github.com/sushantshinde7/finsights/blob/main/src/main.jsx) (App bootstrap), [`src/pages/transactions/TransactionsPage.jsx`](https://github.com/sushantshinde7/finsights/blob/main/src/pages/transactions/TransactionsPage.jsx) (Transaction management), [`src/context/AuthContext.jsx`](https://github.com/sushantshinde7/finsights/blob/main/src/context/AuthContext.jsx) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell &amp; access"]
  node_entry["App bootstrap<br/>[main.jsx]"]
  node_routing["Route dispatch<br/>[AppRoutes.jsx]"]
  node_layout["App layout<br/>[AppLayout.jsx]"]
  node_routeguards["Route guards"]
  node_motion["Motion utilities<br/>[motion.js]"]
end

subgraph group_identity["Authentication &amp; state"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_firebase["Firebase auth<br/>[firebase.js]"]
  node_login["Sign-in &amp; signup"]
end

subgraph group_money["Transactions &amp; datasets"]
  node_txstate["Transaction state"]
  node_samples["Sample datasets"]
  node_sampletwo["Sample dataset two"]
  node_browserstore[("Browser storage")]
  node_csv["CSV utilities<br/>[csv.js]"]
  node_transactionpage["Transaction management"]
  node_txparts["Transaction dialogs &amp; table"]
end

subgraph group_analytics["Financial views"]
  node_dashboard["Dashboard KPIs &amp; charts"]
  node_insights["Insights &amp; summaries"]
end

subgraph group_welcome["Home experience"]
  node_homepage["Product home<br/>[HomePage.jsx]"]
  node_previewparts["Live previews"]
  node_previewdata["Preview data<br/>[homePreviewData.js]"]
  node_inview["Scroll reveal hook<br/>[useInView.js]"]
end

node_visitor(("Visitor / user"))

node_visitor -->|"opens app"| node_entry
node_entry -->|"renders"| node_routing
node_entry -->|"provides theme"| node_theme
node_entry -->|"provides auth"| node_authstate
node_entry -->|"provides transactions"| node_txstate
node_routing -->|"routes through"| node_layout
node_routing -->|"guards auth pages"| node_routeguards
node_login -->|"requests auth"| node_authstate
node_authstate -->|"calls auth operations"| node_firebase
node_authstate -->|"provides user identity"| node_txstate
node_txstate -->|"loads sample rows"| node_samples
node_txstate -->|"loads sample rows"| node_sampletwo
node_txstate -->|"reads and writes"| node_browserstore
node_txstate -->|"fingerprints rows"| node_csv
node_transactionpage -->|"manages datasets"| node_txstate
node_transactionpage -->|"validates imports"| node_csv
node_transactionpage -->|"renders controls"| node_txparts
node_dashboard -->|"reads active data"| node_txstate
node_insights -->|"reads active data"| node_txstate
node_homepage -->|"renders previews"| node_previewparts
node_previewparts -->|"reads illustrative data"| node_previewdata
node_previewparts -->|"triggers reveal"| node_inview
node_homepage -->|"uses animations"| node_motion
node_transactionpage -->|"uses animations"| node_motion

click node_entry "https://github.com/sushantshinde7/finsights/blob/main/src/main.jsx"
click node_routing "https://github.com/sushantshinde7/finsights/blob/main/src/routes/AppRoutes.jsx"
click node_layout "https://github.com/sushantshinde7/finsights/blob/main/src/layouts/AppLayout.jsx"
click node_routeguards "https://github.com/sushantshinde7/finsights/tree/main/src/components/auth"
click node_theme "https://github.com/sushantshinde7/finsights/blob/main/src/context/ThemeContext.jsx"
click node_authstate "https://github.com/sushantshinde7/finsights/blob/main/src/context/AuthContext.jsx"
click node_firebase "https://github.com/sushantshinde7/finsights/blob/main/src/services/firebase.js"
click node_login "https://github.com/sushantshinde7/finsights/tree/main/src/pages/auth"
click node_txstate "https://github.com/sushantshinde7/finsights/blob/main/src/context/TransactionContext.jsx"
click node_samples "https://github.com/sushantshinde7/finsights/blob/main/src/data/mockTransactions.js"
click node_sampletwo "https://github.com/sushantshinde7/finsights/blob/main/src/data/mockTransactions2.js"
click node_csv "https://github.com/sushantshinde7/finsights/blob/main/src/lib/csv.js"
click node_transactionpage "https://github.com/sushantshinde7/finsights/blob/main/src/pages/transactions/TransactionsPage.jsx"
click node_txparts "https://github.com/sushantshinde7/finsights/tree/main/src/pages/transactions/components"
click node_dashboard "https://github.com/sushantshinde7/finsights/tree/main/src/pages/dashboard"
click node_insights "https://github.com/sushantshinde7/finsights/tree/main/src/pages/insights"
click node_homepage "https://github.com/sushantshinde7/finsights/blob/main/src/pages/home/HomePage.jsx"
click node_previewparts "https://github.com/sushantshinde7/finsights/tree/main/src/pages/home/components"
click node_previewdata "https://github.com/sushantshinde7/finsights/blob/main/src/data/homePreviewData.js"
click node_inview "https://github.com/sushantshinde7/finsights/blob/main/src/hooks/useInView.js"
click node_motion "https://github.com/sushantshinde7/finsights/blob/main/src/lib/motion.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_entry,node_routing,node_layout,node_routeguards,node_motion,node_visitor toneBlue
class node_theme,node_authstate,node_firebase,node_login toneAmber
class node_txstate,node_samples,node_sampletwo,node_browserstore,node_csv,node_transactionpage,node_txparts toneMint
class node_dashboard,node_insights toneRose
class node_homepage,node_previewparts,node_previewdata,node_inview toneIndigo
```

## Components

### App shell & access

- [App bootstrap](https://github.com/sushantshinde7/finsights/blob/main/src/main.jsx): `src/main.jsx`
- [Route dispatch](https://github.com/sushantshinde7/finsights/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`
- [App layout](https://github.com/sushantshinde7/finsights/blob/main/src/layouts/AppLayout.jsx): `src/layouts/AppLayout.jsx`
- [Route guards](https://github.com/sushantshinde7/finsights/tree/main/src/components/auth): `src/components/auth`
- [Motion utilities](https://github.com/sushantshinde7/finsights/blob/main/src/lib/motion.js): `src/lib/motion.js`

### Authentication & state

- [Theme state](https://github.com/sushantshinde7/finsights/blob/main/src/context/ThemeContext.jsx): `src/context/ThemeContext.jsx`
- [Auth state](https://github.com/sushantshinde7/finsights/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Firebase auth](https://github.com/sushantshinde7/finsights/blob/main/src/services/firebase.js): `src/services/firebase.js`
- [Sign-in & signup](https://github.com/sushantshinde7/finsights/tree/main/src/pages/auth): `src/pages/auth`

### Transactions & datasets

- [Transaction state](https://github.com/sushantshinde7/finsights/blob/main/src/context/TransactionContext.jsx): `src/context/TransactionContext.jsx`
- [Sample datasets](https://github.com/sushantshinde7/finsights/blob/main/src/data/mockTransactions.js): `src/data/mockTransactions.js`
- [Sample dataset two](https://github.com/sushantshinde7/finsights/blob/main/src/data/mockTransactions2.js): `src/data/mockTransactions2.js`
- **Browser storage**
- [CSV utilities](https://github.com/sushantshinde7/finsights/blob/main/src/lib/csv.js): `src/lib/csv.js`
- [Transaction management](https://github.com/sushantshinde7/finsights/blob/main/src/pages/transactions/TransactionsPage.jsx): `src/pages/transactions/TransactionsPage.jsx`
- [Transaction dialogs & table](https://github.com/sushantshinde7/finsights/tree/main/src/pages/transactions/components): `src/pages/transactions/components`

### Financial views

- [Dashboard KPIs & charts](https://github.com/sushantshinde7/finsights/tree/main/src/pages/dashboard): `src/pages/dashboard`
- [Insights & summaries](https://github.com/sushantshinde7/finsights/tree/main/src/pages/insights): `src/pages/insights`

### Home experience

- [Product home](https://github.com/sushantshinde7/finsights/blob/main/src/pages/home/HomePage.jsx): `src/pages/home/HomePage.jsx`
- [Live previews](https://github.com/sushantshinde7/finsights/tree/main/src/pages/home/components): `src/pages/home/components`
- [Preview data](https://github.com/sushantshinde7/finsights/blob/main/src/data/homePreviewData.js): `src/data/homePreviewData.js`
- [Scroll reveal hook](https://github.com/sushantshinde7/finsights/blob/main/src/hooks/useInView.js): `src/hooks/useInView.js`

### Other components

- **Visitor / user**

## Connections

- Visitor / user → App bootstrap: opens app
- App bootstrap → Route dispatch: renders (evidence: `src/main.jsx`)
- App bootstrap → Theme state: provides theme (evidence: `src/main.jsx`)
- App bootstrap → Auth state: provides auth (evidence: `src/main.jsx`)
- App bootstrap → Transaction state: provides transactions (evidence: `src/main.jsx`)
- Route dispatch → App layout: routes through (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Route guards: guards auth pages (evidence: `src/routes/AppRoutes.jsx`)
- Sign-in & signup → Auth state: requests auth (evidence: `src/pages/auth/LoginPage.jsx`)
- Auth state → Firebase auth: calls auth operations (evidence: `src/context/AuthContext.jsx`)
- Auth state → Transaction state: provides user identity (evidence: `src/context/TransactionContext.jsx`)
- Transaction state → Sample datasets: loads sample rows (evidence: `src/context/TransactionContext.jsx`)
- Transaction state → Sample dataset two: loads sample rows (evidence: `src/context/TransactionContext.jsx`)
- Transaction state → Browser storage: reads and writes
- Transaction state → CSV utilities: fingerprints rows (evidence: `src/context/TransactionContext.jsx`)
- Transaction management → Transaction state: manages datasets (evidence: `src/pages/transactions/TransactionsPage.jsx`)
- Transaction management → CSV utilities: validates imports (evidence: `src/pages/transactions/TransactionsPage.jsx`)
- Transaction management → Transaction dialogs & table: renders controls (evidence: `src/pages/transactions/TransactionsPage.jsx`)
- Dashboard KPIs & charts → Transaction state: reads active data (evidence: `src/pages/dashboard/DashboardPage.jsx`)
- Insights & summaries → Transaction state: reads active data (evidence: `src/pages/insights/InsightsPage.jsx`)
- Product home → Live previews: renders previews (evidence: `src/pages/home/HomePage.jsx`)
- Live previews → Preview data: reads illustrative data (evidence: `src/pages/home/components/LiveLedgerPreview.jsx`)
- Live previews → Scroll reveal hook: triggers reveal (evidence: `src/pages/home/components/LiveLedgerPreview.jsx`)
- Product home → Motion utilities: uses animations (evidence: `src/pages/home/HomePage.jsx`)
- Transaction management → Motion utilities: uses animations (evidence: `src/pages/transactions/TransactionsPage.jsx`)
