# abdulrahman2005-prog/stock-market-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/abdulrahman2005-prog/stock-market-intelligence
- Repository: https://github.com/abdulrahman2005-prog/stock-market-intelligence

## Overview

This repository is a Streamlit stock-analysis dashboard with a separate AAPL five-trading-day prediction flow. The historical dashboard reads precombined closing prices, filters by stock and date, computes performance and risk measures, and renders visualizations. The prediction view retrieves live AAPL data, prepares the latest features, loads a serialized model, and displays a direction and probabilities. README describes broader analysis and model-training work, but the notebooks were not sampled, so their internal stages and relationships are not mapped. Edges reflect only shown app behavior or README claims.

Main entry points: [`app.py`](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py) (Date and stock filter), [`combined_close_prices.csv`](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/combined_close_prices.csv) (Historical prices), [`aapl_5day_model.pkl`](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/aapl_5day_model.pkl) (Serialized AAPL model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_historical["Historical Analysis"]
  node_history[("Historical prices")]
  node_filter["Date and stock filter<br/>[app.py]"]
  node_metrics["Risk and performance metrics<br/>[app.py]"]
  node_visuals["Interactive visualizations<br/>[app.py]"]
end

subgraph group_forecast["AAPL Forecast"]
  node_market["Live market data<br/>[app.py]"]
  node_features["Latest feature preparation<br/>[app.py]"]
  node_model["Serialized AAPL model"]
  node_predict["Direction prediction<br/>[app.py]"]
  node_result["Forecast display<br/>[app.py]"]
end

node_user(("Dashboard user"))
node_streamlit["Streamlit app"]
node_yfinance["Yahoo Finance"]

node_user -->|"uses"| node_streamlit
node_streamlit -->|"loads"| node_history
node_streamlit -->|"collects selections"| node_filter
node_filter -->|"calculates"| node_metrics
node_filter -->|"renders"| node_visuals
node_streamlit -->|"requests data"| node_market
node_market -.->|"fetches quotes"| node_yfinance
node_market -.->|"prepares latest row"| node_features
node_features -.->|"provides features"| node_predict
node_predict -.->|"loads and predicts"| node_model
node_predict -->|"displays forecast"| node_result
node_user -.->|"requests forecast"| node_result

click node_history "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/combined_close_prices.csv"
click node_filter "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py"
click node_metrics "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py"
click node_visuals "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py"
click node_market "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py"
click node_features "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py"
click node_model "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/aapl_5day_model.pkl"
click node_predict "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py"
click node_result "https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.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_history,node_filter,node_metrics,node_visuals,node_user toneBlue
class node_market,node_features,node_model,node_predict,node_result toneAmber
class node_streamlit,node_yfinance toneIndigo
```

## Components

### Historical Analysis

- [Historical prices](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/combined_close_prices.csv): `combined_close_prices.csv`
- [Date and stock filter](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`
- [Risk and performance metrics](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`
- [Interactive visualizations](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`

### AAPL Forecast

- [Live market data](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`
- [Latest feature preparation](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`
- [Serialized AAPL model](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/aapl_5day_model.pkl): `aapl_5day_model.pkl`
- [Direction prediction](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`
- [Forecast display](https://github.com/abdulrahman2005-prog/stock-market-intelligence/blob/main/app.py): `app.py`

### Other components

- **Dashboard user**
- **Streamlit app**
- **Yahoo Finance**

## Connections

- Dashboard user → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Historical prices: loads
- Streamlit app → Date and stock filter: collects selections (evidence: `app.py`)
- Date and stock filter → Risk and performance metrics: calculates (evidence: `app.py`)
- Date and stock filter → Interactive visualizations: renders (evidence: `app.py`)
- Streamlit app → Live market data: requests data (evidence: `app.py`)
- Live market data → Yahoo Finance: fetches quotes
- Live market data → Latest feature preparation: prepares latest row (evidence: `app.py`)
- Latest feature preparation → Direction prediction: provides features (evidence: `app.py`)
- Direction prediction → Serialized AAPL model: loads and predicts
- Direction prediction → Forecast display: displays forecast (evidence: `app.py`)
- Dashboard user → Forecast display: requests forecast
