The latest ThaliApp built on Flutter.
- Install Flutter using the instructions for your platform.
- Make sure to complete the setup of Android Studio for Android or Xcode for iOS.
- Set up your favorite IDE.
- Clone this repository and open it in your IDE.
- Run
flutter runto build and start the app. - Take a look at some of the reading material.
- To run in release mode (without debugging capabilities, so the app does not feel slow), use
flutter run --release. - If you've modified anything in
lib/models/*(that usesjson_serializable) or something that is mocked in tests, renew the generated files withdart run build_runner build --delete-conflicting-outputs. - If anything does not work, run
flutter cleanand try again or runflutter doctor -vto check whether everything is installed correctly. - You can run unit and widget tests with
flutter test. For integration tests (on a real device or simulator) useflutter test integration_test. - Check out the options that can be passed with
--dart-defineinlib/config.dartto run the app using tha API of a local server, to enable TOSTI or run the app with the production API.
Reaxit uses the following packages:
- go_router for easy routing and deep linking.
- flutter_bloc for state management.
Our repository contains a Fastlane configuration that you can use to build and deploy the app for Android and iOS. To use Fastlane follow these steps:
- To be able to start you need an installation of Ruby
- The first time run
bundle install - Add the correct configuration files (see below)
- Then use fastlane by running
fastlane <platform> <command>.
| Command | Description | Platforms |
|---|---|---|
| deploy_internal | Create a release and deploy to the internal Play Store track or Testflight | Android, iOS |
| deploy_beta | Create a release and deploy to Play Store beta or Testflight with external testers | Android, iOS |
| deploy_production | Create a release and deploy to Play Store or App Store | Android, iOS |
| match | Get the certificates to sign iOS apps | iOS |
Sometimes, Apple certificates and provisioning profiles expire, which looks like Your certificate 'XXX.cer' is not valid, please check end date and renew it if necessary. So far, we've been able to solve that with fastlane match nuke development and fastlane match nuke distribution to remove existing certificates, and fastlane match development and fastlane match appstore to get new ones. This must be done on macos.
To be able to deploy the application you need a few configuration files and passwords. These are all located in the vault in the ThaliApp-Passwords repository that you get access to when you're a part of our organisation.
For a full Android build that allows deployment you need:
- A
key.propertiesfile in the Android folder containing
storeFile=<path to ThaliApp-Passwords/upload.keystore>
storePassword=<the value from ThaliaApp-Passwords/Upload Signing Keystore>
keyPassword=<the value from ThaliaApp-Passwords/Upload Signing Key>
keyAlias=appsigning
- The Google Play API key (google-play.json) placed in the root of this project
For a full iOS build that allows deployment you need:
- The password for Fastlane Match set to the environment variable
MATCH_PASSWORD, or ready for entering when you execute a fastlane command - The App Store Connect API key (app-store.p8) placed in the root of this project
If you want to build a version of the application that does not point to the staging servers you should not forget to set the THALIA_API_HOST, THALIA_OAUTH_APP_ID and THALIA_OAUTH_APP_SECRET environment variables. To include a TOSTI client, specify TOSTI_API_HOST, TOSTI_OAUTH_APP_ID and TOSTI_OAUTH_APP_SECRET.
To enable the Sentry integration you should set the SENTRY_DSN variable, such a DSN can be obtained by going to sentry.io.
To build and deploy the app with Github Actions, we need to set up a number of secrets, defined below. To make the CI/CD also work for pull requests created by dependabot, we need to specify the same exact secrets as dependabot secrets (for security reasons, workflows triggered by dependabot don't get access to actions secrets).
| Secret | Description | How to get it |
|---|---|---|
ANDROID_RELEASE_CONFIG_STORE_PASS |
Password of the keystore to use for android signing | Get from ThaliaApp-Passwords/Upload Signing Keystore |
ANDROID_RELEASE_CONFIG_KEY_PASS |
Password of the key to use for android signing | Get from ThaliaApp-Passwords/Upload Signing Key |
APPLE_API_KEY |
Base64 encoded App Store Connect API key | Get with cat ThaliaApp-Passwords/app-store.p8 | base64 |
GOOGLE_PLAY_CONFIG_JSON |
Configuration file for Google Play | Get from ThaliaApp-Passwords/google-play.json |
MATCH_PASSWORD |
Password for Fastlane Match | Get from ThaliaApp-Passwords/Fastlane Match |
PASSWORDS_REPO_DEPLOY_KEY |
A deploy key for the ThaliaApp-Passwords repository | Create one (with ssh-keygen), add to passwords repo, and use the full content of the private key file |
SENTRY_DSN |
DSN for Sentry | Get from sentry.io |
THALIA_OAUTH_APP_ID |
OAuth client ID for the Thalia API | Get from ThaliaApp-Passwords/concrexit-oauth-secrets |
THALIA_OAUTH_APP_SECRET |
OAuth client secret for the Thalia API | Get from ThaliaApp-Passwords/concrexit-oauth-secrets |
TOSTI_OAUTH_APP_ID |
OAuth client ID for the TOSTI API (leave empty to disable TOSTI) | Get from ThaliaApp-Passwords/tosti-oauth-secrets |
TOSTI_OAUTH_APP_SECRET |
OAuth client secret for the TOSTI API (leave empty to disable TOSTI) | Get from ThaliaApp-Passwords/tosti-oauth-secrets |
Follow these steps carefully to release a new version of the app.
- Test stuff, check that the new version works with the production version of the API.
- If necessary, update the version number in
pubspec.yamlandlib/config.dartand commit. The build number does not need to be changed as it will be set by fastlane. - Create a new branch for the release.
- Create a new tag on this branch.
- Create a draft release on this tag.
- Activate the testing account on concrexit: In the production admin, go to user 'appletest', check the 'active' box, and add a membership.
- Create a new version in App Store Connect with the build from the last TestFlight deployment. Perhaps also create and upload new screenshots. Submit the release for review.
- Promote the new build in the Play Store Console. Perhaps also create and upload new screenshots.
- When the iOS update has been approved, publish the iOS release, deactivate the testing account ('appletest') again, and delete its membership.
- Publish the release on GitHub.
- Increment the version number in
pubspec.yamlandlib/config.dartand commit.