# hashmil-muhammed/fundlens-mutual_fund_analytics architecture

> Architecture diagram of the GitHub repository hashmil-muhammed/fundlens-mutual_fund_analytics, 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/hashmil-muhammed/fundlens-mutual_fund_analytics
- Repository: https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics

## Overview

Bluestock is a mutual-fund analytics and business-intelligence platform. Its principal workflow takes public and supplied fund data through ingestion, cleaning and database loading, then produces exploratory, performance and risk analysis for dashboards and investor-facing outputs. The Streamlit app reads analytical data for interactive exploration; separate scripts provide recommendations, portfolio optimization, forecasting and email reporting. README-described notebook and Power BI capabilities are included, but their internal wiring is not inferred where source excerpts were unavailable.

Main entry points: [`data/db/bluestock_mf.db`](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/data/db/bluestock_mf.db) (Analytics Database), [`reports`](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/tree/main/reports) (Analysis Reports), [`data/raw`](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/tree/main/data/raw) (Source Datasets), [`streamlit_app.py`](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/streamlit_app.py) (Interactive App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data Ingestion"]
  node_raw["Source Datasets"]
  node_livefetch["Live NAV Fetch<br/>[live_nav_fetch.py]"]
  node_cleaning["Data Cleaning"]
  node_database[("Analytics Database<br/>[bluestock_mf.db]")]
  node_pipeline["Pipeline Runner<br/>[run_pipeline.py]"]
end

subgraph group_analytics["Analytics"]
  node_eda["Exploratory Analysis"]
  node_performance["Performance Analytics"]
  node_advanced["Advanced Risk Analysis"]
  node_reports["Analysis Reports"]
end

subgraph group_experience["Dashboards"]
  node_streamlit["Interactive App<br/>[streamlit_app.py]"]
  node_powerbi["Power BI Dashboard"]
end

subgraph group_automation["Investor Tools"]
  node_recommender["Fund Recommender<br/>[recommender.py]"]
  node_optimizer["Portfolio Optimizer"]
  node_montecarlo["Monte Carlo Forecast<br/>[monte_carlo.py]"]
  node_scheduler["Report Scheduler<br/>[scheduler.py]"]
  node_email["Email Report"]
end

node_investor(("Investor"))
node_analyst(("Analyst"))
node_amfi(("AMFI / mfapi.in"))

node_analyst -->|"runs pipeline"| node_pipeline
node_pipeline -->|"runs fetch"| node_livefetch
node_livefetch -->|"fetches NAV"| node_amfi
node_analyst -->|"supplies datasets"| node_raw
node_raw -->|"cleaned by"| node_cleaning
node_cleaning -->|"loads tables"| node_database
node_database -->|"analyzed in"| node_eda
node_database -->|"metrics from"| node_performance
node_database -->|"risk data from"| node_advanced
node_eda -->|"produces insights"| node_reports
node_performance -->|"produces metrics"| node_reports
node_advanced -->|"exports analyses"| node_reports
node_investor -->|"explores funds"| node_streamlit
node_streamlit -->|"reads NAV data"| node_database
node_streamlit -->|"fallback reads"| node_raw
node_analyst -->|"views dashboard"| node_powerbi
node_investor -->|"requests recommendations"| node_recommender
node_recommender -->|"reads fund master"| node_raw
node_recommender -->|"reads scorecard"| node_reports
node_optimizer -->|"reads NAV"| node_database
node_optimizer -->|"saves frontier"| node_reports
node_montecarlo -->|"reads NAV"| node_database
node_montecarlo -->|"saves forecast"| node_reports
node_scheduler -.->|"schedules reports"| node_email
node_email -->|"queries NAV"| node_database
node_email -->|"sends summary"| node_investor

click node_raw "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/tree/main/data/raw"
click node_livefetch "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/live_nav_fetch.py"
click node_cleaning "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/02_data_cleaning.ipynb"
click node_database "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/data/db/bluestock_mf.db"
click node_eda "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/03_EDA_Analysis.ipynb"
click node_performance "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/04_Performance_Analytics.ipynb"
click node_advanced "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/05_Advanced_Analytics.ipynb"
click node_reports "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/tree/main/reports"
click node_streamlit "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/streamlit_app.py"
click node_powerbi "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/dashboard/bluestock_mf_dashboard.pbix"
click node_recommender "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/recommender.py"
click node_optimizer "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/portfolio_optimization.py"
click node_montecarlo "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/monte_carlo.py"
click node_scheduler "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/scheduler.py"
click node_email "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/send_email_report.py"
click node_pipeline "https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/run_pipeline.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_raw,node_livefetch,node_cleaning,node_database,node_pipeline toneBlue
class node_eda,node_performance,node_advanced,node_reports toneAmber
class node_streamlit,node_powerbi,node_amfi toneMint
class node_recommender,node_optimizer,node_montecarlo,node_scheduler,node_email toneRose
class node_investor,node_analyst toneIndigo
```

## Components

### Data Ingestion

- [Source Datasets](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/tree/main/data/raw): `data/raw`
- [Live NAV Fetch](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/live_nav_fetch.py): `scripts/live_nav_fetch.py`
- [Data Cleaning](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/02_data_cleaning.ipynb): `notebooks/02_data_cleaning.ipynb`
- [Analytics Database](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/data/db/bluestock_mf.db): `data/db/bluestock_mf.db`
- [Pipeline Runner](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/run_pipeline.py): `run_pipeline.py`

### Analytics

- [Exploratory Analysis](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/03_EDA_Analysis.ipynb): `notebooks/03_EDA_Analysis.ipynb`
- [Performance Analytics](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/04_Performance_Analytics.ipynb): `notebooks/04_Performance_Analytics.ipynb`
- [Advanced Risk Analysis](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/notebooks/05_Advanced_Analytics.ipynb): `notebooks/05_Advanced_Analytics.ipynb`
- [Analysis Reports](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/tree/main/reports): `reports`

### Dashboards

- [Interactive App](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/streamlit_app.py): `streamlit_app.py`
- [Power BI Dashboard](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/dashboard/bluestock_mf_dashboard.pbix): `dashboard/bluestock_mf_dashboard.pbix`

### Investor Tools

- [Fund Recommender](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/recommender.py): `scripts/recommender.py`
- [Portfolio Optimizer](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/portfolio_optimization.py): `scripts/portfolio_optimization.py`
- [Monte Carlo Forecast](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/monte_carlo.py): `scripts/monte_carlo.py`
- [Report Scheduler](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/scheduler.py): `scripts/scheduler.py`
- [Email Report](https://github.com/hashmil-muhammed/fundlens-mutual_fund_analytics/blob/main/scripts/send_email_report.py): `scripts/send_email_report.py`

### Other components

- **Investor**
- **Analyst**
- **AMFI / mfapi.in**

## Connections

- Analyst → Pipeline Runner: runs pipeline (evidence: `run_pipeline.py`)
- Pipeline Runner → Live NAV Fetch: runs fetch (evidence: `run_pipeline.py`)
- Live NAV Fetch → AMFI / mfapi.in: fetches NAV (evidence: `README.md`)
- Analyst → Source Datasets: supplies datasets (evidence: `README.md`)
- Source Datasets → Data Cleaning: cleaned by (evidence: `README.md`)
- Data Cleaning → Analytics Database: loads tables (evidence: `README.md`)
- Analytics Database → Exploratory Analysis: analyzed in (evidence: `README.md`)
- Analytics Database → Performance Analytics: metrics from (evidence: `README.md`)
- Analytics Database → Advanced Risk Analysis: risk data from (evidence: `README.md`)
- Exploratory Analysis → Analysis Reports: produces insights (evidence: `README.md`)
- Performance Analytics → Analysis Reports: produces metrics (evidence: `README.md`)
- Advanced Risk Analysis → Analysis Reports: exports analyses (evidence: `README.md`)
- Investor → Interactive App: explores funds (evidence: `README.md`)
- Interactive App → Analytics Database: reads NAV data (evidence: `streamlit_app.py`)
- Interactive App → Source Datasets: fallback reads (evidence: `streamlit_app.py`)
- Analyst → Power BI Dashboard: views dashboard (evidence: `README.md`)
- Investor → Fund Recommender: requests recommendations (evidence: `scripts/recommender.py`)
- Fund Recommender → Source Datasets: reads fund master (evidence: `scripts/recommender.py`)
- Fund Recommender → Analysis Reports: reads scorecard (evidence: `scripts/recommender.py`)
- Portfolio Optimizer → Analytics Database: reads NAV (evidence: `scripts/portfolio_optimization.py`)
- Portfolio Optimizer → Analysis Reports: saves frontier (evidence: `scripts/portfolio_optimization.py`)
- Monte Carlo Forecast → Analytics Database: reads NAV (evidence: `scripts/monte_carlo.py`)
- Monte Carlo Forecast → Analysis Reports: saves forecast (evidence: `scripts/monte_carlo.py`)
- Report Scheduler → Email Report: schedules reports
- Email Report → Analytics Database: queries NAV (evidence: `scripts/send_email_report.py`)
- Email Report → Investor: sends summary (evidence: `scripts/send_email_report.py`)
