Skip to content

swarnsingh/Weather

Repository files navigation

Weather App

A modern Weather App built with Jetpack Compose, following Clean Architecture principles. The app fetches real-time weather data using the OpenWeatherMap API and displays current weather conditions, a 5-day forecast, and allows users to switch between Celsius and Fahrenheit.

Features

  • 🌤 Search for Cities: Find weather updates for any city.
  • 🌡 Current Weather: Displays temperature, weather condition, humidity, wind speed, pressure and weather icon.
  • 📅 5-Day Forecast: View upcoming weather conditions.
  • 🔄 Temperature Unit Toggle: Switch between Celsius and Fahrenheit.
  • 🌓 Dark Mode: Supports light and dark themes.
  • Error Handling: Graceful handling of API failures.

Upcoming Features

  • 🌍 Map View: Visualize the city’s location on a map (Bonus feature).
  • 📶 Offline Caching: Stores weather data for offline access (Bonus feature).
  • 🌓 Dark Mode Toggle: Allow users to manually switch between light and dark themes.

Tech Stack

  • UI: Jetpack Compose (Material 3, Compose Navigation)
  • Architecture: MVI + Clean Architecture
  • Networking: Retrofit + Moshi (KSP for JSON parsing)
  • Concurrency: Kotlin Coroutines + Flow
  • Dependency Injection: Hilt
  • Testing:
    • Unit Tests (ViewModel, Repository)
    • UI Tests (Compose Testing)
    • Mockk for mocking dependencies

Modules

  • app - Main module containing UI and navigation.
  • designsystem - Contains custom theming and reusable UI components.

Data Flow

  1. UI (Compose) - Displays weather data.
  2. ViewModel - Fetches weather data and handles state.
  3. Repository - Manages API and caching logic.
  4. Data Source - Fetches data from OpenWeatherMap API using Retrofit.

🔒 Secure API Key Storage

The API key is stored securely using C++ (JNI):

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages