Rock 'n' Roll Band Weather Track is a cross-platform mobile application (Android and iOS) to track the weather fashionably for a rock'n'roll band staff. Note that the develop
branch is the most up-to-date, I've been making regular changes to improve the product.
- Features
- Screenshots
- App Architecture & Folder Structure
- Requirements
- Configure Environment Variables
- Getting Started
This application has the following features
- A list of cities for upcoming concerts
- Silverstone, UK
- São Paulo, Brazil
- Melbourne, Australia
- Monte Carlo, Monaco
- Search functionality (Find by city name)
- Offline support using Hive (works with airplane mode)
- Cross-platform (tested on Pixel 6a, iPhone 15 Pro and iPad Pro)
- Support for multiple resolutions and sizes (tested on Pixel 4 and Pixel C Tab)
- Shows current weather info for each city
- Shows the next 5 days forecast for each city
The project adopts Clean Architecture principles to segregate the Presentation, Domain, and Data layers, and also employing a feature-first approach to folder structuring facilitates maintenance.
lib
├── app
│ ├── modules
│ │ └── weathers
│ │ ├── data
│ │ │ ├── datasources
│ │ │ ├── models
│ │ │ ├── repositories
│ │ ├── domain
│ │ │ ├── adapters
│ │ │ ├── entities
│ │ │ ├── repositories
│ │ │ ├── usecases
│ │ └── presentation
│ │ ├── cubits
│ │ ├── screens
│ │ └── widgets
│ ├── shared
│ │ ├── errors
│ │ ├── helpers
│ │ ├── routes
│ │ ├── services
│ │ ├── theme
│ │ └── utilities
│ └── app.dart
└── main.dart
main.dart
file serves as the app's entry point, initializing the app's components and configurations.modules
folder organizes the codebase into feature-specific modules, each containing it's owndata
,domain
, andpresentation
layers.shared
folder hosts reusable components and utilities utilized across features.helpers
folder contains specific utility functions, classes, or modules designed to assist with particular tasks.services
folder encompasses modules responsible for providing various application-wide services, such as networking.utilities
folder houses general-purpose utility functions, classes, or modules that serve a wide range of functionalities.
- Operating System (Windows, Linux, or MacOS)
- IDE with Flutter SDK installed (Visual Studio Code, Android Studio, etc.)
- Knowledge of Dart and Flutter
- Emulator or Mobile Device
- Knowledge of environment variables
- Hands to code 😄
NOTE: This project uses Flutter version 3.13.8
You will need to have environment variables configured for the project to function properly, if you don't you will encounter errors particularly while trying to fetch weather information. Fear not though 😁, the bulk of the work has been done so all you need is to get your OpenWeather APP ID (or API KEY) that will be used to fetch weather information and create a .env
file.
To get your OpenWeather APP ID, visit this link (if you do not have an OpenWeather account yet, you will need to create one)
Create a .env
file in the base of your project
rock_n_roll_forecast
...
├── ...
├── .env
├── ...
└── ...
Add the following to the .env
file
APP_ID=APP ID from OpenWeather API
BASE_URL=https://api.openweathermap.org
NOTE: This project uses Flutter version 3.13.8
1. Clone the Repository: Open your terminal and clone the "rock_n_roll_forecast" repository to your local machine:
$ git clone https://github.com/devwraithe/rock_n_roll_forecast
2. Navigate to the Project Folder: Change your working directory to the project folder:
$ cd rock_n_roll_forecast
3. Install the Dependencies: Install the project's dependencies using pub (Dart Package Manager):
$ flutter pub get
Please make sure you have either an emulator or a mobile device connected to your IDE. Here is a guide from the Android Developers' documentation to help you set up a device or an emulator.
NOTE: You must configure environment variables as instructed here for the project to function properly.
Option 1: If you intend to run the project via the command line using flutter run
, you will need to attach additional arguments to the command to be able to pull the environment variables from the .env
file and include it in the project at compile-time.
flutter run --dart-define-from-file=.env
Option 2: If you'd prefer to run the project directly on Android Studio or Visual Studio Code (not in the command line), you should edit your Run/Debug configuration, the below image shows how you can configure your main.dart
on Android Studio to include your .env
at compile-time.
The test
folder is similar to the lib
folder with the addition of some utilities for testing. More tests are being added.
mockito
creates mocks and stubs in unit tests to isolate and emulate dependencies.
bloc_test
is used for testing BLoC implementations by providing utilities for mocking.
To explore the test coverage, run tests with the --coverage argument
$ flutter test --coverage
To generate coverage files for the test, you might need to install lcov
if you don't have it installed already. To install on MacOS & Linux, run brew install lcov
and to install on Windows, run choco install lcov
, then you should run the following code to generate the test coverage:
$ genhtml coverage/lcov.info -o coverage/html
To open the generated html file
$ open coverage/html/index.html