SmartDose Architecture • MVVM • Clean Architecture

SmartDose Software Architecture

SmartDose follows an MVVM architecture based on Clean Architecture principles, optimized for modern Android development with Jetpack Compose. This structure ensures a modular, scalable and high-performance application for real-time dosimetric acquisition.

Main Architecture Layers

The application is organized into independent layers to clearly separate business logic, data sources, user interface and utilities.

01

Domain Layer

Core business layer independent from USB communication and database details.

  • RadiationMeasurement
  • DoseStats
  • AppSettings
  • MeasurementDataSource
02

Data Layer

Handles data sources, local persistence and repository mediation.

  • UsbCsvMeasurementDataSource
  • SimulatedMeasurementDataSource
  • Room Database
  • MeasurementRepository
  • SettingsRepository via DataStore
03

UI Layer

Responsible for display, navigation and user interaction.

  • MainViewModel
  • SettingsViewModel
  • DashboardScreen
  • SettingsScreen
  • SmartDoseApp.kt with NavHost
04

Utilities

Cross-functional helpers dedicated to safety, alarms and reports.

  • AlarmManagerHelper
  • Sound alerts
  • Vibration
  • CsvExporter
  • Measurement export

Unidirectional Data Flow

Data flows from the detector or simulation to the repository, then to the ViewModel and finally to the Compose UI.

1

Acquisition

The USB detector or simulation mode produces real-time dosimetric measurements.

2

Repository

The repository receives the data, selects the active source and saves the history.

3

ViewModel

The ViewModel observes data streams and transforms measurements into stable UI state.

4

Compose UI

The interface automatically redraws values, charts and alerts.

Architecture Ready for Future Expansion

Thanks to the separation between domain, data and UI layers, SmartDose can easily integrate new acquisition modes such as Bluetooth or IoT radiometers.

Easy addition of a Bluetooth source
UI independent from the measurement source
Persistent history with Room Database
Simplified export of measurement reports
Architecture compatible with cloud extension