$ show lavinir/hassio-onedrive-backup
The system is a Home Assistant addon that enables backup creation and synchronization with OneDrive. Built with ASP.NET Core and Blazor Server, it provides a web UI for configuration and monitoring, scheduled backups with retention policies, file synchronization, and exposes Home Assistant sensor entities for status monitoring. The architecture follows a layered design with separate services for backup management, file synchronization, and external API integrations (Home Assistant and Microsoft Graph). Key entry points include Program.cs for application startup and the Orchestrator for coordinating scheduled tasks. Data flows involve creating backups via the Home Assistant API, uploading to OneDrive via GraphHelper, and synchronizing file changes bidirectionally.
The LLM identified 3 files worth highlighting for reuse:
Provides utility methods for parsing cron expressions and calculating next occurrences, isolated from framework dependencies, making it reusable in any .NET application requiring schedule-based operations.
Offers methods to check if the current time falls within a specified time range, including handling overnight ranges, with no external dependencies beyond System, allowing easy extraction to other projects.
Implements a generic repository pattern for JSON file-based storage, abstracting file I/O and serialization/deserialization, and can be reused in any application needing simple persistent storage of typed objects.