Skip to content

A full-stack data analytics pipeline using DBT, FastAPI, Streamlit and Postgres. Transforms raw data into modeled tables and exposes KPIs via API endpoints, with an interactive dashboard for visualization.

Notifications You must be signed in to change notification settings

shahidmalik4/analytics-pipeline-fastapi-dbt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔥 Full-Stack Data Analytics Pipeline

A modern, end-to-end data analytics pipeline that transforms raw data into business insights — using the power of PostgreSQL, DBT, FastAPI, and Streamlit.

Built for data lovers who want automation, speed, and clean visuals.


🚀 Tech Stack

Layer Tool Purpose
🗄 Data Source PostgreSQL Stores raw and transformed data
🧠 Modeling DBT SQL-based data modeling and transformations
⚙️ API Layer FastAPI RESTful API to serve KPIs & insights
📊 Dashboard Streamlit Frontend dashboard for data visualization

🛠️ Features

  • ✅ Raw data ingested and transformed using DBT
  • ✅ Modeled data exposed via FastAPI endpoints
  • ✅ Swagger UI for interactive API docs
  • ✅ Streamlit dashboard for real-time KPIs & metrics
  • ✅ Modular, scalable folder structure
  • ✅ Powered by open-source tools 💡

📁 Project Structure

D:.
│   .gitignore
│   requirements.txt
│
├───dbt_project
│   │   dbt_project.yml
│   │   README.md
│   ├───analyses
│   ├───logs
│   ├───macros
│   ├───models
│   │   ├───analytics
│   │   ├───marts
│   │   └───staging
│   ├───seeds
│   ├───snapshots
│   ├───target
│   └───tests
│
├───fastapi
│   └───app
│       ├───routers
│       ├───static
│       ├───utils
│       └───__pycache__
│
├───streamlit
│   └───app.py
│
├───logs
│   └───dbt.log

🧪 API Endpoints (Sample)

GET /v1/dimensions/customers
GET /v1/dimensions/products
GET /v1/facts/orders
GET /v1/kpis/monthly_revenue
GET /v1/kpis/top_selling_products
GET /v1/dbt_metadata/

Explore Swagger docs at:
📍 http://localhost:8000/docs


📸 Screenshots

FastAPI Swagger UI

FastAPI Swagger UI

Streamlit Dashboard

Streamlit Dashboard Streamlit Dashboard


🧰 Setup & Run Locally

# 1. Clone the repo
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name

# 2. Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Set up PostgreSQL and run DBT
# Make sure your DB is running and configured in dbt_project/profiles.yml
cd dbt_project
dbt seed
dbt run

# 5. Start FastAPI server
cd ../fastapi/app
uvicorn main:app --reload

# 6. Launch Streamlit dashboard
cd ../../streamlit
streamlit run app.py

About

A full-stack data analytics pipeline using DBT, FastAPI, Streamlit and Postgres. Transforms raw data into modeled tables and exposes KPIs via API endpoints, with an interactive dashboard for visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages