# omarjebbari/crypto-bigdata-project architecture

> Architecture diagram of the GitHub repository omarjebbari/crypto-bigdata-project, 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/omarjebbari/crypto-bigdata-project
- Repository: https://github.com/omarjebbari/crypto-bigdata-project

## Overview

This is a Lambda-style cryptocurrency analytics platform. Binance ticker events flow through Kafka and Spark Streaming into HBase, which serves the Flask live dashboard, predictions, and news-aware chatbot. A separate Airflow-orchestrated batch path collects Yahoo Finance data, trains hourly and daily XGBoost models, and stores results for the Streamlit analytics dashboard. The README also describes HDFS historical storage and MongoDB batch aggregation; those links are shown at subsystem level where source excerpts do not expose every transfer.

Main entry points: [`airflow/dags/batch_pipeline_dag.py`](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/airflow/dags/batch_pipeline_dag.py) (Batch scheduler), [`dashboard/app.py`](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/app.py) (News-aware assistant), [`batch/data_pipeline_1d.py`](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/data_pipeline_1d.py) (Daily model pipeline), [`batch/data_pipeline_1h.py`](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/data_pipeline_1h.py) (Hourly model pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_realtime["Real-time analytics"]
  node_producer["Ticker producer<br/>[producer.py]"]
  node_kafka["Kafka topics"]
  node_stream["Stream processor<br/>[spark_streaming.py]"]
  node_writer["HBase writer<br/>[hbase_writer.py]"]
  node_hbase[("Live market store")]
end

subgraph group_batch["Batch analytics"]
  node_airflow["Batch scheduler"]
  node_yahoo["Yahoo collector<br/>[yahoo_producer.py]"]
  node_daily["Daily model pipeline"]
  node_hourly["Hourly model pipeline"]
  node_hdfs[("Historical/model store")]
  node_mongo_writer["Batch result writer<br/>[write_to_mongo.py]"]
  node_mongo[("Batch results")]
end

subgraph group_interfaces["User interfaces"]
  node_flask["Live dashboard API<br/>[app.py]"]
  node_web["Live dashboard client<br/>[script.js]"]
  node_streamlit["Batch dashboard"]
end

subgraph group_assistant["Market assistant"]
  node_chat["News-aware assistant<br/>[app.py]"]
end

node_user(("Dashboard user"))
node_binance["Binance feed"]
node_news["NewsAPI"]
node_gemini["Gemini LLM"]

node_binance -->|"streams tickers"| node_producer
node_producer -->|"publishes ticks"| node_kafka
node_kafka -->|"streams records"| node_stream
node_stream -->|"writes batches"| node_writer
node_writer -->|"stores live data"| node_hbase
node_airflow -->|"runs collector"| node_yahoo
node_airflow -->|"runs hourly job"| node_hourly
node_airflow -->|"runs daily job"| node_daily
node_airflow -->|"runs result writer"| node_mongo_writer
node_yahoo -.->|"publishes history"| node_kafka
node_daily -->|"writes parquet/models"| node_hdfs
node_daily -->|"reads history"| node_kafka
node_hourly -->|"reads history"| node_kafka
node_hourly -->|"stores models"| node_hdfs
node_mongo_writer -->|"stores predictions"| node_mongo
node_hbase -->|"serves market data"| node_flask
node_flask -.->|"serves dashboard API"| node_web
node_web -->|"requests live data"| node_flask
node_user -.->|"views analytics"| node_web
node_mongo -->|"supplies batch results"| node_streamlit
node_user -.->|"explores history"| node_streamlit
node_flask -->|"routes questions"| node_chat
node_chat -->|"fetches articles"| node_news
node_chat -.->|"requests analysis"| node_gemini
node_chat -->|"reads market context"| node_hbase

click node_producer "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/docker/crypto-producer/producer.py"
click node_stream "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/streaming/spark_streaming.py"
click node_writer "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/streaming/utils/hbase_writer.py"
click node_airflow "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/airflow/dags/batch_pipeline_dag.py"
click node_yahoo "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/airflow/scripts/yahoo_producer.py"
click node_daily "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/data_pipeline_1d.py"
click node_hourly "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/data_pipeline_1h.py"
click node_mongo_writer "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/write_to_mongo.py"
click node_flask "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/app.py"
click node_web "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/static/script.js"
click node_streamlit "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/streamlit_batch_dashboard.py"
click node_chat "https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/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_producer,node_kafka,node_stream,node_writer,node_hbase,node_user toneBlue
class node_airflow,node_yahoo,node_daily,node_hourly,node_hdfs,node_mongo_writer,node_mongo toneAmber
class node_flask,node_web,node_streamlit,node_news toneMint
class node_chat toneRose
class node_binance,node_gemini toneIndigo
```

## Components

### Real-time analytics

- [Ticker producer](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/docker/crypto-producer/producer.py): `docker/crypto-producer/producer.py`
- **Kafka topics**
- [Stream processor](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/streaming/spark_streaming.py): `streaming/spark_streaming.py`
- [HBase writer](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/streaming/utils/hbase_writer.py): `streaming/utils/hbase_writer.py`
- **Live market store**

### Batch analytics

- [Batch scheduler](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/airflow/dags/batch_pipeline_dag.py): `airflow/dags/batch_pipeline_dag.py`
- [Yahoo collector](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/airflow/scripts/yahoo_producer.py): `airflow/scripts/yahoo_producer.py`
- [Daily model pipeline](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/data_pipeline_1d.py): `batch/data_pipeline_1d.py`
- [Hourly model pipeline](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/data_pipeline_1h.py): `batch/data_pipeline_1h.py`
- **Historical/model store**
- [Batch result writer](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/write_to_mongo.py): `batch/write_to_mongo.py`
- **Batch results**

### User interfaces

- [Live dashboard API](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/app.py): `dashboard/app.py`
- [Live dashboard client](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/static/script.js): `dashboard/static/script.js`
- [Batch dashboard](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/batch/streamlit_batch_dashboard.py): `batch/streamlit_batch_dashboard.py`

### Market assistant

- [News-aware assistant](https://github.com/omarjebbari/crypto-bigdata-project/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Dashboard user**
- **Binance feed**
- **NewsAPI**
- **Gemini LLM**

## Connections

- Binance feed → Ticker producer: streams tickers (evidence: `README.md`)
- Ticker producer → Kafka topics: publishes ticks (evidence: `docker/crypto-producer/producer.py`)
- Kafka topics → Stream processor: streams records (evidence: `streaming/spark_streaming.py`)
- Stream processor → HBase writer: writes batches (evidence: `streaming/spark_streaming.py`)
- HBase writer → Live market store: stores live data (evidence: `streaming/utils/hbase_writer.py`)
- Batch scheduler → Yahoo collector: runs collector (evidence: `airflow/dags/batch_pipeline_dag.py`)
- Batch scheduler → Hourly model pipeline: runs hourly job (evidence: `airflow/dags/batch_pipeline_dag.py`)
- Batch scheduler → Daily model pipeline: runs daily job (evidence: `airflow/dags/batch_pipeline_dag.py`)
- Batch scheduler → Batch result writer: runs result writer (evidence: `airflow/dags/batch_pipeline_dag.py`)
- Yahoo collector → Kafka topics: publishes history
- Daily model pipeline → Historical/model store: writes parquet/models (evidence: `batch/data_pipeline_1d.py`)
- Daily model pipeline → Kafka topics: reads history (evidence: `batch/data_pipeline_1d.py`)
- Hourly model pipeline → Kafka topics: reads history (evidence: `batch/data_pipeline_1h.py`)
- Hourly model pipeline → Historical/model store: stores models (evidence: `batch/data_pipeline_1h.py`)
- Batch result writer → Batch results: stores predictions (evidence: `README.md`)
- Live market store → Live dashboard API: serves market data (evidence: `dashboard/app.py`)
- Live dashboard API → Live dashboard client: serves dashboard API
- Live dashboard client → Live dashboard API: requests live data (evidence: `dashboard/static/script.js`)
- Dashboard user → Live dashboard client: views analytics
- Batch results → Batch dashboard: supplies batch results (evidence: `batch/streamlit_batch_dashboard.py`)
- Dashboard user → Batch dashboard: explores history (evidence: `README.md`)
- Live dashboard API → News-aware assistant: routes questions (evidence: `dashboard/app.py`)
- News-aware assistant → NewsAPI: fetches articles (evidence: `dashboard/app.py`)
- News-aware assistant → Gemini LLM: requests analysis (evidence: `README.md`)
- News-aware assistant → Live market store: reads market context (evidence: `dashboard/app.py`)
