SwapSmart Analytics is a comprehensive end-to-end DBT Core analytics solution designed for EV companies focused on battery swapping in East Africa. This project aims to optimize operational efficiency and enhance customer experience by leveraging data-driven insights, specifically for the battery swapping model where clients exchange depleted batteries for fully charged ones.
- Apache Airflow (Astro): For orchestrating data pipelines
- Soda: For ensuring data quality
- DBT: For transforming and modeling data
- Python: For generating synthetic data
- Metabase: For visualizing insights
-
Clone the repository:
git clone https://github.com/Afrawles/SwapSmart-Analytics.git
-
Navigate into the project directory:
cd SwapSmart-Analytics
-
Rename the example configuration file:
mv include/soda/configuration.yaml.example include/soda/configuration.yaml
-
Set up Soda account via Soda Cloud to monitor quality checks in the pipeline.
- Click on your profile and create API Keys.
- Paste the output into
include/soda/configuration.yaml
.
-
Start Astro and Airflow:
astro dev start
-
Open a bash shell in the Astro container:
astro dev bash
-
Navigate to the DBT directory, install dependencies, and exit:
cd include/dbt/ dbt deps exit
-
Access Airflow UI at:
http://localhost:8080
- Setup Postgres Variables
Admin > Variables > Add New Record then fill form > Save
- Run the
generate_data
DAG - Run the
dw_bt
DAG
- Setup Postgres Variables
-
Access Metabase at:
http://localhost:3000
or use the IP found in Docker:- Inspect the container for the IP address using
docker inspect <container-name>
and look underNetworks
to get theIPAddress
.
- Inspect the container for the IP address using
-
Set up DB connection in Metabase and build dashboards using the report tables.
- YouTube Channel: Marc Lamberti
- Connecting Metabase to PostgreSQL - 2 Docker Containers: Metabase Forum
Contributions to improve the data model, add analytical queries, or enhance workflows are welcome. Please fork the repository, make your changes, and submit a pull request.
For questions or feedback regarding SwapSmart Analytics, please contact Odeke at [email protected]
.