Skip to content

๐ŸŒฑ Android sustainability companion app โ€” track carbon footprints, discover eco-friendly businesses, earn achievements & learn green habits. Built with Jetpack Compose, Material 3, Hilt, Room & Canvas charts. Offline-first, MVVM + Clean Architecture. Aligned with UN SDGs 11, 12 & 13.

License

Notifications You must be signed in to change notification settings

muchaisam/EcoBloom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

329 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฑ EcoBloom

EcoBloom Logo

Your Personal Sustainability Companion
Track your carbon footprint, discover eco-friendly businesses, and learn to live more sustainably.

Platform Kotlin Compose Min SDK License


๐Ÿ“ฑ About

EcoBloom is a fully functional portfolio demo showcasing how a real-world sustainability app would work. Built with Jetpack Compose and following MVVM + Repository architecture, this project demonstrates modern Android development practices while simulating a complete user experience for tracking environmental impact, discovering sustainable businesses in Kenya, and learning about eco-friendly practices.

๐ŸŽ“ Portfolio Project: This app is a working demonstration of my Android development skills. It uses local data (Room database) to simulate all features a production sustainability app would offer, including carbon tracking, business discovery, educational content, and gamification โ€” all running fully offline without requiring backend services.

๐ŸŽฏ SDG Alignment

EcoBloom directly supports the United Nations Sustainable Development Goals:

SDG Goal How EcoBloom Contributes
๐Ÿ™๏ธ SDG 11 Sustainable Cities & Communities Promotes local sustainable businesses and eco-friendly transportation
โ™ป๏ธ SDG 12 Responsible Consumption & Production Tracks consumption patterns and encourages waste reduction
๐ŸŒ SDG 13 Climate Action Measures carbon footprint and incentivizes carbon-saving activities

โœจ Features

๐Ÿ  Dashboard

  • Carbon Footprint Overview: Real-time visualization of your environmental impact
  • Quick Actions: Log activities with one tap
  • Sustainability Score Card: See your overall eco-warrior rating
  • Progress Tracking: Weekly and monthly carbon savings at a glance

๐Ÿ“Š Activity Tracking

  • Multiple Activity Types: Transport, food, energy, shopping, recycling
  • Smart Calculations: Accurate carbon impact using verified emission factors
  • Activity History: Complete log with filtering and search
  • Streak Tracking: Maintain daily logging streaks for bonus rewards

๐Ÿช Business Directory

  • Sustainable Business Discovery: Find eco-friendly businesses near you
  • Sustainability Scores: 1โ€“5 leaf rating system based on practices
  • Categories: Restaurants, cafรฉs, groceries, fashion, transportation, energy & more
  • Detailed Profiles: Certifications, practices, contact info, and reviews
  • Kenyan Focus: Curated businesses across Nairobi, Mombasa, Kisumu, and beyond

๐Ÿ“š Learn Hub

  • Curated Articles: Expert-verified content on sustainability topics
  • Sustainability Tools: Calculators and interactive learning tools
  • SDG Tagging: Content aligned with specific sustainability goals
  • Kenyan Context: Local authors covering topics like M-KOPA solar, Lake Victoria conservation, and the Green Belt Movement

๐Ÿ† Gamification

  • Achievements & Badges: Unlock rewards for sustainable actions
  • Experience Points (XP): Level up your eco-warrior status
  • Tiered Rewards: Bronze, Silver, Gold, and Platinum badges

๐Ÿ‘ค Profile & Settings

  • Personal Statistics: Lifetime carbon savings and activity counts
  • Editable Profile: Display name, bio, location, and photo
  • Notification Preferences: Reminders and updates
  • Theme Support: Light, dark, and system-default modes

๐Ÿ› ๏ธ Tech Stack

Core

Technology Purpose
Kotlin 2.0.21 Primary programming language
Jetpack Compose (BOM 2024.11.00) Modern declarative UI toolkit
Material 3 Design system with dynamic theming
Coroutines & Flow Asynchronous programming & reactive streams

Architecture & DI

Technology Purpose
MVVM + Repository Presentation & data layer pattern
Hilt 2.52 (KSP) Dependency injection
Navigation Compose 2.8.5 Screen navigation

Data & Storage

Technology Purpose
Room 2.6.1 (KSP) Local SQLite database with Flow support
DataStore User preferences storage
Gson JSON serialization for Room type converters

Networking & Location

Technology Purpose
Retrofit 2.11.0 + OkHttp HTTP client (ready for API integration)
Google Maps + Maps Compose Map display and location services
Coil 2.7.0 Image loading and caching

Utilities

Technology Purpose
WorkManager Background task scheduling
Timber Logging
Splash Screen API Android 12+ splash screen

๐Ÿ—๏ธ Architecture

EcoBloom follows MVVM + Repository architecture with separation between presentation and data layers:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    PRESENTATION LAYER                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   Screens   โ”‚  โ”‚  ViewModels โ”‚  โ”‚     Components      โ”‚  โ”‚
โ”‚  โ”‚  (Compose)  โ”‚  โ”‚ (StateFlow) โ”‚  โ”‚  (20+ Reusable UI)  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                      DOMAIN LAYER                            โ”‚
โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚         โ”‚  Enums & Type Definitions            โ”‚             โ”‚
โ”‚         โ”‚  ActivityType, BusinessCategory,      โ”‚             โ”‚
โ”‚         โ”‚  AchievementType, CarbonCategory      โ”‚             โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                       DATA LAYER                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚    Room DB   โ”‚  โ”‚  DataStore  โ”‚  โ”‚    Repositories     โ”‚  โ”‚
โ”‚  โ”‚  (7 tables)  โ”‚  โ”‚ (Prefs)    โ”‚  โ”‚  (6 repositories)   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Architectural Decisions

  • Unidirectional Data Flow: State flows down via StateFlow, events flow up via callbacks
  • Single Source of Truth: Room database as the primary data source
  • Reactive Streams: Kotlin Flow for all reactive data updates
  • Immutable State: Data classes with copy() for state updates
  • Pre-seeded Data: DataSeeder populates demo content on first launch

๐Ÿ“ Project Structure

app/src/main/java/com/kodinova/ecobloom/
โ”œโ”€โ”€ ๐Ÿ“‚ data/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ components/        # Home screen widget composables
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ local/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ converters/    # Room type converters (Gson)
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ dao/           # 7 Room Data Access Objects
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ entity/        # 7 database entities
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ model/         # Query result models
โ”‚   โ”‚   โ””โ”€โ”€ EcoBloomDatabase.kt
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ model/             # Data models (NewsItem, WeatherData)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ repository/        # 6 repository implementations
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ ui/                # UI state classes & screen models
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ di/                    # Hilt DI modules
โ”‚   โ”œโ”€โ”€ AppModule.kt
โ”‚   โ”œโ”€โ”€ DatabaseModule.kt
โ”‚   โ””โ”€โ”€ RepositoryModule.kt
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ domain/
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ model/             # Domain enums (ActivityType, BusinessCategory, etc.)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ presentation/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ components/        # 20 reusable UI components
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ navigation/        # Route definitions
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ screens/           # 15 screen composables
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ theme/             # Material 3 theming (Color, Type, Shape, Spacing)
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ viewmodel/         # 11 ViewModels with state management
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ util/                  # Utilities
โ”‚   โ”œโ”€โ”€ CarbonCalculator.kt   # Emission factor calculations
โ”‚   โ”œโ”€โ”€ Constants.kt          # App-wide constants
โ”‚   โ”œโ”€โ”€ DataSeeder.kt         # Initial data population
โ”‚   โ”œโ”€โ”€ DateFormatter.kt      # Date formatting helpers
โ”‚   โ”œโ”€โ”€ LocationUtils.kt      # Location utilities
โ”‚   โ””โ”€โ”€ StringValidators.kt   # Input validation
โ”‚
โ”œโ”€โ”€ EcoBloom.kt               # Main NavHost & Scaffold
โ””โ”€โ”€ MainActivity.kt           # Single activity entry point

๐Ÿš€ Getting Started

Prerequisites

  • Android Studio: Ladybug (2024.2.1) or newer
  • JDK: 17 or higher
  • Android SDK: API 26+ (Android 8.0 Oreo)
  • Kotlin: 2.0.21

Installation

  1. Clone the repository

    git clone https://github.com/muchaisam/ecobloom.git
    cd ecobloom
  2. Open in Android Studio

    • File โ†’ Open โ†’ Select the project folder
    • Wait for Gradle sync to complete
  3. Build and Run

    ./gradlew assembleDebug

    Or use the Run button in Android Studio

    Note: The app runs fully offline โ€” no API keys or backend services required.

Demo Mode

The app includes a demo user (user_demo_001) with pre-seeded data for testing:

  • Sample activities and carbon tracking history
  • Pre-defined achievements
  • Curated sustainable businesses and educational articles

๐Ÿ“ธ Screenshots

Dashboard ย ย  Weekly Impact Chart ย ย  Activity Log

Business Directory ย ย  Learn Hub ย ย  Profile

Dashboard โ€ข Weekly Impact โ€ข Activity Log โ€ข Directory โ€ข Learn Hub โ€ข Profile


๐Ÿงฎ Carbon Calculation Methodology

EcoBloom uses verified emission factors to calculate carbon impact:

Activity Emission Factor Source
Car (petrol) 0.21 kg COโ‚‚/km EPA
Matatu/Bus 0.089 kg COโ‚‚/km IPCC
Boda Boda 0.103 kg COโ‚‚/km Kenya Transport
Beef meal 6.61 kg COโ‚‚/meal Our World in Data
Vegetarian meal 1.7 kg COโ‚‚/meal Our World in Data
Electricity (Kenya) 0.35 kg COโ‚‚/kWh Kenya Power
Recycling (plastic) โˆ’1.5 kg COโ‚‚/kg EPA

Carbon savings are calculated as the difference between typical consumption and sustainable alternatives.


๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Follow code standards
    • Use existing patterns in the codebase
    • Follow Kotlin coding conventions
    • Write meaningful commit messages
  4. Submit a Pull Request

Code Style

  • Follow Kotlin Coding Conventions
  • Use meaningful names for variables, functions, and classes
  • Keep composables small and focused

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Acknowledgments


๐Ÿ“ž Contact


๐ŸŒ Together, we can make a difference. One sustainable choice at a time. ๐ŸŒฑ

Made with ๐Ÿ’š in Kenya

About

๐ŸŒฑ Android sustainability companion app โ€” track carbon footprints, discover eco-friendly businesses, earn achievements & learn green habits. Built with Jetpack Compose, Material 3, Hilt, Room & Canvas charts. Offline-first, MVVM + Clean Architecture. Aligned with UN SDGs 11, 12 & 13.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages