An end-to-end data pipeline for Ethiopian medical business insights from Telegram channels. Uses dbt for transformation, Dagster for orchestration, YOLOv8 for image enrichment, and FastAPI for the analytical API.
# Medical Telegram Warehouse
> An end-to-end data pipeline for Ethiopian medical business insights from Telegram channels.
## π Overview
This project builds a robust data platform that generates actionable insights about Ethiopian medical businesses using data scraped from public Telegram channels. It implements a modern ELT (Extract, Load, Transform) framework with:
- **Data Extraction**: Telegram scraping using Telethon
- **Data Lake**: Raw JSON storage with partitioned structure
- **Data Warehouse**: PostgreSQL with dimensional modeling (Star Schema)
- **Transformation**: dbt for data cleaning and modeling
- **Enrichment**: YOLOv8 for image object detection
- **API**: FastAPI for analytical endpoints
- **Orchestration**: Dagster for pipeline automation
## ποΈ Architecture
```
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Telegram β β Data Lake β β PostgreSQL β
β Channels ββββββΆβ (Raw JSON) ββββββΆβ Warehouse β
βββββββββββββββββββ βββββββββββββββββββ ββββββββββ¬βββββββββ
β
βββββββββββββββββββ β
β YOLOv8 β β
β (Images) ββββββββββββββββ€
βββββββββββββββββββ β
βΌ
βββββββββββββββββββ βββββββββββββββββββ
β FastAPI βββββββ dbt β
β (Analytics) β β (Transform) β
βββββββββββββββββββ βββββββββββββββββββ
```
## π Project Structure
```
medical-telegram-warehouse/
βββ .github/workflows/ # CI/CD pipelines
βββ api/ # FastAPI application
β βββ main.py # API endpoints
β βββ database.py # DB connection
β βββ schemas.py # Pydantic models
βββ data/
β βββ raw/ # Data lake
β βββ telegram_messages/ # JSON files (YYYY-MM-DD/channel.json)
β βββ images/ # Downloaded images
βββ medical_warehouse/ # dbt project
β βββ models/
β β βββ staging/ # Cleaned raw data
β β βββ marts/ # Star schema (facts β¦