# vrushaldeshpande01/vrdcapital architecture

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

- Interactive diagram: https://gitdiagram.com/vrushaldeshpande01/vrdcapital
- Repository: https://github.com/vrushaldeshpande01/vrdcapital

## Overview

VrdCapital is a portfolio-management platform for professional managers. The main workflow runs from browser-based sign-in and client selection into trading or portfolio views; order placement is validated and executed by the order service, while broker sync updates portfolio holdings and reports can be generated as PDF/XLSX. The graph also preserves client administration, market data, notifications, and alerts. Inter-service arrows follow README documentation or shown source references; unsampled integrations are not inferred.

Main entry points: [`frontend/src/api/client.ts`](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/frontend/src/api/client.ts) (API client), [`services/order-service/app/services/order_pipeline.py`](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/order_pipeline.py) (Order pipeline), [`services/portfolio-service/app/routes/portfolio.py`](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/portfolio-service/app/routes/portfolio.py) (Portfolio service), [`services/broker-service/app/services/sync_engine.py`](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/broker-service/app/services/sync_engine.py) (Broker sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["React application<br/>[App.tsx]"]
  node_webapi["API client<br/>[client.ts]"]
end

subgraph group_identity["Identity and clients"]
  node_auth["Authentication<br/>[auth.py]"]
  node_users["User management<br/>[users.py]"]
  node_clients["Client profiles<br/>[clients.py]"]
end

subgraph group_trading["Trading and brokers"]
  node_orders["Order API<br/>[orders.py]"]
  node_pipeline["Order pipeline<br/>[order_pipeline.py]"]
  node_margin["Margin checks<br/>[margin_service.py]"]
  node_executor["Order execution<br/>[order_executor.py]"]
  node_triggers["Resting-order triggers<br/>[trigger_engine.py]"]
  node_broker["Broker adapters"]
  node_sync["Broker sync<br/>[sync_engine.py]"]
  node_market["Market data<br/>[price_streamer.py]"]
end

subgraph group_portfolio["Portfolio and reporting"]
  node_portfolio["Portfolio service<br/>[portfolio.py]"]
  node_holdings["Holdings and positions<br/>[holdings.py]"]
  node_reports["Report generation<br/>[reports.py]"]
  node_reportfiles["PDF and XLSX output<br/>[pdf_generator.py]"]
end

subgraph group_realtime["Notifications"]
  node_notifications["Notifications and alerts<br/>[notifications.py]"]
  node_ws["WebSocket connections"]
end

node_browser(("Portfolio manager"))

node_browser -->|"uses"| node_webapp
node_webapp -->|"requests through"| node_webapi
node_webapi -->|"calls auth API"| node_auth
node_webapi -->|"calls client API"| node_clients
node_webapi -->|"calls orders API"| node_orders
node_webapi -->|"calls portfolio API"| node_portfolio
node_webapi -->|"calls reports API"| node_reports
node_webapi -.->|"calls notification API"| node_notifications
node_orders -->|"delegates to"| node_pipeline
node_pipeline -->|"checks margin"| node_margin
node_pipeline -->|"executes through"| node_executor
node_triggers -->|"submits triggered orders"| node_pipeline
node_sync -->|"fetches broker data"| node_broker
node_sync -->|"updates holdings"| node_holdings
node_sync -->|"updates cash balances"| node_portfolio
node_market -.->|"provides price ticks"| node_triggers
node_reports -->|"generates files"| node_reportfiles
node_notifications -->|"pushes updates"| node_ws
node_orders -.->|"publishes executed-order events"| node_portfolio
node_portfolio -->|"serves holdings data"| node_holdings

click node_webapp "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/frontend/src/App.tsx"
click node_webapi "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/frontend/src/api/client.ts"
click node_auth "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/auth-service/app/routes/auth.py"
click node_users "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/auth-service/app/routes/users.py"
click node_clients "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/client-service/app/routes/clients.py"
click node_orders "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/routes/orders.py"
click node_pipeline "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/order_pipeline.py"
click node_margin "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/margin_service.py"
click node_executor "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/order_executor.py"
click node_triggers "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/trigger_engine.py"
click node_broker "https://github.com/vrushaldeshpande01/vrdcapital/tree/main/services/broker-service/app/adapters"
click node_sync "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/broker-service/app/services/sync_engine.py"
click node_market "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/broker-service/app/services/price_streamer.py"
click node_portfolio "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/portfolio-service/app/routes/portfolio.py"
click node_holdings "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/portfolio-service/app/routes/holdings.py"
click node_reports "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/report-service/app/routes/reports.py"
click node_reportfiles "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/report-service/app/generators/pdf_generator.py"
click node_notifications "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/notification-service/app/routes/notifications.py"
click node_ws "https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/notification-service/app/services/connection_manager.py"

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_webapi toneBlue
class node_auth,node_users,node_clients toneAmber
class node_orders,node_pipeline,node_margin,node_executor,node_triggers,node_broker,node_sync,node_market toneMint
class node_portfolio,node_holdings,node_reports,node_reportfiles toneRose
class node_notifications,node_ws,node_browser toneIndigo
```

## Components

### Web application

- [React application](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Identity and clients

- [Authentication](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/auth-service/app/routes/auth.py): `services/auth-service/app/routes/auth.py`
- [User management](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/auth-service/app/routes/users.py): `services/auth-service/app/routes/users.py`
- [Client profiles](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/client-service/app/routes/clients.py): `services/client-service/app/routes/clients.py`

### Trading and brokers

- [Order API](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/routes/orders.py): `services/order-service/app/routes/orders.py`
- [Order pipeline](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/order_pipeline.py): `services/order-service/app/services/order_pipeline.py`
- [Margin checks](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/margin_service.py): `services/order-service/app/services/margin_service.py`
- [Order execution](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/order_executor.py): `services/order-service/app/services/order_executor.py`
- [Resting-order triggers](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/order-service/app/services/trigger_engine.py): `services/order-service/app/services/trigger_engine.py`
- [Broker adapters](https://github.com/vrushaldeshpande01/vrdcapital/tree/main/services/broker-service/app/adapters): `services/broker-service/app/adapters`
- [Broker sync](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/broker-service/app/services/sync_engine.py): `services/broker-service/app/services/sync_engine.py`
- [Market data](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/broker-service/app/services/price_streamer.py): `services/broker-service/app/services/price_streamer.py`

### Portfolio and reporting

- [Portfolio service](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/portfolio-service/app/routes/portfolio.py): `services/portfolio-service/app/routes/portfolio.py`
- [Holdings and positions](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/portfolio-service/app/routes/holdings.py): `services/portfolio-service/app/routes/holdings.py`
- [Report generation](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/report-service/app/routes/reports.py): `services/report-service/app/routes/reports.py`
- [PDF and XLSX output](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/report-service/app/generators/pdf_generator.py): `services/report-service/app/generators/pdf_generator.py`

### Notifications

- [Notifications and alerts](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/notification-service/app/routes/notifications.py): `services/notification-service/app/routes/notifications.py`
- [WebSocket connections](https://github.com/vrushaldeshpande01/vrdcapital/blob/main/services/notification-service/app/services/connection_manager.py): `services/notification-service/app/services/connection_manager.py`

### Other components

- **Portfolio manager**

## Connections

- Portfolio manager → React application: uses (evidence: `README.md`)
- React application → API client: requests through (evidence: `frontend/src/App.tsx`)
- API client → Authentication: calls auth API (evidence: `README.md`)
- API client → Client profiles: calls client API (evidence: `README.md`)
- API client → Order API: calls orders API (evidence: `README.md`)
- API client → Portfolio service: calls portfolio API (evidence: `README.md`)
- API client → Report generation: calls reports API (evidence: `README.md`)
- API client → Notifications and alerts: calls notification API
- Order API → Order pipeline: delegates to (evidence: `services/order-service/app/routes/orders.py`)
- Order pipeline → Margin checks: checks margin (evidence: `services/order-service/app/services/order_pipeline.py`)
- Order pipeline → Order execution: executes through (evidence: `services/order-service/app/services/order_pipeline.py`)
- Resting-order triggers → Order pipeline: submits triggered orders (evidence: `services/order-service/app/services/trigger_engine.py`)
- Broker sync → Broker adapters: fetches broker data (evidence: `services/broker-service/app/services/sync_engine.py`)
- Broker sync → Holdings and positions: updates holdings (evidence: `services/broker-service/app/services/sync_engine.py`)
- Broker sync → Portfolio service: updates cash balances (evidence: `services/broker-service/app/services/sync_engine.py`)
- Market data → Resting-order triggers: provides price ticks
- Report generation → PDF and XLSX output: generates files (evidence: `README.md`)
- Notifications and alerts → WebSocket connections: pushes updates (evidence: `services/notification-service/app/main.py`)
- Order API → Portfolio service: publishes executed-order events
- Portfolio service → Holdings and positions: serves holdings data (evidence: `README.md`)
