Logo Lanfrica

Danielmituku/medical-telegram-warehouse

Domain:

healthcare

Record type:

software
Creator:
Dan
Host:
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 …