Skip to content

ANDREYDEN/Statera

Repository files navigation

Statera

An expense tracking app with granular price distribution.

Splitting a bill with your friends? Paying for food and drinks on a Friday night? Going on a trip together?

Statera helps you organize your expenses and does the math for you. Scan receipts, mark your items, finalize expenses and equalize your group's debts.

home screen expenses expense items group members payments

Set up

Requirements

  • Flutter
  • Dart
  • derry dart package globally installed - for running custom commands
  • FlutterFire CLI globally installed - for configuring Firebase
  • Android and/or iOS emulator and/or Web for testing
  • lcov - for testing with coverage

Firebase

  • Create an iOS/Android app in the Firebase console
  • Include your google-services.json and GoogleService-Info.plist to the proper places as described in the docs

Environment

  • A .env file is required and must not be empty
  • Copy the .env.example file and fill in the values

Commands

  • flutter run - runs the project
  • flutterfire configure - initializes the connection between you Firebase project and this Flutter project
  • derry emulate - runs Firebase emulators fr local development
  • derry test - runs the tests

Full list of commands can be found in the pubspec.yaml file

Development

Testing

Unit & Widget tests

These are fast tests that verify business logic functionality and behaviour of separate widgets. Unit tests are contained under the test directory.

Run unit tests:

flutter test

Include coverage report:

flutter test --coverage

Integration tests

These tests run on a test version of Chrome while talking to an emulator version of Firebase. Integration tests are contained under the integration_test directory while the driver is defined under the test_driver directory.

Run integration tests:

  1. Install the Chrome web driver (the version should match the version of your Chrome browser)
  2. Start the Chrome web driver
    chromedriver --port=4444
    
  3. Start the Firebase emulators
    firebase emulators:start --import ./emulator_data_testing
    
  4. Runs the tests
    ./scripts/run_integration_tests_observe.sh
    

Atomated screenshots

  1. Configure the scripts/take_screenshots_on_all_devices.sh file to contain the devices you want to take screenshots on:

    ./scripts/take_screenshots.sh <device_id> <device_name>
    

    You can get the device id by running flutter devices

  2. Start the desired simulators (make sure that the user is logged out if the device was used to run the app previously)

  3. Run the script

    ./scripts/take_screenshots_on_all_devices.sh
    
  4. The screenshots will be saved in the screenshots directory

Currently, there is an issue with taking screenshots on iOS. There exists a workaround and an open PR.

Publishing

publishing

References & useful links

  • icons generated through Icon Kitchen
  • Trunk Based Development deployments with GitHub actions article