anyway/frontend/README.md
Remy Moll db821b4856
Some checks failed
Build and release APK / Build APK (pull_request) Failing after 9m4s
cleanup and documentation
2024-09-18 16:07:20 +02:00

57 lines
2.6 KiB
Markdown

# Frontend
The frontend of this project is a Flutter application designed to run on both Android and iOS devices (and possibly as a PWA). The frontend is responsible for displaying the user interface and handling user input. It communicates with the backend via a REST-api to retrieve and send data.
## Getting Started
The flutter application is divided into multiple chunks of code.
- the `lib` directory contains the main code of the application.
- the `android` and `ios` directories contain platform-specific code.
- the root directory contains configuration files and metadata.
To run the application, you need to have the Flutter SDK installed. You can find instructions on how to do this [here](https://flutter.dev/docs/get-started/install).
Once you have the Flutter SDK installed, you can locally install the dependencies by running:
```bash
flutter pub get
```
## Development
### ...
### Icons and logos
The application uses a custom launcher icon and splash screen. These are managed platform-independently using the `flutter_launcher_icons` package.
To update the icons, change the `flutter_launcher_icons.yaml` configuration file. Especially the `image_path` is relevant. Then run
```bash
dart run flutter_launcher_icons
```
### Deploying a new version
To truly deploy a new version of the application, i.e. to the official app stores, a special CI step is required. This listens for new tags. To create a new tag position yourself on the main branch and run
```bash
git tag -a v<name> -m "Release <name>"
git push origin v<name>
```
We adhere to the [Semantic Versioning](https://semver.org/) standard, so the tag should be of the form `v0.1.8` for example.
## Fastlane - in depth
The application is deployed to the Google Play Store and the Apple App Store using fastlane: [https://docs.fastlane.tools/](https://docs.fastlane.tools/)
Fastlane is installed as a Ruby gem. Since the bundler-gemfile is scoped to a single directory, a `Gemfile` is included in both the `android` and `ios` directories. Once installed, the usage is
```bash
cd frontend/android # or ios
bundle install
bundle exec fastlane <lane>
```
This is reused in the CI/CD pipeline to automate the deployment process.
Fastlane assumes mutliple secrets to be present as files in the platform directories. These are:
- for android:
- `secrets.properties` used by gradle to load secrets needed at execution time
- `release.keystore` used by gradle to sign the apk
- `google-key.json` used by fastlane to authenticate with the Google Play Store
- for ios:
- TODO
These files are stored as secrets in the GitHub repository so that the CI pipeline can access them.