Logo Lanfrica

joetal24/Smart-Shamba

Domain:

agriculture

Record type:

software
Creator:
joe
Host:
# 🌾 Smart-Shamba: Local Analytics Lakehouse for Agricultural Decisions A complete, local-first analytics lakehouse that provides data-driven crop planting recommendations for Ugandan smallholder farmers. --- ## πŸ“– Project Overview **Problem:** Farmers make planting decisions based on intuition, leading to losses from weather volatility and market fluctuations. **Solution:** Smart-Shamba integrates weather, vegetation health (NDVI), and market price data to generate explainable, district-level crop recommendations. **Tech Stack:** 100% free-tier tools running locally - **Orchestration:** Mage.ai - **Storage:** DuckDB - **Transformation:** dbt Core - **Visualization:** Streamlit - **Language:** Python & SQL --- ## πŸ—οΈ Architecture ``` External APIs β†’ Mage.ai β†’ DuckDB (Raw) β†’ dbt (Transform) β†’ Streamlit ↓ Business Logic ↓ Crop Recommendations ``` ### Data Flow (ELT Pattern) 1. **Extract & Load:** Mage pipelines pull data from APIs and load into DuckDB raw tables 2. **Transform:** dbt models clean data (staging) and apply business rules (marts) 3. **Analyze:** Streamlit dashboard visualizes recommendations --- ## πŸ“‚ Project Structure ``` smart-shamba-lakehouse/ β”‚ β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ setup_project.py # Automated setup script β”œβ”€β”€ .env.template # Environment variables template β”‚ β”œβ”€β”€ mage_load_weather.py # Weather data loader β”œβ”€β”€ mage_load_prices.py # Price data loader β”œβ”€β”€ mage_load_vegetation.py # Vegetation data loader β”‚ β”œβ”€β”€ warehouse/ β”‚ └── duckdb/ β”‚ └── agri_analytics.db # DuckDB database file β”‚ β”œβ”€β”€ dbt/ β”‚ β”œβ”€β”€ dbt_project.yml # dbt configuration β”‚ β”œβ”€β”€ profiles.yml # Database connection config β”‚ β”œβ”€β”€ dbt_sources.yml # Raw data sources β”‚ β”‚ β”‚ └── models/ β”‚ β”œβ”€β”€ staging/ β”‚ β”‚ β”œβ”€β”€ dbt_stg_weather.sql # Clean weather data β”‚ β”‚ β”œβ”€β”€ dbt_stg_prices.sql # Clean price data β”‚ β”‚ └── dbt_stg_vegetat …