# rakeshreddy26-bit/stock-prediction-py architecture

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

- Interactive diagram: https://gitdiagram.com/rakeshreddy26-bit/stock-prediction-py
- Repository: https://github.com/rakeshreddy26-bit/stock-prediction-py

## Overview

This repository is a stock-market prediction product with CLI workflows and a FastAPI service. The main user flow is to request training, prediction, evaluation, or backtesting for a ticker; the CLI dispatches its operations to the shared core, while the API exposes history, indicator, model, prediction, tuning, and backtest endpoints. The README also describes a charting UI and multiple model choices, but their implementation is not present in the supplied tree. Edges reflect sampled calls or documented capabilities; unsampled implementation details are not inferred.

Main entry points: [`src/core.py`](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py) (Prediction Core), [`stock_market_prediction.py`](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py) (Prediction CLI), [`src/api/main.py`](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/api/main.py) (FastAPI Service), [`src/ui`](https://github.com/rakeshreddy26-bit/stock-prediction-py/tree/main/src/ui) (Prediction UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_cli["Prediction CLI"]
  node_api["FastAPI Service<br/>[main.py]"]
end

subgraph group_domain["Prediction Workflows"]
  node_core["Prediction Core<br/>[core.py]"]
  node_market_data["Market Data<br/>[core.py]"]
  node_features["Indicators and Features<br/>[core.py]"]
  node_train["Model Training"]
  node_predict["Price Prediction<br/>[core.py]"]
  node_evaluation["Model Evaluation<br/>[core.py]"]
  node_backtest["Walk-Forward Backtest<br/>[core.py]"]
  node_bundles[("Model Bundles<br/>[core.py]")]
  node_reports["Reports"]
end

subgraph group_presentation["Results Presentation"]
  node_ui["Prediction UI"]
end

node_cli_user(("CLI User"))
node_api_user(("API Client"))
node_market_service["Market Data Provider"]

node_cli_user -->|"runs command"| node_cli
node_api_user -->|"calls endpoints"| node_api
node_cli -->|"imports core"| node_core
node_api -->|"imports core"| node_core
node_core -->|"loads prices"| node_market_data
node_core -->|"computes features"| node_features
node_cli -->|"trains models"| node_train
node_core -->|"predicts prices"| node_predict
node_core -->|"evaluates models"| node_evaluation
node_core -->|"backtests models"| node_backtest
node_core -->|"loads bundles"| node_bundles
node_cli -->|"writes reports"| node_reports
node_api -.->|"serves prediction features"| node_ui
node_market_service -.->|"provides prices"| node_market_data

click node_cli "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py"
click node_api "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/api/main.py"
click node_core "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_market_data "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_features "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_train "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py"
click node_predict "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_evaluation "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_backtest "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_bundles "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py"
click node_reports "https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py"
click node_ui "https://github.com/rakeshreddy26-bit/stock-prediction-py/tree/main/src/ui"

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_cli,node_api,node_cli_user,node_api_user toneBlue
class node_core,node_market_data,node_features,node_train,node_predict,node_evaluation,node_backtest,node_bundles,node_reports toneAmber
class node_ui toneMint
class node_market_service toneIndigo
```

## Components

### User Interfaces

- [Prediction CLI](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py): `stock_market_prediction.py`
- [FastAPI Service](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/api/main.py): `src/api/main.py`

### Prediction Workflows

- [Prediction Core](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Market Data](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Indicators and Features](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Model Training](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py): `stock_market_prediction.py`
- [Price Prediction](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Model Evaluation](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Walk-Forward Backtest](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Model Bundles](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/src/core.py): `src/core.py`
- [Reports](https://github.com/rakeshreddy26-bit/stock-prediction-py/blob/main/stock_market_prediction.py): `stock_market_prediction.py`

### Results Presentation

- [Prediction UI](https://github.com/rakeshreddy26-bit/stock-prediction-py/tree/main/src/ui): `src/ui`

### Other components

- **CLI User**
- **API Client**
- **Market Data Provider**

## Connections

- CLI User → Prediction CLI: runs command (evidence: `README.md`)
- API Client → FastAPI Service: calls endpoints (evidence: `README.md`)
- Prediction CLI → Prediction Core: imports core (evidence: `stock_market_prediction.py`)
- FastAPI Service → Prediction Core: imports core (evidence: `src/api/main.py`)
- Prediction Core → Market Data: loads prices (evidence: `src/core.py`)
- Prediction Core → Indicators and Features: computes features (evidence: `src/core.py`)
- Prediction CLI → Model Training: trains models (evidence: `README.md`)
- Prediction Core → Price Prediction: predicts prices (evidence: `README.md`)
- Prediction Core → Model Evaluation: evaluates models (evidence: `README.md`)
- Prediction Core → Walk-Forward Backtest: backtests models (evidence: `README.md`)
- Prediction Core → Model Bundles: loads bundles (evidence: `src/core.py`)
- Prediction CLI → Reports: writes reports (evidence: `stock_market_prediction.py`)
- FastAPI Service → Prediction UI: serves prediction features (evidence: `README.md`)
- Market Data Provider → Market Data: provides prices (evidence: `README.md`)
