diff --git a/.env.template b/.env.template deleted file mode 100644 index 130341b4bd..0000000000 --- a/.env.template +++ /dev/null @@ -1,6 +0,0 @@ -# A trailing slash is required -DEV_HOST = "<>" -ALPHA_HOST = "<>" -PROD_HOST = "<>" -PLAUSIBLE_HOST = "<>" -PLAUSIBLE_DOMAIN = "<>" \ No newline at end of file diff --git a/.gitignore b/.gitignore index beb797db5c..b1fda3823e 100644 --- a/.gitignore +++ b/.gitignore @@ -88,5 +88,6 @@ config/ keys MainActivity.kt +android/build/reports/problems/problems-report.html -.env \ No newline at end of file +.env diff --git a/README.md b/README.md index ba1c3887be..1e3a3aa9a9 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,26 @@ # Titan -Titan is a cross platform frontend written in Flutter for an open-source project launched by ÉCLAIR, the computer science association of Ecole Centrale de Lyon. This project aims to provide students of business and engineering schools a digital tool to simplify the association process. +Titan is a cross platform frontend written in Flutter for an open-source project launched by ÉCLAIR and maintained by ProximApp. This project aims to provide students of business and engineering schools a digital tool to simplify campus life and student association activities. -Our builds of Titan are called MyECL and can be downloaded from the App Store and from the Google Play Store. +## Flavors -## Setup environment +Titan supports [flavors](https://docs.flutter.dev/deployment/flavors), which allows the developer to easily switch between several versions of Titan for several use cases. + +Titan includes 3 flavors: `dev`, `alpha`, `prod`. On VSCode, you can choose which flavor to use when launching the debugger + +Each flavor is associated with a specific app package name (`*.titan.dev`, `*.titan.alpha`, `*.titan`) allowing the three app to be installed simultaneously on the same device. + +## Base configuration + +You need to create config json files with required variables: + +- config/config-dev.json +- config/config-alpha.json +- config/config-prod.json + +## Development + +### Setup dev environment Install Flutter: https://docs.flutter.dev/get-started/install @@ -14,19 +30,15 @@ https://docs.flutter.dev/get-started/editor?tab=vscode Titan is designed to be launched on Web, Android and iOS platforms. -## Configure Titan - -Update [`.env`](.env) to match your Hyperion's backend: +### Run Titan -`PROD_HOST = "<>` - -You can also specify an other host for debuging: - -`DEV_HOST = "<>` +```bash +flutter run --flavor dev --dart-define-from-file=config/config-dev.json --web-port 3000 +# flutter run --flavor alpha --dart-define-from-file=config/config-alpha.json --web-port 3000 +# flutter run --flavor prod --dart-define-from-file=config/config-prod.json --web-port 3000 +``` -NB: a trailing slash is required. - -## Development +Titan can be launched from VS Code _Run and Debug_ menu. ### Formatting @@ -76,27 +88,7 @@ To run a specific test file : flutter test --flavor dev path/to/file.dart ``` -### Flavors - -Titan supports [flavors](https://docs.flutter.dev/deployment/flavors), which allows to easily switch between several versions of Titan for several use cases. - -Titan includes 3 flavors: `dev`, `alpha`, `prod`. On VSCode, you can choose which flavor to use when launching the debugger - -Each flavor is associated with a specific app package name (`fr.myecl.titan.dev`, `fr.myecl.titan.alpha`, `fr.myecl.titan`) allowing the three app to be installed on the same device. Each flavor use its own Hyperion url defined in the [dotenv](/.env) - -#### Build with a flavor - -To build Titan with a specific flavor use: - -``` -flutter build {target} --flavor={flavor} -``` - -Currently flavor are not supported for Flutter for web, you should use: - -``` -flutter build web --dart-define=flavor={flavor} -``` +## Advanced Configuration ### Notifications setup @@ -118,8 +110,13 @@ For iOS, add your `GoogleService-Info.plist` in `ios/config/ + + On mobile, using plaintext HTTP connexions may raise issues. + + #### Android Update [AndroidManifest.xml](./android/app/src/debug/AndroidManifest.xml): @@ -155,11 +152,13 @@ Update [Info.plist](ios/Runner/Info.plist): ``` + + ### Update Titan's icon First update the icon's file and update [pubspec.yaml](./pubspec.yaml). -Then, `flutter_launcher_icons` must be updated: +Then run `flutter_launcher_icons` to generate all variants of the icon: ```bash flutter pub get @@ -171,16 +170,27 @@ flutter pub run flutter_launcher_icons [Guided upgrade using Android Studio](https://docs.flutter.dev/release/breaking-changes/android-java-gradle-migration-guide#solution-1-guided-fix-using-android-studio) [Java and Gradle compatibility](https://docs.gradle.org/current/userguide/compatibility.html) -# Configuring fastlane +## Building using Fastlane + +### Fastlane configuration + +For automated signature and upload, you need to provide the following keys: -Google service account +- Google service account ``` android/fastlane-service-account.json ``` -Apple +- Apple App Store Connect API key ``` ios/app-store-connect-api.p8 ``` + +### Build and upload a version + +```bash +cd ios # or android +bundle exec fastlane beta flavor:alpha # or prod or dev +``` diff --git a/android/Gemfile b/android/Gemfile index fdf182dfa5..35a6e64aac 100644 --- a/android/Gemfile +++ b/android/Gemfile @@ -3,3 +3,5 @@ source "https://rubygems.org" gem "abbrev" gem "fastlane" gem "ostruct" + +gem "nkf" \ No newline at end of file diff --git a/android/Gemfile.lock b/android/Gemfile.lock index 20e10f585d..e562a81890 100644 --- a/android/Gemfile.lock +++ b/android/Gemfile.lock @@ -172,6 +172,7 @@ GEM mutex_m (0.3.0) nanaimo (0.4.0) naturally (2.3.0) + nkf (0.2.0) optparse (0.8.0) os (1.1.4) ostruct (0.6.1) @@ -227,6 +228,7 @@ PLATFORMS DEPENDENCIES abbrev fastlane + nkf ostruct BUNDLED WITH diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 31ca9de4b3..d0842adaf4 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -8,16 +8,16 @@ GEM i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.4.0) - aws-partitions (1.1187.0) - aws-sdk-core (3.239.1) + aws-partitions (1.1200.0) + aws-sdk-core (3.240.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -28,7 +28,7 @@ GEM aws-sdk-kms (1.118.0) aws-sdk-core (~> 3, >= 3.239.1) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.205.0) + aws-sdk-s3 (1.209.0) aws-sdk-core (~> 3, >= 3.234.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -37,7 +37,7 @@ GEM babosa (1.0.4) base64 (0.3.0) benchmark (0.4.1) - bigdecimal (3.3.1) + bigdecimal (4.0.1) claide (1.1.0) cocoapods (1.16.2) addressable (~> 2.8) @@ -114,7 +114,7 @@ GEM faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.1.1) + faraday-multipart (1.2.0) multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) @@ -221,7 +221,7 @@ GEM i18n (1.14.7) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.16.0) + json (2.18.0) jwt (2.10.2) base64 logger (1.7.0) @@ -229,7 +229,7 @@ GEM mini_mime (1.1.5) minitest (5.25.5) molinillo (0.8.0) - multi_json (1.17.0) + multi_json (1.19.1) multipart-post (2.4.1) mutex_m (0.3.0) nanaimo (0.4.0) @@ -239,7 +239,7 @@ GEM nkf (0.2.0) og-corefoundation (0.2.3) ffi - optparse (0.8.0) + optparse (0.8.1) os (1.1.4) ostruct (0.6.1) plist (3.7.2)