Skip to content

bosankus/Compose-Weatherify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

582 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Dependency Updates Codacy Badge Qodana Kotlin Android Version

Weatherify

A production-grade Android weather app built with Jetpack Compose, Clean Architecture, and a Kotlin Multiplatform-ready module structure. It shows real-time weather, 5-day forecasts, air quality data, and sunrise/sunset animations โ€” with multi-language support and an in-app premium upgrade flow.

Download APK


Features

Category Details
Weather Current conditions, feels-like temp, humidity, wind speed
Forecast 5-day weather forecast with hourly breakdown
Air Quality Real-time AQI with pollutant details
Location GPS-based auto-detection + manual city search
Sunrise/Sunset Custom animated sunrise/sunset arc (:sunriseui module)
Multi-language English, Bengali (เฆฌเฆพเฆ‚เฆฒเฆพ), Hindi (เคนเคฟเคจเฅเคฆเฅ€), Kannada (เฒ•เฒจเณเฒจเฒก), Malayalam (เดฎเดฒเดฏเดพเดณเด‚), Tamil (เฎคเฎฎเฎฟเฎดเฏ), Telugu (เฐคเฑ†เฐฒเฑเฐ—เฑ), Hebrew (ืขื‘ืจื™ืช) via Per-App Language API
Premium In-app purchase flow via Razorpay with a premium bottom sheet
Notifications Firebase Cloud Messaging (FCM) push notifications
In-App Updates Google Play in-app update prompts
Theming Material 3 + dynamic color + dark/light mode

Module Architecture

The project is split into clearly bounded Gradle modules. common-ui and feature-payment are Kotlin Multiplatform (KMP) modules with commonMain, androidMain, and iosMain source sets โ€” making the app iOS-portable without a full rewrite.

graph TD
    subgraph APP["๐ŸŸฆ :app  (Android)"]
        A[WeatherifyApplication\nMainActivity\nMainViewModel]
    end

    subgraph COMMON["๐ŸŸฉ :common-ui  (KMP)"]
        B[SettingsScreen\nLoginScreen\nInAppWebView\nPermissionDialog\nDateFormatter]
    end

    subgraph PAYMENT["๐ŸŸจ :feature-payment  (KMP)"]
        C[PaymentViewModel\nCreateOrderUseCase\nVerifyPaymentUseCase\nPremiumStore]
    end

    subgraph NETWORK["๐ŸŸง :network  (Android)"]
        D[Ktor Client\nWeatherApi\nKotlinx Serialization]
    end

    subgraph STORAGE["๐ŸŸฅ :storage  (Android)"]
        E[Room Database\nDataStore Preferences\nWeatherDao]
    end

    subgraph LANGUAGE["๐ŸŸช :language  (Android)"]
        F[LanguageScreen\nLocale Config]
    end

    subgraph SUNRISE["โฌ› :sunriseui  (Android)"]
        G[Sunrise/Sunset\nCanvas Animation]
    end

    APP --> COMMON
    APP --> PAYMENT
    APP --> NETWORK
    APP --> STORAGE
    APP --> LANGUAGE
    APP --> SUNRISE
Loading

Clean Architecture

Each feature inside :app is structured across three layers. Dependency arrows always point inward โ€” the domain layer has zero Android or framework dependencies.

graph LR
    subgraph Presentation["๐ŸŽจ Presentation Layer"]
        UI["Compose Screens\n(HomeScreen, CitiesListScreen\nProfileScreen, PaymentScreen)"]
        VM["ViewModels\n(MainViewModel, CitiesViewModel)"]
        UI -- "UI Events" --> VM
        VM -- "UI State (StateFlow)" --> UI
    end

    subgraph Domain["๐Ÿง  Domain Layer"]
        UC["Use Cases\n(GetWeatherReports\nGetForecastReports\nGetAirQuality...)"]
        REPO_IF["Repository Interfaces"]
        UC --> REPO_IF
    end

    subgraph Data["๐Ÿ’พ Data Layer"]
        REPO_IMPL["WeatherRepositoryImpl"]
        MAPPER["Mappers\n(Network โ†’ Storage\nStorage โ†’ Domain)"]
        REPO_IMPL --> MAPPER
    end

    subgraph External["๐ŸŒ External Sources"]
        NET[":network\nKtor + OpenWeatherMap API"]
        DB[":storage\nRoom DB + DataStore"]
    end

    VM -- "calls" --> UC
    UC -- "calls" --> REPO_IF
    REPO_IF -. "implemented by" .-> REPO_IMPL
    REPO_IMPL --> NET
    REPO_IMPL --> DB
Loading

Data Flow

OpenWeatherMap API
       โ”‚  JSON (Ktor + Kotlinx Serialization)
       โ–ผ
  :network module  โ”€โ”€โ”€โ”€โ”€โ”€โ–บ  Network Models
                                  โ”‚
                             NetworkToStorageMapper
                                  โ”‚
                                  โ–ผ
                         :storage module (Room DB / DataStore)
                                  โ”‚
                             Storage โ†’ Domain mapper
                                  โ”‚
                                  โ–ผ
                            Domain Models
                                  โ”‚
                           Use Cases (domain layer)
                                  โ”‚
                                  โ–ผ
                          MainViewModel / CitiesViewModel
                          (StateFlow<UIState>)
                                  โ”‚
                                  โ–ผ
                        Jetpack Compose UI (screens)

