Skip to content

ronyaburaihan/Weatherly-KMP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Weatherly - Kotlin Multiplatform Weather App

A modern, cross-platform weather application built with Kotlin Multiplatform and Compose Multiplatform, providing real-time weather information for Android and iOS platforms.

🌟 Features

Core Functionality

  • Real-time Weather Data: Current weather conditions with temperature, humidity, wind speed, and precipitation
  • 7-Day Forecast: Extended weather forecast with daily temperature and precipitation data
  • Detailed Weather View: Comprehensive weather details with hourly forecasts and temperature charts
  • Location-based Weather: Automatic location detection with permission handling
  • Reverse Geocoding: Display location names based on coordinates
  • Time-based Greetings: Dynamic greetings based on current time (Good Morning, Good Afternoon, etc.)
  • Weather Icons: Emoji-based weather condition indicators
  • Sunrise/Sunset Information: Daily sunrise and sunset times with visual cards

User Experience

  • Native Splash Screen: Android native splash screen with data preloading
  • Onboarding Flow: First-time user introduction screen with smooth animations
  • Permission Management: Seamless location permission requests with user-friendly screens
  • Loading States: Shimmer effects during data loading
  • Error Handling: Comprehensive error states and user feedback
  • Responsive UI: Adaptive design for different screen sizes
  • Navigation Drawer: Side menu with weather information and app navigation
  • Feedback System: User feedback collection screen
  • Smooth Animations: Crossfade transitions and animated UI elements

πŸ—οΈ Architecture

Clean Architecture Pattern

The project follows Clean Architecture principles with clear separation of concerns:

β”œβ”€β”€ Domain Layer
β”‚   β”œβ”€β”€ Models (WeatherData, LocationData, PermissionState)
β”‚   β”œβ”€β”€ Repositories (Interfaces)
β”‚   └── Use Cases (Business Logic)
β”œβ”€β”€ Data Layer
β”‚   β”œβ”€β”€ Remote (API Services)
β”‚   β”œβ”€β”€ Local (DataStore Preferences)
β”‚   β”œβ”€β”€ Repositories (Implementations)
β”‚   └── Mappers (Data Transformation)
└── Presentation Layer
    β”œβ”€β”€ ViewModels (State Management)
    β”œβ”€β”€ Screens (UI Components)
    └── Navigation

πŸ› οΈ Technology Stack

Core Technologies

  • Kotlin Multiplatform: Shared business logic across platforms
  • Compose Multiplatform: Declarative UI framework
  • Koin: Dependency injection framework
  • Ktor: HTTP client for API communication
  • DataStore: Local data persistence
  • Kotlinx Serialization: JSON serialization/deserialization
  • Navigation Compose: Type-safe screen navigation
  • Kotlinx DateTime: Date and time handling
  • Kotlinx Coroutines: Asynchronous programming

Platform-Specific

  • Android:
    • Google Play Services Location
    • Activity Result API
    • Core Splash Screen API
    • Material Design 3
  • iOS: Core Location framework

🌐 APIs Used

Weather Data

  • Open-Meteo API: Free weather API providing:
    • Current weather conditions
    • 7-day forecast
    • Hourly forecasts
    • Multiple weather parameters (temperature, humidity, wind, precipitation)
    • Weather codes for condition mapping
    • Sunrise/sunset times

Location Services

  • Nominatim API (OpenStreetMap): Reverse geocoding service for:
    • Converting coordinates to human-readable addresses
    • City, town, and village name resolution

πŸ“± Platform Support

Android

  • Minimum SDK: 24 (Android 7.0)
  • Target SDK: Latest
  • Permissions:
    • ACCESS_FINE_LOCATION
    • ACCESS_COARSE_LOCATION

iOS

  • Minimum Version: iOS 14.0+
  • Permissions: Location When In Use
  • Info.plist: NSLocationWhenInUseUsageDescription

πŸƒβ€β™‚οΈ Getting Started

Prerequisites

  • Android Studio with Kotlin Multiplatform plugin
  • Xcode (for iOS development)
  • JDK 11 or higher

Setup

  1. Clone the repository
  2. Open the project in Android Studio
  3. Sync Gradle dependencies
  4. Run on Android or iOS simulator/device

Project Structure

Weatherly/
β”œβ”€β”€ composeApp/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ commonMain/kotlin/    # Shared code
β”‚   β”‚   β”œβ”€β”€ androidMain/kotlin/   # Android-specific code
β”‚   β”‚   └── iosMain/kotlin/       # iOS-specific code
β”‚   └── build.gradle.kts
β”œβ”€β”€ iosApp/                       # iOS application wrapper
└── settings.gradle.kts

πŸ”§ Dependency Injection

The app uses Koin for dependency injection with modular organization:

  • LocalModule: DataStore and local data sources
  • NetworkModule: HTTP client and API services
  • RepositoryModule: Repository implementations
  • UseCaseModule: Business logic use cases
  • ViewModelModule: Presentation layer ViewModels
  • PlatformModule: Platform-specific dependencies

🎨 UI/UX Features

Design Elements

  • Material Design 3: Modern UI components
  • Gradient Backgrounds: Visually appealing weather displays
  • Weather Icons: Intuitive emoji-based weather representation
  • Shimmer Loading: Smooth loading animations
  • Responsive Layout: Adaptive to different screen sizes

Weather Condition Mapping

The app maps weather codes to conditions and icons:

  • Clear sky β˜€οΈ
  • Partly cloudy β›…
  • Foggy 🌫️
  • Rain 🌧️
  • Snow ❄️
  • Thunderstorm β›ˆοΈ
  • And more...

πŸ“Š State Management

ViewModels manage UI state using:

  • StateFlow: Reactive state management
  • Coroutines: Asynchronous operations
  • Result: Error handling wrapper

πŸ”’ Privacy & Permissions

  • Location data is only used for weather information
  • No personal data is stored or transmitted
  • Users can deny location access (app will show permission screen)
  • Transparent permission handling with user-friendly messages

πŸš€ Future Enhancements

  • Weather alerts and notifications
  • Multiple location support
  • Weather maps integration
  • Historical weather data
  • Customizable units (Celsius/Fahrenheit)
  • Dark/Light theme toggle
  • Weather widgets

πŸ“„ License

This project is open source and available under the MIT License.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Built with ❀️ using Kotlin Multiplatform

About

A modern, cross-platform weather application built with Kotlin Multiplatform and Compose Multiplatform, providing real-time weather information with an intuitive user experience for Android and iOS platforms.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors