This repository contains a proof of concept for implementing a single build multi-environment strategy for LineLeap's mobile applications.
Linear Issue: MOB-2240
Research and demonstrate the feasibility of using a single mobile app build across multiple environments (local, dev, staging, prod) with runtime configuration injection.
- Explore methods to inject environment configuration at runtime rather than build time
- Investigate secure storage and retrieval of environment-specific settings
- dart-define: Build-time constants with runtime overrides
- Environment Variables: System-level configuration
- Remote Configuration: Fetching config from a secure endpoint
- Local Configuration Files: JSON/YAML files for development
- API key protection strategies
- Certificate pinning approaches
- Secure storage for sensitive data
- Environment detection and validation
mobile-single-build-poc/
├── lib/
│ ├── config/ # Environment configuration
│ ├── services/ # Service layer with environment-aware implementations
│ └── main.dart # App entry point
├── ios/ # iOS platform code
├── android/ # Android platform code
└── test/ # Tests
- Single APK/IPA can connect to different environments
- Secure handling of environment-specific secrets
- Clear documentation of implementation approach
- Performance impact assessment
- Security implications documented
- Team approval on chosen approach
- Flutter SDK
- Xcode (for iOS development)
- Android Studio (for Android development)
flutter pub get
# Default (production-like)
flutter run
# With environment override
flutter run --dart-define=ENV=dev
# Local development
flutter run --dart-define=ENV=local
- Juan Carlos Ramón Condezo
- Zach Brady
Proprietary - LineLeap