Skip to content

Afrawles/SwapSmart-Analytics

Repository files navigation

SwapSmart Analytics

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.

Key Technologies and Tools

Data Pipeline

  • 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

Visualizations

Metabase Visualizations

Airflow Dags

Airflow UI DBT Dag DBT Dag Graph generate Fake Data Dag Postgres Variables Setup

Soda Checks

Soda Checks

Data Modelling

Data Modelling

Getting Started

  1. Clone the repository:

    git clone https://github.com/Afrawles/SwapSmart-Analytics.git
  2. Navigate into the project directory:

    cd SwapSmart-Analytics

Prerequisites

  1. Rename the example configuration file:

    mv include/soda/configuration.yaml.example include/soda/configuration.yaml
  2. 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.
  3. Start Astro and Airflow:

    astro dev start
  4. Open a bash shell in the Astro container:

    astro dev bash
  5. Navigate to the DBT directory, install dependencies, and exit:

    cd include/dbt/
    dbt deps
    exit
  6. 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
  7. 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 under Networks to get the IPAddress.
  8. Set up DB connection in Metabase and build dashboards using the report tables.

Resources

Contributing

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.

License

Contact

For questions or feedback regarding SwapSmart Analytics, please contact Odeke at [email protected].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published