The digital coffee clip card app for Café Analog (the ITU coffee bar). Users buy bundles of tickets with MobilePay, spend a ticket on a drink of their choice and show the receipt as a valid payment.
Run make (or make help) to see all available commands.
make get # Install dependencies
make api # Regenerate the API client (see Code generation)Then launch the app from your editor (see Editors below), or:
flutter run --flavor development # against the dev backend
flutter run --flavor production # production app id, name and deep link schemeThere are two flavours: development and production. They differ in application id, display name, deep link scheme and backend:
| Flavour | Backend | Android application id | iOS bundle id |
|---|---|---|---|
development |
https://core.dev.analogio.dk |
dk.analogio.analog.dev |
dk.analogio.analog.dev |
production |
https://core.prd.analogio.dk |
dk.analog.digitalclipcard |
DK.AnalogIO.DigitalCoffeeCard |
The production ids match the old coffeecard_app, so the new app ships as an update to the existing listing instead of a new app. The backend is selected in lib/core/environment.dart; for a local backend, override it without editing code:
flutter run --flavor development --dart-define=API_BASE_URL=http://192.168.1.10:5080| Command | What it does |
|---|---|
make / make help |
Show the help message listing all targets (default target) |
make get |
Install dependencies (flutter pub get) |
make api |
Regenerate the Tonik API client from the committed v2 spec |
make api-update |
Fetch the latest v2 spec, then regenerate the client |
make api-check |
Regenerate and fail if the committed client drifted (used by CI) |
make swagger |
Fetch the latest v2 OpenAPI spec from the backend into swagger/ |
make clean |
Reset the project: flutter clean, then flutter pub get |
make upgrade-flutter |
Upgrade Flutter/Dart and pin the new versions in pubspec.yaml and the CI workflow |
make upgrade-deps |
Upgrade all dependencies to their latest major versions (flutter pub upgrade --major-versions) |
make coverage |
Run flutter test --coverage and generate an HTML report in coverage/html/ |
make fix |
Format code and apply automatic fixes (dart format ., dart fix --apply) |
- VS Code is the preferred editor. The repository includes workspace configuration in
.vscode/(launch configurations for the development flavour, recommended extensions for Dart/Flutter and the Bloc extension). - IntelliJ / Android Studio is also supported: the
.run/directory contains run configurations for the development and production flavours.
The app is organised by feature under lib/features/, with shared code in lib/core/, the HTTP layer in lib/infrastructure/, and the generated API package in packages/analog_api/.
Before working on the codebase, read CONTRIBUTING.md. It documents the architecture and the conventions every feature follows. Each feature folder also has its own README.md describing the caveats specific to that feature.
flutter test
make coverage # with coverage reportThe HTTP API client in packages/analog_api/ is generated from swagger/coffeecard_api_v2.json with Tonik and is checked into git.
make api # Regenerate from the committed spec
make api-update # Fetch the latest spec and regenerate (intentional updates)
make api-check # Verify the committed client is up to date (CI)See CONTRIBUTING.md for the generated-client conventions.