Platforms
Product Lines
Platforms Safecrete Safewall Mine Operating System (Coming Soon)
On this page

Architecture

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:

Presentation Layer (UI)
Dashboards
Devices
Alarms
▼▲
Business Logic Layer
State Management
Services
Models
▼▲
Data Access Layer
REST API Client
WebSocket Client
Local Storage
▼▲
IndustryOS Platform
REST API
WebSocket
Mobile Centre

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_storage for sensitive data (tokens, credentials)
  • shared_preferences for user preferences
  • sqflite for structured data caching

Communication Flow

Authentication Flow

Mobile App
POST /api/auth/login
JWT Token + Refresh
Store tokens securely
IndustryOS Platform

Real-Time Data Flow

Mobile App
WebSocket Connect
Subscribe: telemetry
Telemetry Updates
(continuous stream)
IndustryOS Platform

Push Notification Flow

IndustryOS Platform
Send Notif.
Firebase Cloud Messaging (FCM)
Push Notif.
Mobile Device
Display Notification

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:

  1. App Launch: Retrieve application configuration
  2. Configuration Validation: Verify settings compatibility
  3. Dynamic Updates: Apply configuration without app rebuild
  4. 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

Online Detection
Sync Queued Actions
Update Local Cache
Notify User

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

Code Repository
CI/CD Pipeline
Build (Android/iOS)
Testing
Distribution

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