# ravic6630/project-finance architecture

> Architecture diagram of the GitHub repository ravic6630/project-finance, 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/ravic6630/project-finance
- Repository: https://github.com/ravic6630/project-finance

## Overview

Sampada is a multi-user personal-wealth tracker: users bring in balances and transactions, then view consolidated net worth, plans, returns and alerts. The main path is the web app calling the API, which exposes domain routes backed by server services and persistent data. Its documented import, family, legacy, billing and reporting features are retained as separate branches. API wiring and the frontend-to-route details are only partly sampled, so uncertain internal calls are not drawn; feature coverage also reflects the README.

Main entry points: [`server/src/index.js`](https://github.com/ravic6630/project-finance/blob/master/server/src/index.js) (Express API), [`web/src/App.jsx`](https://github.com/ravic6630/project-finance/blob/master/web/src/App.jsx) (Web application), [`web/src/lib/api.js`](https://github.com/ravic6630/project-finance/blob/master/web/src/lib/api.js) (API client), [`server/src/routes/auth.js`](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/auth.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_webapp["Web application<br/>[App.jsx]"]
  node_dash["Dashboard<br/>[Dashboard.jsx]"]
  node_invest["Investments<br/>[Investments.jsx]"]
  node_financepages["Finance pages<br/>[Transactions.jsx]"]
  node_goalsui["Goals hub<br/>[Goals.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_api_server["Express API<br/>[index.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_auth_core["Session security<br/>[auth.js]"]
  node_db[("Application data<br/>[db.js]")]
end

subgraph group_wealth["Wealth tracking"]
  node_market_routes["Market routes<br/>[prices.js]"]
  node_market_service["Prices and FX<br/>[prices.js]"]
  node_holdings["Portfolio and assets<br/>[holdings.js]"]
  node_import["Imports<br/>[import.js]"]
  node_broker["Broker connection<br/>[broker.js]"]
  node_cashflow["Cash and transactions<br/>[transactions.js]"]
end

subgraph group_planning["Planning and reporting"]
  node_dashboard_service["Net worth summaries<br/>[networth.js]"]
  node_goals["Goal planning<br/>[goalPlan.js]"]
  node_insights["Financial insights<br/>[fi.js]"]
  node_returns["Returns and tax<br/>[returns.js]"]
end

subgraph group_account["Account services"]
  node_billing["Premium billing<br/>[billing.js]"]
  node_family["Family portfolios<br/>[family.js]"]
  node_legacy["Legacy access<br/>[legacy.js]"]
  node_alerts["Alerts and email<br/>[alerts.js]"]
  node_cron["Scheduled delivery<br/>[cron.js]"]
end

node_user(("Wealth user"))
node_marketdata["Market data providers"]
node_brokers["Broker services"]
node_payments["Payment gateways"]
node_mail["Email provider"]

node_user -->|"uses"| node_webapp
node_webapp -->|"requests"| node_api_client
node_api_client -->|"calls API"| node_api_server
node_api_server -->|"mounts routes"| node_auth
node_api_server -->|"mounts routes"| node_market_routes
node_api_server -->|"mounts routes"| node_holdings
node_api_server -->|"mounts routes"| node_import
node_api_server -->|"mounts routes"| node_broker
node_api_server -->|"mounts routes"| node_cashflow
node_api_server -->|"mounts routes"| node_billing
node_api_server -->|"mounts routes"| node_family
node_api_server -->|"mounts routes"| node_legacy
node_api_server -->|"mounts routes"| node_alerts
node_api_server -->|"mounts routes"| node_cron
node_auth -->|"uses sessions"| node_auth_core
node_api_server -->|"warms list"| node_market_service
node_market_service -.->|"fetches quotes"| node_marketdata
node_broker -.->|"connects"| node_brokers
node_billing -.->|"processes payments"| node_payments
node_cron -.->|"sends mail"| node_mail
node_webapp -->|"renders"| node_dash
node_webapp -->|"renders"| node_invest
node_webapp -->|"renders"| node_financepages
node_webapp -->|"renders"| node_goalsui

click node_webapp "https://github.com/ravic6630/project-finance/blob/master/web/src/App.jsx"
click node_dash "https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Dashboard.jsx"
click node_invest "https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Investments.jsx"
click node_financepages "https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Transactions.jsx"
click node_goalsui "https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Goals.jsx"
click node_api_client "https://github.com/ravic6630/project-finance/blob/master/web/src/lib/api.js"
click node_api_server "https://github.com/ravic6630/project-finance/blob/master/server/src/index.js"
click node_auth "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/auth.js"
click node_auth_core "https://github.com/ravic6630/project-finance/blob/master/server/src/auth.js"
click node_db "https://github.com/ravic6630/project-finance/blob/master/server/src/db.js"
click node_market_routes "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/prices.js"
click node_market_service "https://github.com/ravic6630/project-finance/blob/master/server/src/services/prices.js"
click node_holdings "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/holdings.js"
click node_import "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/import.js"
click node_broker "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/broker.js"
click node_cashflow "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/transactions.js"
click node_dashboard_service "https://github.com/ravic6630/project-finance/blob/master/server/src/services/networth.js"
click node_goals "https://github.com/ravic6630/project-finance/blob/master/server/src/services/goalPlan.js"
click node_insights "https://github.com/ravic6630/project-finance/blob/master/server/src/services/insights/fi.js"
click node_returns "https://github.com/ravic6630/project-finance/blob/master/server/src/services/returns.js"
click node_billing "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/billing.js"
click node_family "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/family.js"
click node_legacy "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/legacy.js"
click node_alerts "https://github.com/ravic6630/project-finance/blob/master/server/src/services/alerts.js"
click node_cron "https://github.com/ravic6630/project-finance/blob/master/server/src/routes/cron.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_webapp,node_dash,node_invest,node_financepages,node_goalsui,node_api_client,node_user toneBlue
class node_api_server,node_auth,node_auth_core,node_db toneAmber
class node_market_routes,node_market_service,node_holdings,node_import,node_broker,node_cashflow toneMint
class node_dashboard_service,node_goals,node_insights,node_returns toneRose
class node_billing,node_family,node_legacy,node_alerts,node_cron,node_marketdata,node_brokers,node_payments,node_mail toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/ravic6630/project-finance/blob/master/web/src/App.jsx): `web/src/App.jsx`
- [Dashboard](https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Dashboard.jsx): `web/src/pages/Dashboard.jsx`
- [Investments](https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Investments.jsx): `web/src/pages/Investments.jsx`
- [Finance pages](https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Transactions.jsx): `web/src/pages/Transactions.jsx`
- [Goals hub](https://github.com/ravic6630/project-finance/blob/master/web/src/pages/Goals.jsx): `web/src/pages/Goals.jsx`
- [API client](https://github.com/ravic6630/project-finance/blob/master/web/src/lib/api.js): `web/src/lib/api.js`

### API and identity

- [Express API](https://github.com/ravic6630/project-finance/blob/master/server/src/index.js): `server/src/index.js`
- [Authentication](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/auth.js): `server/src/routes/auth.js`
- [Session security](https://github.com/ravic6630/project-finance/blob/master/server/src/auth.js): `server/src/auth.js`
- [Application data](https://github.com/ravic6630/project-finance/blob/master/server/src/db.js): `server/src/db.js`

### Wealth tracking

- [Market routes](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/prices.js): `server/src/routes/prices.js`
- [Prices and FX](https://github.com/ravic6630/project-finance/blob/master/server/src/services/prices.js): `server/src/services/prices.js`
- [Portfolio and assets](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/holdings.js): `server/src/routes/holdings.js`
- [Imports](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/import.js): `server/src/routes/import.js`
- [Broker connection](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/broker.js): `server/src/routes/broker.js`
- [Cash and transactions](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/transactions.js): `server/src/routes/transactions.js`

### Planning and reporting

- [Net worth summaries](https://github.com/ravic6630/project-finance/blob/master/server/src/services/networth.js): `server/src/services/networth.js`
- [Goal planning](https://github.com/ravic6630/project-finance/blob/master/server/src/services/goalPlan.js): `server/src/services/goalPlan.js`
- [Financial insights](https://github.com/ravic6630/project-finance/blob/master/server/src/services/insights/fi.js): `server/src/services/insights/fi.js`
- [Returns and tax](https://github.com/ravic6630/project-finance/blob/master/server/src/services/returns.js): `server/src/services/returns.js`

### Account services

- [Premium billing](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/billing.js): `server/src/routes/billing.js`
- [Family portfolios](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/family.js): `server/src/routes/family.js`
- [Legacy access](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/legacy.js): `server/src/routes/legacy.js`
- [Alerts and email](https://github.com/ravic6630/project-finance/blob/master/server/src/services/alerts.js): `server/src/services/alerts.js`
- [Scheduled delivery](https://github.com/ravic6630/project-finance/blob/master/server/src/routes/cron.js): `server/src/routes/cron.js`

### Other components

- **Wealth user**
- **Market data providers**
- **Broker services**
- **Payment gateways**
- **Email provider**

## Connections

- Wealth user → Web application: uses
- Web application → API client: requests
- API client → Express API: calls API
- Express API → Authentication: mounts routes
- Express API → Market routes: mounts routes
- Express API → Portfolio and assets: mounts routes
- Express API → Imports: mounts routes
- Express API → Broker connection: mounts routes
- Express API → Cash and transactions: mounts routes
- Express API → Premium billing: mounts routes
- Express API → Family portfolios: mounts routes
- Express API → Legacy access: mounts routes
- Express API → Alerts and email: mounts routes
- Express API → Scheduled delivery: mounts routes
- Authentication → Session security: uses sessions
- Express API → Prices and FX: warms list
- Prices and FX → Market data providers: fetches quotes
- Broker connection → Broker services: connects
- Premium billing → Payment gateways: processes payments
- Scheduled delivery → Email provider: sends mail
- Web application → Dashboard: renders
- Web application → Investments: renders
- Web application → Finance pages: renders
- Web application → Goals hub: renders
