- High-Level Architecture
- Core Components
- Communication Flow
- Platform-Specific Implementation
- Security Architecture
- Performance Optimisations
- Mobile Centre Integration
- Offline Support
- Testing Architecture
- Monitoring and Logging
- Deployment Architecture
- Future Considerations
- Related Documentation
The IndustryOS Mobile Application is built using Flutter, Google’s cross-platform UI framework, enabling a single codebase to generate native applications for both Android and iOS platforms.
High-Level Architecture
The mobile application follows a layered architecture pattern with clear separation of concerns:
Core Components
1. Presentation Layer
The presentation layer handles all user interface rendering and user interactions.
Key Features:
- Flutter Widgets: Uses Material Design components for Android and Cupertino widgets for iOS
- Responsive Layouts: Adapts to different screen sizes and orientations
- Custom Dashboard Renderer: Renders IndustryOS dashboards optimised for mobile devices
- Native Platform Integration: Leverages platform-specific features when needed
Main Screens:
- Login Screen: Authentication with username/password or OAuth 2.0
- Dashboard Screen: Interactive dashboard rendering with widget support
- Devices Screen: Device listing, details, and management
- Alarms Screen: Real-time alarm monitoring and acknowledgement
- Settings Screen: Application configuration and preferences
2. Business Logic Layer
This layer contains the core business logic and state management.
State Management
The application uses Provider pattern for state management:
- Authentication State: User session, tokens, and permissions
- Dashboard State: Current dashboard, widgets, and data
- Device State: Device information and attributes
- Alarm State: Active alarms and notifications
- Settings State: User preferences and configuration
Services
- Authentication Service: Handles login, logout, and token refresh
- Dashboard Service: Fetches and processes dashboard configurations
- Device Service: Manages device data and operations
- Alarm Service: Processes alarms and notifications
- Telemetry Service: Retrieves and processes time-series data
- Push Notification Service: Handles FCM notifications
3. Data Access Layer
This layer manages all external communication and local data storage.
REST API Client
Communicates with IndustryOS REST API for:
- User authentication and authorisation
- Entity management (devices, assets, customers)
- Dashboard and widget configurations
- Alarm management
- Telemetry data retrieval
Technology: Uses dio package for HTTP requests with:
- Automatic token injection
- Request/response interceptors
- Error handling and retry logic
- Response caching
WebSocket Client
Enables real-time data streaming for:
- Live telemetry updates
- Real-time alarm notifications
- Dashboard data subscriptions
Technology: Uses web_socket_channel package with:
- Automatic reconnection
- Subscription management
- Message queuing
Local Storage
Persists data locally for:
- User credentials and session tokens
- Application preferences
- Cached dashboard configurations
- Offline data access
Technology: Uses:
flutter_secure_storagefor sensitive data (tokens, credentials)shared_preferencesfor user preferencessqflitefor structured data caching
Communication Flow
Authentication Flow
Real-Time Data Flow
Push Notification Flow
Platform-Specific Implementation
Android Architecture
- Build System: Gradle
- Minimum SDK: API 21 (Android 5.0)
- Target SDK: API 34 (Android 14)
- Native Components:
- Firebase Cloud Messaging service
- Deep link handling (App Links)
- Background services for notifications
iOS Architecture
- Build System: Xcode with CocoaPods
- Minimum Version: iOS 12.0
- Target Version: iOS 17.0
- Native Components:
- APNs (Apple Push Notification service)
- Universal Links handling
- Background fetch for notifications
Security Architecture
Authentication & Authorisation
- JWT Tokens: Secure token-based authentication
- Token Refresh: Automatic token renewal before expiration
- OAuth 2.0: Support for third-party authentication providers
- Secure Storage: Platform keychain/keystore for sensitive data
Data Security
- HTTPS/TLS: All API communication encrypted with TLS 1.2+
- WebSocket Security: Secure WebSocket (WSS) for real-time data
- Certificate Pinning: Optional SSL certificate validation
- Data Encryption: Local storage encryption using platform APIs
Network Security
- Request Validation: Input validation and sanitisation
- Response Validation: JSON schema validation
- Error Handling: Secure error messages without sensitive information
- Rate Limiting: Client-side request throttling
Performance Optimisations
Rendering Optimisations
- Lazy Loading: Widgets and data loaded on-demand
- Image Caching: Cached images for offline access
- Virtual Scrolling: Efficient rendering of long lists
- Widget Recycling: Reuse of widget instances
Data Management
- Pagination: Load data in chunks to reduce memory usage
- Data Compression: Compressed API responses (gzip)
- Local Caching: Cache frequently accessed data
- Subscription Management: Unsubscribe from unused data streams
Network Optimisations
- Request Batching: Combine multiple API calls when possible
- Response Caching: Cache GET requests based on headers
- Connection Pooling: Reuse HTTP connections
- Compression: Enable GZIP compression for API requests
Mobile Centre Integration
The Mobile Centre provides server-side configuration for mobile applications:
Configuration Management
- Application Bundles: Define multiple app configurations
- OAuth Settings: Configure authentication providers
- Push Notification Settings: FCM configuration
- QR Code Settings: Deep linking configuration
- Default Dashboards: Set initial dashboard views
Runtime Configuration
The mobile app fetches configuration from Mobile Centre at runtime:
- App Launch: Retrieve application configuration
- Configuration Validation: Verify settings compatibility
- Dynamic Updates: Apply configuration without app rebuild
- Fallback Handling: Use default settings if unavailable
Offline Support
The application provides limited offline functionality:
Offline Capabilities
- Cached Dashboards: View previously loaded dashboards
- Cached Device Data: Access recent device information
- Offline Authentication: Use stored credentials for session resumption
- Queue Management: Queue actions for execution when online
Sync Strategy
Testing Architecture
Unit Testing
- Services: Test business logic in isolation
- Models: Validate data serialisation/deserialisation
- Utilities: Test helper functions and utilities
Widget Testing
- Screens: Test UI components and interactions
- Widgets: Test custom widget behaviour
- Navigation: Test routing and navigation flows
Integration Testing
- End-to-End Flows: Test complete user scenarios
- API Integration: Test API client functionality
- Platform Integration: Test platform-specific features
Monitoring and Logging
Application Logging
- Log Levels: DEBUG, INFO, WARNING, ERROR
- Structured Logging: JSON-formatted logs
- Remote Logging: Optional crash reporting integration
Analytics
- Usage Analytics: Track feature usage and user behaviour
- Performance Metrics: Monitor app performance
- Crash Reporting: Automatic crash detection and reporting
Deployment Architecture
Build Pipeline
Distribution Channels
- Google Play Store: Public Android distribution
- Apple App Store: Public iOS distribution
- Enterprise MDM: Internal distribution via MDM solutions
- Direct Distribution: APK/IPA files for internal testing
Future Considerations
- Widget Plugin System: Allow custom widget development
- Advanced Offline Support: Full CRUD operations offline
- Multi-Tenant Support: Support multiple IndustryOS instances
- Enhanced Analytics: Detailed usage and performance analytics
- Accessibility Improvements: Enhanced accessibility features
Related Documentation
- What is Mobile: Overview of mobile capabilities
- Quick Start Guide: Getting started with development
- Build and Release: Build and distribution guide
- Mobile Actions: Custom action configuration