This repository includes a minimal codemagic.yaml for MVP builds.
Current CI direction:
- Android: build a debug APK that can be downloaded from CodeMagic artifacts and installed directly on an Android device
- iOS: build an unsigned IPA with
--no-codesignfor sideloading or TrollStore-style workflows
Only these environment variables are currently generated into .env during CI:
BASE_URLAPI_TIMEOUT(optional, defaults to30000)
The Android workflow also requires Firebase configuration because the project applies the Google Services Gradle plugin.
CodeMagic must provide:
GOOGLE_SERVICES_JSON_BASE64
This secret should contain the Base64-encoded contents of:
android/app/google-services.json
On Windows PowerShell, you can generate it with:
[Convert]::ToBase64String([IO.File]::ReadAllBytes("android/app/google-services.json"))Then add the resulting string as a secure environment variable in CodeMagic.
Without this value, Android builds will fail at :app:processDebugGoogleServices because google-services.json is not committed to the repository.
The Android workflow builds:
flutter build apk --debugArtifact output on CodeMagic:
build/app/outputs/flutter-apk/*.apk
How to install:
- Open the CodeMagic build
- Go to
Artifacts - Download the generated
.apk - Copy it to an Android device
- Enable installation from unknown sources if needed
- Open the APK and install
The iOS workflow currently runs:
flutter build ios --release --no-codesignArtifact output on CodeMagic:
build/ios/iphoneos/*.appbuild/ios/unsigned_ipa/*.ipa
Important:
- The generated
.ipais unsigned - The generated
.appis still useful as a raw build artifact - This workflow does not use Apple signing
- Installation still depends on the sideload method you choose later
The current goal is to avoid the Apple Developer Program cost while still keeping an iOS path for MVP testing.
Practical options:
TrollStore: only works on supported iOS versions and devicesAltStore,SideStore, orSideloadly: usually require a free Apple ID and periodic refreshXcode Personal Team: works for personal testing, but still depends on an Apple account and is not a clean CI distribution path
Practical conclusion:
- Android is the primary installable artifact in CI today
- iOS CI now produces an unsigned IPA artifact
- If real iPhone installation is needed, use that IPA with the sideload path you choose, such as
TrollStore,AltStore,SideStore, orSideloadly
To keep builds running smoothly on CodeMagic:
- Push the branch that CodeMagic is configured to build
- Ensure
BASE_URLexists in CodeMagic environment variables - Trigger the
android_debugworkflow for an installable Android artifact - Trigger the
ios_releaseworkflow for an unsigned iOS IPA artifact
If Android fails again with missing .env, the first thing to check is whether the CodeMagic environment variables are present for that workflow.
If you are running the backend locally (
http://<your-ip>:8080) but the Mobile App (Real device) throws Connection Timeout or SocketException, your Windows Firewall is likely blocking incoming connections to port 8080.Quick Fix: Run PowerShell as Administrator and execute this command:
New-NetFirewallRule -DisplayName "Allow Port 8080" -Direction Inbound -LocalPort 8080 -Protocol TCP -Action AllowExpected output:
Enabled: True,Action: Allow. Restart your app after applying this rule.
lib/
βββ core/ # Core utilities
β βββ config/
β β βββ app_config.dart
β β βββ route_config.dart
β β βββ theme_config.dart
β βββ constants/
β β βββ api_endpoints.dart
β β βββ enums.dart # Tα»« DB enums
β β βββ app_constants.dart
β βββ services/ # Shared services
β β βββ api_service.dart # Dio client
β β βββ auth_service.dart # Authentication
β β βββ location_service.dart # GPS tracking
β β βββ notification_service.dart # Service notification
β β βββ storage_service.dart # Local storage
β βββ utils/
β β βββ extensions/
β β βββ validators/
β β βββ helpers/
β βββ widgets/ # Shared UI components
β βββ common/
β βββ forms/
β βββ media/
β
β
βββ features/ # Feature-based modules
β βββ auth/ # Authentication
β β βββ models/
β β β βββ account.dart
β β β βββ user_profile.dart
β β βββ providers/
β β β βββ auth_provider.dart
β β β βββ profile_provider.dart
β β βββ screens/
β β β βββ login_screen.dart
β β β βββ register_screen.dart
β β β βββ profile_screen.dart
β β βββ widgets/
β β β βββ login_form.dart
β β β βββ profile_card.dart
β β βββ repository/
β β βββ auth_repository.dart # Single repository per feature
β β
β βββ emergency/ # SOS & Emergency features
β β βββ models/
β β β βββ snakebite_incident.dart
β β β βββ rescue_request.dart
β β β βββ rescue_mission.dart
β β βββ providers/
β β β βββ emergency_provider.dart
β β β βββ tracking_provider.dart
β β βββ screens/
β β β βββ sos_form_screen.dart
β β β βββ emergency_tracking_screen.dart
β β β βββ first_aid_guide_screen.dart
β β βββ widgets/
β β β βββ symptom_selector.dart
β β β βββ location_picker.dart
β β β βββ emergency_button.dart
β β βββ repository/
β β βββ emergency_repository.dart
β β
β βββ snake_catching/ # Snake removal requests
β β βββ models/
β β β βββ catching_request.dart
β β β βββ catching_report.dart
β β βββ providers/
β β β βββ catching_provider.dart
β β β βββ queue_provider.dart
β β βββ screens/
β β β βββ catching_request_screen.dart
β β β βββ queue_screen.dart
β β β βββ report_screen.dart
β β βββ widgets/
β β β βββ species_selector.dart
β β β βββ quantity_input.dart
β β βββ repository/
β β βββ catching_repository.dart
β β
β βββ consultation/ # Expert consultation
β β βββ models/
β β β βββ consultation_session.dart
β β β βββ chat_message.dart
β β β βββ expert_profile.dart
β β βββ providers/
β β β βββ consultation_provider.dart
β β β βββ webrtc_provider.dart
β β β βββ chat_provider.dart
β β βββ screens/
β β β βββ expert_list_screen.dart
β β β βββ consultation_room_screen.dart
β β β βββ chat_screen.dart
β β βββ widgets/
β β β βββ video_call_widget.dart
β β β βββ chat_widget.dart
β β β βββ expert_card.dart
β β βββ repository/
β β βββ consultation_repository.dart
β β
β βββ snake_ai/ # Snake recognition & library
β β βββ models/
β β β βββ snake_species.dart
β β β βββ ai_recognition_result.dart
β β β βββ first_aid_guideline.dart
β β βββ providers/
β β β βββ snake_recognition_provider.dart
β β β βββ snake_library_provider.dart
β β β βββ ai_provider.dart
β β βββ screens/
β β β βββ camera_recognition_screen.dart
β β β βββ snake_library_screen.dart
β β β βββ species_detail_screen.dart
β β β βββ manual_filter_screen.dart
β β βββ widgets/
β β β βββ camera_widget.dart
β β β βββ species_card.dart
β β β βββ filter_widget.dart
β β βββ repository/
β β βββ snake_repository.dart
β β
β βββ payment/ # Payment & wallet
β β βββ models/
β β β βββ payment_transaction.dart
β β β βββ wallet_account.dart
β β β βββ payment_method.dart
β β βββ providers/
β β β βββ payment_provider.dart
β β β βββ wallet_provider.dart
β β βββ screens/
β β β βββ payment_screen.dart
β β β βββ wallet_screen.dart
β β β βββ payment_history_screen.dart
β β βββ widgets/
β β β βββ payment_form.dart
β β β βββ payment_method_card.dart
β β βββ repository/
β β βββ payment_repository.dart
β β
β βββ rescuer/ # Rescuer-specific features
β β βββ models/
β β β βββ rescuer_profile.dart
β β β βββ mission.dart
β β βββ providers/
β β β βββ rescuer_provider.dart
β β β βββ mission_provider.dart
β β β βββ availability_provider.dart
β β βββ screens/
β β β βββ rescuer_dashboard_screen.dart
β β β βββ mission_queue_screen.dart
β β β βββ active_mission_screen.dart
β β β βββ training_screen.dart
β β βββ widgets/
β β β βββ mission_card.dart
β β β βββ availability_toggle.dart
β β β βββ location_tracker.dart
β β βββ repository/
β β βββ rescuer_repository.dart
β β
β βββ expert/ # Expert-specific features
β β βββ models/
β β β βββ expert_profile.dart
β β β βββ expert_schedule.dart
β β β βββ certificate.dart
β β βββ providers/
β β β βββ expert_provider.dart
β β β βββ schedule_provider.dart
β β β βββ consultation_queue_provider.dart
β β βββ screens/
β β β βββ expert_dashboard_screen.dart
β β β βββ consultation_requests_screen.dart
β β β βββ schedule_management_screen.dart
β β β βββ knowledge_management_screen.dart
β β βββ widgets/
β β β βββ consultation_request_card.dart
β β β βββ schedule_calendar.dart
β β β βββ certificate_uploader.dart
β β βββ repository/
β β βββ expert_repository.dart
β β
β βββ shared/ # Shared between roles
β βββ models/
β β βββ location.dart
β β βββ media.dart
β β βββ notification.dart
β βββ providers/
β β βββ location_provider.dart
β β βββ media_provider.dart
β β βββ notification_provider.dart
β βββ widgets/
β βββ map_widget.dart
β βββ media_picker.dart
β βββ notification_badge.dart
β
βββ app/ # App-level configuration
β βββ router.dart # Go Router configuration
β βββ providers.dart # Global providers
β βββ theme.dart # App theme
β
βββ main.dart