How prakashutoledo/msbandwearableuwp works
Main Components
• UWP Application (UI): Represented by the main application in “MSBandWearable/IDEASLabUT.MSBandWearable.Application”. It includes XAML pages (MSBandPage.xaml, etc.) and resources such as styles.
• MVVM Components: Model, View, and ViewModel layers reside in different projects (for example, the UWP Core project “MSBandWearable/IDEASLabUT.MSBandWearable.UWPCore” which contains ViewModel classes and converters).
• Business Logic Services:
• Band Client Service (in the “Client” project) for Bluetooth communication.
• Properties Service (in ApplicationProperties) to manage configuration and AWS resource endpoints.
• NTPSync, Notification, and other sensor services present in respective service folders (e.g., NTPSync, Notification, and WearableCore) handle data synchronization, sensor management, and notifications.
• Logging and External Integration:
• Elasticsearch Client and Logger (in “ElasticsearchClient” and “ElasticsearchLogger”) manage log formatting and HTTP communications. These handle batching sensor data via Serilog and pushing logs every 8 seconds to Elasticsearch.
• WebSocket Service (in the Notification project) which manages the communication with the AWS WebSocket API that connects with the iOS component and AWS Lambda.
• External Dependencies:
• AWS Resources such as Lambda functions, WebSocket API, and an Elasticsearch domain.
• Related external projects like EmpaticaE4WearableIOS and ideaslabut-aws-lambda, which are mentioned as dependencies in the README.
Relationships and Interactions
• The UWP Application (the View and ViewModel layers) interacts with business logic services to read sensor data and control sessions (start/stop).
• Sensor data from the Band is captured through the Band Client Service and then processed by various sensor modules (in WearableCore) before being passed into the logging pipeline.
• The Logging component uses a file-based Serilog queue to batch sensor events, and the HTTP sink makes periodic bulk API calls to the AWS-hosted Elasticsearch domain.
• Notification components communicate over WebSocket (via the WebSocketService) to send or receive connection messages, possibly in response to input from the iOS application.
• Configuration is managed centrally using properties defined in ApplicationProperties (local and default JSON files).
Architectural Patterns and Design Principles
• MVVM (Model-View-ViewModel) is a core design pattern used to separate UI logic from business logic.
• The thread-safe lazy singleton design pattern is used to manage global access to certain service instances.
• Modularization is evident with separate projects for services, logging, extension methods, and testing, showcasing a micro-modular architecture within the solution.
• Dependency on external AWS resources indicates a hybrid system where local processing and cloud-based logging/notification are integrated.
Technologies and Frameworks
• UWP (Universal Windows Platform) and XAML for the client application.
• C# (.NET) for the business logic, services, and MVVM implementation.
• Serilog for logging with a file-based blocking queue.
• AWS services (Lambda, WebSocket API, Elasticsearch domain) for remote logging and notifications.
• REST/HTTP communication via custom Elasticsearch REST clients and WebSocket communication services.