# praveenkumar-cst/stock-market-adivsor architecture

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

- Interactive diagram: https://gitdiagram.com/praveenkumar-cst/stock-market-adivsor
- Repository: https://github.com/praveenkumar-cst/stock-market-adivsor

## Overview

This is a Flask-based Indian stock-advisor web app. A user submits a company name; the app resolves a ticker, gathers stock metrics and company details, and returns an analysis. A follow-up submission with amount and years produces an investment suggestion, while a history page uses session state. The sampled code also shows storing company data in MongoDB. The app is concentrated in main.py; the excerpt does not expose the internals of provider, persistence, or authentication flows, so those links are omitted or marked unverified.

Main entry points: [`main.py`](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py) (Flask app and pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask_app["Flask app and pages<br/>[main.py]"]
end

subgraph group_analysis["Stock analysis"]
  node_ticker_lookup["Company lookup<br/>[main.py]"]
  node_market_data["Stock metrics<br/>[main.py]"]
  node_company_profile["Company details<br/>[main.py]"]
  node_suggestion["Investment suggestion<br/>[main.py]"]
end

subgraph group_state["History and storage"]
  node_history["Search history<br/>[main.py]"]
  node_persistence["Company data storage<br/>[main.py]"]
end

node_user(("Investor"))
node_finance_provider["Yahoo Finance"]
node_mongo[("MongoDB")]

node_user -->|"submits lookup"| node_flask_app
node_flask_app -->|"resolves ticker"| node_ticker_lookup
node_flask_app -->|"fetches metrics"| node_market_data
node_flask_app -->|"fetches details"| node_company_profile
node_flask_app -->|"calculates forecast"| node_suggestion
node_flask_app -->|"updates history"| node_history
node_flask_app -->|"stores analysis"| node_persistence
node_market_data -.-> node_finance_provider
node_company_profile -.-> node_finance_provider
node_ticker_lookup -.-> node_finance_provider
node_persistence -.-> node_mongo

click node_flask_app "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py"
click node_ticker_lookup "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py"
click node_market_data "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py"
click node_company_profile "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py"
click node_suggestion "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py"
click node_history "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py"
click node_persistence "https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.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_flask_app toneBlue
class node_ticker_lookup,node_market_data,node_company_profile,node_suggestion,node_mongo toneAmber
class node_history,node_persistence toneMint
class node_user,node_finance_provider toneIndigo
```

## Components

### Web application

- [Flask app and pages](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`

### Stock analysis

- [Company lookup](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`
- [Stock metrics](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`
- [Company details](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`
- [Investment suggestion](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`

### History and storage

- [Search history](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`
- [Company data storage](https://github.com/praveenkumar-cst/stock-market-adivsor/blob/main/main.py): `main.py`

### Other components

- **Investor**
- **Yahoo Finance**
- **MongoDB**

## Connections

- Investor → Flask app and pages: submits lookup (evidence: `main.py`)
- Flask app and pages → Company lookup: resolves ticker (evidence: `main.py`)
- Flask app and pages → Stock metrics: fetches metrics (evidence: `main.py`)
- Flask app and pages → Company details: fetches details (evidence: `main.py`)
- Flask app and pages → Investment suggestion: calculates forecast (evidence: `main.py`)
- Flask app and pages → Search history: updates history (evidence: `main.py`)
- Flask app and pages → Company data storage: stores analysis (evidence: `main.py`)
- Stock metrics → Yahoo Finance
- Company details → Yahoo Finance
- Company lookup → Yahoo Finance
- Company data storage → MongoDB
