{"id":20216980,"url":"https://github.com/omidhaqi/weather_app","last_synced_at":"2025-09-09T16:49:29.461Z","repository":{"id":253652968,"uuid":"842620076","full_name":"OmidHaqi/weather_app","owner":"OmidHaqi","description":"A weather forecasting application built with Flutter, following Clean Architecture principles with a feature-based folder structure. The app features a modern blurry UI theme and offers functionalities like current weather, 5-day forecasts, and city bookmarking. This project integrates with the OpenWeatherMap API for weather data and uses the GeoDB","archived":false,"fork":false,"pushed_at":"2024-08-22T19:40:12.000Z","size":9816,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-14T06:34:41.749Z","etag":null,"topics":["clean-architecture","dart","floor","flutter","weather-app"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OmidHaqi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-14T18:08:34.000Z","updated_at":"2024-09-16T23:00:01.000Z","dependencies_parsed_at":"2024-08-22T15:32:17.782Z","dependency_job_id":"847656e6-23a2-4974-8367-75d57cd6bf49","html_url":"https://github.com/OmidHaqi/weather_app","commit_stats":null,"previous_names":["omidhaqi/weather_app"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmidHaqi%2Fweather_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmidHaqi%2Fweather_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmidHaqi%2Fweather_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmidHaqi%2Fweather_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OmidHaqi","download_url":"https://codeload.github.com/OmidHaqi/weather_app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233814538,"owners_count":18734544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-architecture","dart","floor","flutter","weather-app"],"created_at":"2024-11-14T06:31:31.773Z","updated_at":"2025-01-13T22:19:10.302Z","avatar_url":"https://github.com/OmidHaqi.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather App\n\nA weather forecasting application built with Flutter, following Clean Architecture principles with a\nfeature-based folder structure. The app features a modern blurry UI theme and offers functionalities\nlike current weather, 5-day forecasts, and city bookmarking. This project integrates with the\nOpenWeatherMap API for weather data and uses the GeoDB Cities API for city selection.\n\n\u003e [!IMPORTANT]\n\u003e The purpose of this code is to implement Clean Architecture in the program.\n\u003e You may notice bugs in the UI. If so, please submit an issue or a pull request.\n\n## Features\n\n- **Current Weather Data**: Fetch weather updates.\n- **5-Day Forecast**: View detailed weather forecasts for the next five days.\n- **City Bookmarking**: Save your favorite cities for quick access to weather updates.\n- **Blurry UI Design**: Enjoy a visually appealing, modern interface.\n- **Feature-Based Clean Architecture**: Organized code structure to separate concerns and enhance\n  maintainability.\n- **Comprehensive Testing**: Includes unit tests, bloc tests, and UI tests.\n\n## Getting Started\n\n### Prerequisites\n\nEnsure you have the following installed:\n\n- [Flutter](https://flutter.dev/docs/get-started/install)\n- [Dart](https://dart.dev/get-dart)\n\n### API Key Setup\n\nThis app requires an API key from OpenWeatherMap to fetch weather data. Follow the steps below to\nobtain and configure your API key:\n\n1. **Get an API Key from OpenWeatherMap:**\n\n    - Visit the [OpenWeatherMap website](https://home.openweathermap.org/users/sign_up) and create\n      an account if you don't have one.\n    - After signing up, log in to your account.\n    - Navigate to the [API keys section](https://home.openweathermap.org/api_keys) in your profile.\n    - Generate a new API key and copy it.\n\n2. **Add the API Key to the Project:**\n\n    - Open the file located at `lib/core/utils/constants.dart`.\n    - Locate the `apiKey1` variable and replace its value with your OpenWeatherMap API key. It\n      should look like this:\n\n    ```dart\n    class Constants {\n      static const baseUrl = 'https://api.openweathermap.org';\n\n      static const apiKey1 = 'YOUR_API_KEY_HERE'; // Add your API_KEY here\n    }\n    ```\n\n    - Replace `'YOUR_API_KEY_HERE'` with the actual API key you obtained from OpenWeatherMap.\n\n### Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/omidhaqi/weather_app.git\n    ```\n\n2. Navigate to the project directory:\n\n    ```bash\n    cd weather_app\n    ```\n\n3. Install dependencies:\n\n    ```bash\n    flutter pub get\n    ```\n\n### Running the App\n\nTo run the app on a connected device or emulator, use:\n\n```bash\nflutter run\n```\n\n### Running Tests\n\nTo run all the tests, use:\n\n```bash\nflutter test\n```\n\nTo run tests with coverage:\n\n```bash\nflutter test --coverage\n```\n\nTo run a specific test file:\n\n```bash\nflutter test test/\u003ctest_file_name\u003e.dart\n```\n\n### Code Coverage (Optional)\n\nTo generate a code coverage report:\n\n1. Run tests with coverage:\n\n    ```bash\n    flutter test --coverage\n    ```\n\n2. Generate and view the coverage report:\n\n    ```bash\n    genhtml coverage/lcov.info -o coverage/html\n    ```\n\n3. Open `coverage/html/index.html` in your browser to view the detailed report.\n\n## Project Structure\n\nThis project follows a **feature-based Clean Architecture** structure. Each feature is organized\ninto its own folder with separate layers for data, domain, and presentation:\n\n```\nlib\n├── core\n│   ├── params\n│   │   └── forecast_params.dart\n│   ├── resources\n│   │   └── date_state.dart\n│   ├── use_case\n│   │   └── use_case.dart\n│   ├── utils\n│   │   ├── constants.dart\n│   │   ├── date_converter.dart\n│   │   └── themes.dart\n│   └── widgets\n│       ├── app_background.dart\n│       ├── bottom_nav.dart\n│       ├── dot_loading_widget.dart\n│       └── main_wrapper.dart\n├── features\n│   ├── feature_bookmark\n│   │   ├── data\n│   │   │   ├── date_source\n│   │   │   │   └── local\n│   │   │   │       ├── city_dao.dart\n│   │   │   │       ├── database.dart\n│   │   │   │       └── database.g.dart\n│   │   │   └── repository\n│   │   │       └── city_repositoryimpl.dart\n│   │   ├── domain\n│   │   │   ├── entities\n│   │   │   │   └── city_entity.dart\n│   │   │   ├── repository\n│   │   │   │   └── city_repository.dart\n│   │   │   └── use_cases\n│   │   │       ├── delete_city_usecase.dart\n│   │   │       ├── get_all_city_usecase.dart\n│   │   │       ├── get_city_usecase.dart\n│   │   │       └── save_city_usecase.dart\n│   │   └── presentation\n│   │       ├── bloc\n│   │       │   ├── bookmark_bloc.dart\n│   │       │   ├── bookmark_event.dart\n│   │       │   ├── bookmark_state.dart\n│   │       │   ├── delete_city_status.dart\n│   │       │   ├── get_all_city_status.dart\n│   │       │   ├── get_city_status.dart\n│   │       │   └── save_city_status.dart\n│   │       ├── screens\n│   │       │   └── bookmark_screen.dart\n│   │       └── widgets\n│   └── feature_weather\n│       ├── data\n│       │   ├── date_sorurce\n│       │   │   └── remote\n│       │   │       └── api_provider.dart\n│       │   ├── model\n│       │   │   ├── current_city_model.dart\n│       │   │   ├── forecast_days_model.dart\n│       │   │   └── suggest_city_model.dart\n│       │   └── repository\n│       │       └── weather_repository_impl.dart\n│       ├── domain\n│       │   ├── entities\n│       │   │   ├── current_city_entity.dart\n│       │   │   ├── forecase_days_entity.dart\n│       │   │   └── suggest_city_entity.dart\n│       │   ├── repository\n│       │   │   └── weather_repository.dart\n│       │   └── use_cases\n│       │       ├── get_current_weather_usecase.dart\n│       │       ├── get_forecast_weather_usecase.dart\n│       │       └── get_suggestion_city_usecase.dart\n│       └── presentation\n│           ├── bloc\n│           │   ├── cw_status.dart\n│           │   ├── fw_status.dart\n│           │   ├── home_bloc.dart\n│           │   ├── home_event.dart\n│           │   └── home_state.dart\n│           ├── screens\n│           │   └── home_screen.dart\n│           └── widgets\n│               ├── bookmark_icon.dart\n│               ├── city_search.dart\n│               └── day_weather_view.dart\n├── locator.dart\n└── main.dart\n\n36 directories, 52 files\n```\n\n### Floor and SQLite Integration\n\n- The **Data Layer** of the `feature_bookmark` module uses **Floor** and **SQLite** for local data\n  persistence.\n- **Floor** serves as an abstraction layer over **SQLite**, simplifying database interactions.\n- The repository implementation in `feature_bookmark/data/repository/city_repositoryimpl.dart`\n  interacts with Floor DAOs and SQLite directly to manage local city data.\n\n## Libraries \u0026 Tools Used\n\n- **[bloc](https://pub.dev/packages/bloc)** - State management.\n- **[flutter_bloc](https://pub.dev/packages/flutter_bloc)** - Flutter widgets that integrate with\n  Bloc.\n- **[dio](https://pub.dev/packages/dio)** - Networking library.\n- **[sqflite](https://pub.dev/packages/sqflite)** - Local database.\n- **[floor](https://pub.dev/packages/floor)** - Database abstraction layer.\n- **[equatable](https://pub.dev/packages/equatable)** - Simplifies equality comparisons.\n- **[flutter_typeahead](https://pub.dev/packages/flutter_typeahead)** - Autocomplete text field.\n- **[get_it](https://pub.dev/packages/get_it)** - Dependency injection.\n- **[intl](https://pub.dev/packages/intl)** - Internationalization and localization.\n- **[loading_animation_widget](https://pub.dev/packages/loading_animation_widget)** - Loading\n  animations.\n- **[smooth_page_indicator](https://pub.dev/packages/smooth_page_indicator)** - Page indicators.\n- **[blurbox](https://pub.dev/packages/blurbox)** - Blurry UI components.\n- **[mockito](https://pub.dev/packages/mockito)** - Mocking library for tests.\n- **[bloc_test](https://pub.dev/packages/bloc_test)** - Testing library for Bloc.\n- **[lints](https://pub.dev/packages/lints)** - Official Dart linter rules.\n\n## API References\n\n- **[OpenWeatherMap API](https://openweathermap.org/api)** - For weather data.\n- **[GeoDB Cities API](https://rapidapi.com/wirefreethought/api/geodb-cities)** - For city search.\n\n## Screenshots\n\n|                                               |                                               |\n|:---------------------------------------------:|:---------------------------------------------:|\n| \u003cImage src=\"/screenshots/0.png\" width =\"300\"\u003e | \u003cImage src=\"/screenshots/1.png\" width =\"300\"\u003e |\n| \u003cImage src=\"/screenshots/2.png\" width =\"300\"\u003e | \u003cImage src=\"/screenshots/3.png\" width =\"300\"\u003e |\n\n---\n\n## License\n\nThis project is licensed under the Apache License - see the [LICENSE](LICENSE) file for details.\n\n##\n\n##\n\n\u003cdiv align=\"center\"\u003e\n\nVersion [0.0.1+1](https://github.com/omidhaqi/)\n\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\nDeveloped with ☕ by [Umut](https://github.com/omidhaqi/)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomidhaqi%2Fweather_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomidhaqi%2Fweather_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomidhaqi%2Fweather_app/lists"}