Tech Stack

UI

Library Version Purpose
Jetpack Compose BOM 2025.06.01 Declarative UI framework
Material 3 BOM-managed Design system + dynamic theming
Compose Navigation 2.7.7 Type-safe screen navigation
Accompanist Permissions 0.36.0 Runtime permissions in Compose
Coil Compose 2.7.0 Async image loading
Splash Screen API 1.2.0 Android 12+ splash screen

Architecture & DI

Library Version Purpose
Hilt 2.58 Dependency injection (Android)
Koin โ€” DI bridge for KMP modules
Kotlin Coroutines 1.10.2 Async & structured concurrency
StateFlow / Flow โ€” Reactive UI state management

Networking

Library Version Purpose
Ktor Client โ€” KMP-compatible HTTP client
Kotlinx Serialization โ€” JSON parsing
OkHttp MockWebServer 4.12.0 Network mocking in tests

Local Storage

Library Version Purpose
Room 2.8.4 SQLite ORM (weather cache)
DataStore Preferences 1.1.1 Key-value persistent settings
Kotlinx DateTime 0.6.2 KMP-compatible date/time

Firebase

SDK Purpose
Firebase BOM 34.10.0 BoM for consistent versions
Analytics User behaviour tracking
Remote Config Server-driven feature flags
Performance Monitoring Network + rendering metrics
Cloud Messaging (FCM) Push notifications

Testing

Library Purpose
JUnit 4 + Truth Unit assertions
Turbine 1.2.1 Flow/StateFlow testing
Mockk 1.14.9 Kotlin-first mocking
Mockito + Nhaarman Java-style mocking
Espresso Instrumentation UI tests
Hilt Testing DI in Android tests

Other

Library Purpose
Timber 5.0.1 Structured logging
LeakCanary 2.13 Memory leak detection (debug)
Razorpay 1.6.41 In-app payment checkout
Google Play In-App Update Forced/flexible update prompts
Google Play Location 21.3.0 FusedLocationProvider

Screens

MainActivity
โ”œโ”€โ”€ HomeScreen          โ€” current weather + AQI card + hourly strip
โ”œโ”€โ”€ CitiesListScreen    โ€” search & manage saved cities
โ”œโ”€โ”€ ProfileScreen       โ€” user profile & settings shortcut
โ”œโ”€โ”€ SettingsScreen      โ€” language, theme, notification toggles
โ”œโ”€โ”€ LoginScreen         โ€” authentication entry point
โ”œโ”€โ”€ PaymentScreen       โ€” Razorpay premium upgrade flow
โ””โ”€โ”€ InAppWebView        โ€” in-app browser for T&C / privacy policy

Setup & Installation

Prerequisites

  • Android Studio Narwhal or later
  • JDK 17
  • An OpenWeatherMap API key (free tier works)

Steps

  1. Clone the repo

    git clone https://github.com/bosankus/Compose-Weatherify.git
    cd Compose-Weatherify
  2. Add your API key to local.properties (create the file if it doesn't exist):

    OPEN_WEATHER_API_KEY=your_api_key_here
  3. Add google-services.json to app/ (from Firebase console โ€” required for Analytics/FCM to compile).

  4. Build & run

    ./gradlew assembleDebug
    # or just hit Run in Android Studio

Minimum Android version: API 26 (Android 8.0 Oreo)
Target SDK: 36


Contributing

Contributions are very welcome!

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Commit using the project convention:
    feat|fix|refactor|migrate|update: short description
    
  4. Push and open a Pull Request against develop

Please check the PR template before submitting.


What's Next

These are the planned improvements currently in progress or on the roadmap:

  • iOS target โ€” the KMP foundation is in place (commonMain/iosMain source sets exist in :common-ui and :feature-payment). The next step is wiring up a SwiftUI host app and completing the iOS-specific implementations.
  • Navigation v3 migration โ€” active migration branch (migration/navigation-3) moving from Navigation 2.x to the new type-safe Navigation 3 APIs with full back-stack support.
  • Offline-first strategy โ€” full read-from-cache-then-network flow using Room as the single source of truth, with explicit stale-data indicators in the UI.
  • Widget support โ€” a Glance-based home screen widget showing current temperature and conditions.
  • Wear OS companion โ€” lightweight Wear Compose screen for wrist-based weather glances.
  • CI/CD pipeline โ€” automated release builds and Play Store internal track deployments via GitHub Actions.
  • Accessibility pass โ€” semantic descriptions, touch target sizing, and TalkBack compatibility audit.

License

This project is open-sourced under the MIT License.

About

An android application for cosuming REST api from https://openweathermap.org and show today's average temperature, along with next 4 days average temperature in recyclerview.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages