# niharxd/mutual-fund-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/niharxd/mutual-fund-analysis
- Repository: https://github.com/niharxd/mutual-fund-analysis

## Overview

Bluestock Mutual Fund Analysis is a local analytics capstone, not a deployed investment service. Its main workflow profiles supplied CSVs, cleans them into processed datasets and a SQLite model, computes performance/risk and investor analyses, then presents results in interactive/static dashboards and final documents. The README also documents a separate risk-appetite recommender and optional MFAPI NAV download. Some subsystem internals are unsampled, so their documented capabilities are represented without asserting unverified internal calls.

Main entry points: [`run_pipeline.py`](https://github.com/niharxd/mutual-fund-analysis/blob/master/run_pipeline.py) (Local workflow), [`data/processed`](https://github.com/niharxd/mutual-fund-analysis/tree/master/data/processed) (Processed datasets), [`analytics/advanced_analytics.py`](https://github.com/niharxd/mutual-fund-analysis/blob/master/analytics/advanced_analytics.py) (Risk and investor analysis), [`day2_etl.py`](https://github.com/niharxd/mutual-fund-analysis/blob/master/day2_etl.py) (Cleaning and ETL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_raw["Source CSVs"]
  node_profile["Source profiling<br/>[data_ingestion.py]"]
  node_etl["Cleaning and ETL<br/>[day2_etl.py]"]
  node_processed["Processed datasets"]
  node_database[("SQLite model<br/>[bluestock_mf.db]")]
  node_pipeline["Local workflow<br/>[run_pipeline.py]"]
end

subgraph group_analysis["Fund analytics"]
  node_performance["Performance analysis"]
  node_advanced["Risk and investor analysis"]
  node_recommend["Fund recommender<br/>[recommender.py]"]
end

subgraph group_presentation["Results and dashboards"]
  node_interactive["Interactive dashboard<br/>[app.py]"]
  node_static["Static dashboard exports<br/>[build_dashboard.py]"]
  node_reports["PDF and presentation"]
end

subgraph group_integrations["External integrations"]
  node_fetch["Live NAV downloader<br/>[live_nav_fetch.py]"]
  node_livefiles["Fetched NAV files"]
end

node_analyst(("Analyst"))
node_mfapi{{"MFAPI"}}

node_analyst -->|"runs workflow"| node_pipeline
node_pipeline -->|"runs optionally"| node_profile
node_profile -->|"profiles CSVs"| node_raw
node_pipeline -->|"runs cleaning"| node_etl
node_etl -->|"reads CSVs"| node_raw
node_etl -->|"writes cleaned data"| node_processed
node_etl -->|"loads model"| node_database
node_pipeline -->|"runs analysis"| node_advanced
node_pipeline -->|"builds exports"| node_static
node_pipeline -->|"builds documents"| node_reports
node_processed -->|"analyzed in"| node_performance
node_performance -.->|"provides performance outputs"| node_advanced
node_processed -->|"analyzed for risk"| node_advanced
node_advanced -->|"provides analytics"| node_recommend
node_analyst -->|"selects appetite"| node_recommend
node_processed -->|"reads datasets"| node_interactive
node_reports -.->|"supplies scorecard"| node_interactive
node_processed -->|"renders trends"| node_static
node_reports -->|"reads scorecard"| node_static
node_advanced -->|"supplies risk outputs"| node_reports
node_analyst -->|"requests NAV fetch"| node_fetch
node_fetch -->|"requests histories"| node_mfapi
node_mfapi -->|"returns NAV data"| node_fetch
node_fetch -->|"saves histories"| node_livefiles

click node_raw "https://github.com/niharxd/mutual-fund-analysis/tree/master/data/raw"
click node_profile "https://github.com/niharxd/mutual-fund-analysis/blob/master/data_ingestion.py"
click node_etl "https://github.com/niharxd/mutual-fund-analysis/blob/master/day2_etl.py"
click node_processed "https://github.com/niharxd/mutual-fund-analysis/tree/master/data/processed"
click node_database "https://github.com/niharxd/mutual-fund-analysis/blob/master/bluestock_mf.db"
click node_pipeline "https://github.com/niharxd/mutual-fund-analysis/blob/master/run_pipeline.py"
click node_performance "https://github.com/niharxd/mutual-fund-analysis/blob/master/notebooks/Performance_Analytics.ipynb"
click node_advanced "https://github.com/niharxd/mutual-fund-analysis/blob/master/analytics/advanced_analytics.py"
click node_recommend "https://github.com/niharxd/mutual-fund-analysis/blob/master/recommender.py"
click node_interactive "https://github.com/niharxd/mutual-fund-analysis/blob/master/dashboard/app.py"
click node_static "https://github.com/niharxd/mutual-fund-analysis/blob/master/dashboard/build_dashboard.py"
click node_reports "https://github.com/niharxd/mutual-fund-analysis/blob/master/build_final_deliverables.py"
click node_fetch "https://github.com/niharxd/mutual-fund-analysis/blob/master/live_nav_fetch.py"
click node_livefiles "https://github.com/niharxd/mutual-fund-analysis/tree/master/data/raw/live_nav"

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_profile,node_etl,node_processed,node_database,node_pipeline toneBlue
class node_performance,node_advanced,node_recommend toneAmber
class node_interactive,node_static,node_reports,node_mfapi toneMint
class node_fetch,node_livefiles toneRose
class node_analyst toneIndigo
```

## Components

### Data ingestion

- [Source CSVs](https://github.com/niharxd/mutual-fund-analysis/tree/master/data/raw): `data/raw`
- [Source profiling](https://github.com/niharxd/mutual-fund-analysis/blob/master/data_ingestion.py): `data_ingestion.py`
- [Cleaning and ETL](https://github.com/niharxd/mutual-fund-analysis/blob/master/day2_etl.py): `day2_etl.py`
- [Processed datasets](https://github.com/niharxd/mutual-fund-analysis/tree/master/data/processed): `data/processed`
- [SQLite model](https://github.com/niharxd/mutual-fund-analysis/blob/master/bluestock_mf.db): `bluestock_mf.db`
- [Local workflow](https://github.com/niharxd/mutual-fund-analysis/blob/master/run_pipeline.py): `run_pipeline.py`

### Fund analytics

- [Performance analysis](https://github.com/niharxd/mutual-fund-analysis/blob/master/notebooks/Performance_Analytics.ipynb): `notebooks/Performance_Analytics.ipynb`
- [Risk and investor analysis](https://github.com/niharxd/mutual-fund-analysis/blob/master/analytics/advanced_analytics.py): `analytics/advanced_analytics.py`
- [Fund recommender](https://github.com/niharxd/mutual-fund-analysis/blob/master/recommender.py): `recommender.py`

### Results and dashboards

- [Interactive dashboard](https://github.com/niharxd/mutual-fund-analysis/blob/master/dashboard/app.py): `dashboard/app.py`
- [Static dashboard exports](https://github.com/niharxd/mutual-fund-analysis/blob/master/dashboard/build_dashboard.py): `dashboard/build_dashboard.py`
- [PDF and presentation](https://github.com/niharxd/mutual-fund-analysis/blob/master/build_final_deliverables.py): `build_final_deliverables.py`

### External integrations

- [Live NAV downloader](https://github.com/niharxd/mutual-fund-analysis/blob/master/live_nav_fetch.py): `live_nav_fetch.py`
- [Fetched NAV files](https://github.com/niharxd/mutual-fund-analysis/tree/master/data/raw/live_nav): `data/raw/live_nav`

### Other components

- **Analyst**
- **MFAPI**

## Connections

- Analyst → Local workflow: runs workflow (evidence: `README.md`)
- Local workflow → Source profiling: runs optionally (evidence: `run_pipeline.py`)
- Source profiling → Source CSVs: profiles CSVs (evidence: `data_ingestion.py`)
- Local workflow → Cleaning and ETL: runs cleaning (evidence: `run_pipeline.py`)
- Cleaning and ETL → Source CSVs: reads CSVs (evidence: `README.md`)
- Cleaning and ETL → Processed datasets: writes cleaned data (evidence: `README.md`)
- Cleaning and ETL → SQLite model: loads model (evidence: `README.md`)
- Local workflow → Risk and investor analysis: runs analysis (evidence: `run_pipeline.py`)
- Local workflow → Static dashboard exports: builds exports (evidence: `run_pipeline.py`)
- Local workflow → PDF and presentation: builds documents (evidence: `run_pipeline.py`)
- Processed datasets → Performance analysis: analyzed in (evidence: `README.md`)
- Performance analysis → Risk and investor analysis: provides performance outputs
- Processed datasets → Risk and investor analysis: analyzed for risk (evidence: `README.md`)
- Risk and investor analysis → Fund recommender: provides analytics (evidence: `recommender.py`)
- Analyst → Fund recommender: selects appetite (evidence: `README.md`)
- Processed datasets → Interactive dashboard: reads datasets (evidence: `README.md`)
- PDF and presentation → Interactive dashboard: supplies scorecard
- Processed datasets → Static dashboard exports: renders trends (evidence: `dashboard/build_dashboard.py`)
- PDF and presentation → Static dashboard exports: reads scorecard (evidence: `dashboard/build_dashboard.py`)
- Risk and investor analysis → PDF and presentation: supplies risk outputs (evidence: `build_final_deliverables.py`)
- Analyst → Live NAV downloader: requests NAV fetch (evidence: `README.md`)
- Live NAV downloader → MFAPI: requests histories (evidence: `live_nav_fetch.py`)
- MFAPI → Live NAV downloader: returns NAV data (evidence: `live_nav_fetch.py`)
- Live NAV downloader → Fetched NAV files: saves histories (evidence: `live_nav_fetch.py`)
