How ktt-ol/hacs works
Main Components
a. Client-Side (Android App):
• Following sub-components:
• UI Layer (Activities and Fragments)
• SSH Management Module
• MQTT Client Module
• Status Management Service
• Cashbox Management
• Settings Management
• Authentication/Security Layer
b. Server-Side Infrastructure:
• MQTT Broker (mainframe.io:8883)
• SSH Server (for door control)
• Status Service
• Cashbox Service
Component Relationships
• Android App → MQTT Broker (SSL/TLS secured connection)
• Android App → SSH Server (secured with private key authentication)
• Status Service → MQTT Broker (publishes status updates)
• Android App → Cashbox Service (HTTPS connection)
Specific Implementation Details
Technical elements:
• BKS Keystore for MQTT SSL certification
• SSH Key Authentication (with "mf-door.*" naming convention)
• Background Services for Status Monitoring
• Permission Management System
• Local Storage for Settings and Credentials
Data Flow Indicators
Primary flows:
• Door Status Updates (MQTT → App)
• Door Control Commands (App → SSH)
• Cashbox Transactions (App ↔ Cashbox Service)
• Status Updates (Status Service → App)
Security Layer Representation
Security measures:
• SSL/TLS Encryption for MQTT
• SSH Key-based Authentication
• HTTPS for Cashbox Operations
• Local Credential Storage
Additional Elements
Include:
• Version/Build Information
• External Dependencies (JSch, ACRA, EasyPermissions)
• Permission Requirements
• Error Handling Paths
Key Architectural Patterns to Emphasize:
• Event-Driven Architecture (MQTT)
• Service-Oriented Architecture (Multiple Services)
• Fragment-based UI Architecture
• Background Service Pattern
• Observer Pattern (Status Updates)
Level of Detail:
• Keep high-level components visible
• Related functionality (e.g., all door-related operations)
• Security boundaries clearly
• Asynchronous vs synchronous operations
Remember to:
• Use clear, consistent naming
• Primary and backup paths
• Error handling flows
• Critical security boundaries
• Version information
• External service dependencies