# shreesha666/kuberlens architecture

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

- Interactive diagram: https://gitdiagram.com/shreesha666/kuberlens
- Repository: https://github.com/shreesha666/kuberlens

## Overview

KuberLens is a Django platform for Indian-equity research and decision support. The main user journey is to find a listed instrument, inspect market and analysis data, then use the resulting insight in portfolio, trading, or backtesting workflows. Its domain includes market-data ingestion, technical and fundamental analysis, screening and AI research, portfolio accounting, and primary-market IPO tools. The index and excerpts support several internal service-to-model relationships; many UI routes and unsampled feature integrations are documented only at capability level, so those links are not asserted as verified calls.

Main entry points: [`apps/market/models.py`](https://github.com/shreesha666/kuberlens/blob/main/apps/market/models.py) (Market Records), [`services/market_data/service.py`](https://github.com/shreesha666/kuberlens/blob/main/services/market_data/service.py) (Market Data Service), [`services/screener/engine.py`](https://github.com/shreesha666/kuberlens/blob/main/services/screener/engine.py) (Stock Screener), [`services/ai/researcher.py`](https://github.com/shreesha666/kuberlens/blob/main/services/ai/researcher.py) (AI Research)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Market Data"]
  node_instruments[("Instrument Catalog<br/>[models.py]")]
  node_market_store[("Market Records<br/>[models.py]")]
  node_market_service["Market Data Service<br/>[service.py]"]
  node_market_providers["Provider Registry<br/>[registry.py]"]
  node_market_tasks["Market Refresh Tasks<br/>[tasks.py]"]
end

subgraph group_research["Research &amp; Analysis"]
  node_technical["Indicator Calculator<br/>[calculator.py]"]
  node_technical_tasks["Indicator Tasks<br/>[tasks.py]"]
  node_fundamentals["Fundamental Analysis<br/>[analyzer.py]"]
  node_screener["Stock Screener<br/>[engine.py]"]
  node_ai_research["AI Research<br/>[researcher.py]"]
  node_ml_engine["Regime &amp; Ranking<br/>[engine.py]"]
end

subgraph group_portfolio["Portfolio &amp; Trading"]
  node_portfolio_accounting["FIFO Accounting<br/>[accounting.py]"]
  node_holdings[("Holdings Ledger<br/>[models.py]")]
  node_trading_scanner["Setup Scanner<br/>[scanner.py]"]
  node_paper_engine["Paper Trading<br/>[engine.py]"]
  node_backtest_engine["Backtesting<br/>[engine.py]"]
end

subgraph group_ipo["IPO Intelligence"]
  node_ipo_views["IPO Workspace<br/>[views.py]"]
  node_ipo_services["IPO Analysis Services"]
end

subgraph group_platform["Platform Services"]
  node_dashboard["Market Dashboard<br/>[views.py]"]
  node_account_views["Account Access<br/>[views.py]"]
end

node_user(("Investor"))

node_user -->|"signs in"| node_account_views
node_user -->|"views markets"| node_dashboard
node_user -.->|"screens stocks"| node_screener
node_user -.->|"requests research"| node_ai_research
node_user -->|"explores IPOs"| node_ipo_views
node_instruments -->|"identifies listings"| node_market_store
node_market_tasks -->|"refreshes data"| node_market_service
node_market_service -->|"routes providers"| node_market_providers
node_market_service -->|"writes quotes"| node_market_store
node_market_service -->|"resolves listings"| node_instruments
node_technical_tasks -->|"calculates indicators"| node_technical
node_technical -->|"reads candles"| node_market_store
node_screener -->|"reads quotes"| node_market_store
node_screener -->|"filters listings"| node_instruments
node_ai_research -->|"reads market context"| node_market_store
node_ai_research -->|"reads holdings context"| node_holdings
node_ml_engine -->|"reads candles"| node_market_store
node_portfolio_accounting -.->|"accounts ledger"| node_holdings
node_paper_engine -->|"uses market data"| node_market_store
node_backtest_engine -->|"reads historical candles"| node_market_store
node_ipo_views -.->|"supports IPO analysis"| node_ipo_services

click node_dashboard "https://github.com/shreesha666/kuberlens/blob/main/apps/dashboard/views.py"
click node_instruments "https://github.com/shreesha666/kuberlens/blob/main/apps/instruments/models.py"
click node_market_store "https://github.com/shreesha666/kuberlens/blob/main/apps/market/models.py"
click node_market_service "https://github.com/shreesha666/kuberlens/blob/main/services/market_data/service.py"
click node_market_providers "https://github.com/shreesha666/kuberlens/blob/main/integrations/market_data/registry.py"
click node_market_tasks "https://github.com/shreesha666/kuberlens/blob/main/apps/market/tasks.py"
click node_technical "https://github.com/shreesha666/kuberlens/blob/main/services/indicators/calculator.py"
click node_technical_tasks "https://github.com/shreesha666/kuberlens/blob/main/apps/technical_analysis/tasks.py"
click node_fundamentals "https://github.com/shreesha666/kuberlens/blob/main/services/fundamentals/analyzer.py"
click node_screener "https://github.com/shreesha666/kuberlens/blob/main/services/screener/engine.py"
click node_ai_research "https://github.com/shreesha666/kuberlens/blob/main/services/ai/researcher.py"
click node_ml_engine "https://github.com/shreesha666/kuberlens/blob/main/services/ml/engine.py"
click node_portfolio_accounting "https://github.com/shreesha666/kuberlens/blob/main/services/portfolio/accounting.py"
click node_holdings "https://github.com/shreesha666/kuberlens/blob/main/apps/holdings/models.py"
click node_trading_scanner "https://github.com/shreesha666/kuberlens/blob/main/services/trading/scanner.py"
click node_paper_engine "https://github.com/shreesha666/kuberlens/blob/main/services/paper_trading/engine.py"
click node_backtest_engine "https://github.com/shreesha666/kuberlens/blob/main/services/backtesting/engine.py"
click node_ipo_views "https://github.com/shreesha666/kuberlens/blob/main/apps/ipo/views.py"
click node_ipo_services "https://github.com/shreesha666/kuberlens/tree/main/services/ipo"
click node_account_views "https://github.com/shreesha666/kuberlens/blob/main/apps/accounts/views.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_instruments,node_market_store,node_market_service,node_market_providers,node_market_tasks toneBlue
class node_technical,node_technical_tasks,node_fundamentals,node_screener,node_ai_research,node_ml_engine toneAmber
class node_portfolio_accounting,node_holdings,node_trading_scanner,node_paper_engine,node_backtest_engine toneMint
class node_ipo_views,node_ipo_services toneRose
class node_dashboard,node_account_views,node_user toneIndigo
```

## Components

### Market Data

- [Instrument Catalog](https://github.com/shreesha666/kuberlens/blob/main/apps/instruments/models.py): `apps/instruments/models.py`
- [Market Records](https://github.com/shreesha666/kuberlens/blob/main/apps/market/models.py): `apps/market/models.py`
- [Market Data Service](https://github.com/shreesha666/kuberlens/blob/main/services/market_data/service.py): `services/market_data/service.py`
- [Provider Registry](https://github.com/shreesha666/kuberlens/blob/main/integrations/market_data/registry.py): `integrations/market_data/registry.py`
- [Market Refresh Tasks](https://github.com/shreesha666/kuberlens/blob/main/apps/market/tasks.py): `apps/market/tasks.py`

### Research & Analysis

- [Indicator Calculator](https://github.com/shreesha666/kuberlens/blob/main/services/indicators/calculator.py): `services/indicators/calculator.py`
- [Indicator Tasks](https://github.com/shreesha666/kuberlens/blob/main/apps/technical_analysis/tasks.py): `apps/technical_analysis/tasks.py`
- [Fundamental Analysis](https://github.com/shreesha666/kuberlens/blob/main/services/fundamentals/analyzer.py): `services/fundamentals/analyzer.py`
- [Stock Screener](https://github.com/shreesha666/kuberlens/blob/main/services/screener/engine.py): `services/screener/engine.py`
- [AI Research](https://github.com/shreesha666/kuberlens/blob/main/services/ai/researcher.py): `services/ai/researcher.py`
- [Regime & Ranking](https://github.com/shreesha666/kuberlens/blob/main/services/ml/engine.py): `services/ml/engine.py`

### Portfolio & Trading

- [FIFO Accounting](https://github.com/shreesha666/kuberlens/blob/main/services/portfolio/accounting.py): `services/portfolio/accounting.py`
- [Holdings Ledger](https://github.com/shreesha666/kuberlens/blob/main/apps/holdings/models.py): `apps/holdings/models.py`
- [Setup Scanner](https://github.com/shreesha666/kuberlens/blob/main/services/trading/scanner.py): `services/trading/scanner.py`
- [Paper Trading](https://github.com/shreesha666/kuberlens/blob/main/services/paper_trading/engine.py): `services/paper_trading/engine.py`
- [Backtesting](https://github.com/shreesha666/kuberlens/blob/main/services/backtesting/engine.py): `services/backtesting/engine.py`

### IPO Intelligence

- [IPO Workspace](https://github.com/shreesha666/kuberlens/blob/main/apps/ipo/views.py): `apps/ipo/views.py`
- [IPO Analysis Services](https://github.com/shreesha666/kuberlens/tree/main/services/ipo): `services/ipo`

### Platform Services

- [Market Dashboard](https://github.com/shreesha666/kuberlens/blob/main/apps/dashboard/views.py): `apps/dashboard/views.py`
- [Account Access](https://github.com/shreesha666/kuberlens/blob/main/apps/accounts/views.py): `apps/accounts/views.py`

### Other components

- **Investor**

## Connections

- Investor → Account Access: signs in (evidence: `README.md`)
- Investor → Market Dashboard: views markets (evidence: `README.md`)
- Investor → Stock Screener: screens stocks
- Investor → AI Research: requests research
- Investor → IPO Workspace: explores IPOs (evidence: `README.md`)
- Instrument Catalog → Market Records: identifies listings (evidence: `apps/market/models.py`)
- Market Refresh Tasks → Market Data Service: refreshes data (evidence: `apps/market/tasks.py`)
- Market Data Service → Provider Registry: routes providers (evidence: `services/market_data/service.py`)
- Market Data Service → Market Records: writes quotes (evidence: `services/market_data/service.py`)
- Market Data Service → Instrument Catalog: resolves listings (evidence: `services/market_data/service.py`)
- Indicator Tasks → Indicator Calculator: calculates indicators (evidence: `apps/technical_analysis/tasks.py`)
- Indicator Calculator → Market Records: reads candles (evidence: `services/indicators/calculator.py`)
- Stock Screener → Market Records: reads quotes (evidence: `services/screener/engine.py`)
- Stock Screener → Instrument Catalog: filters listings (evidence: `services/screener/engine.py`)
- AI Research → Market Records: reads market context (evidence: `services/ai/researcher.py`)
- AI Research → Holdings Ledger: reads holdings context (evidence: `services/ai/researcher.py`)
- Regime & Ranking → Market Records: reads candles (evidence: `services/ml/engine.py`)
- FIFO Accounting → Holdings Ledger: accounts ledger
- Paper Trading → Market Records: uses market data (evidence: `services/paper_trading/engine.py`)
- Backtesting → Market Records: reads historical candles (evidence: `services/backtesting/engine.py`)
- IPO Workspace → IPO Analysis Services: supports IPO analysis
