Skip to content

Refactor configuration management to use SQLite and add Blazor components - #12

Merged
JeffrySteegmans merged 2 commits into
masterfrom
features/use-SQLite-for-settings
Mar 7, 2026
Merged

Refactor configuration management to use SQLite and add Blazor components#12
JeffrySteegmans merged 2 commits into
masterfrom
features/use-SQLite-for-settings

Conversation

@JeffrySteegmans

Copy link
Copy Markdown
Owner

This pull request introduces significant architectural changes to the SendHub application, focusing on removing the old Daemon-based backend and replacing it with a new web-based backend. The configuration and application settings are now managed via a SQLite-backed settings provider, and the SMTP/email sending logic has been refactored to use this new provider. Additionally, conventions for Blazor component development have been documented. Below are the most important changes grouped by theme:

Backend Architecture Changes:

  • Removed the Daemon backend (SendHub.Daemon), its configuration, and tests, and replaced it with a new web-based backend (SendHub.Web) in the solution and application host. The app host and project references now point to SendHub.Web instead of the Daemon. (SendHub.slnx, AppHost.cs, SendHub.AppHost.csproj, FolderWatcherSettings.cs, appsettings.json) [1] [2] [3] [4] [5]

Configuration and Settings Refactor:

  • Introduced a new SqliteApplicationSettings class implementing IApplicationSettings, which persists all application settings (including SMTP and folder paths) in a SQLite database table. This class provides methods for reading, updating, and seeding default settings. (SqliteApplicationSettings.cs)
  • Updated dependency injection to register SqliteApplicationSettings as the singleton settings provider and removed the previous options-based configuration for SMTP and folder watcher settings. (Registration.cs)

Email/SMTP Logic Refactor:

  • Refactored SmtpFileSender to use the new IApplicationSettings interface for all configuration, removing the SmtpSettings options class and associated validation. (SmtpFileSender.cs, SmtpSettings.cs) [1] [2]
  • Updated and simplified related tests to use the new settings provider and removed validation-specific tests. (SmtpFileSenderTests.cs)

Testing and Infrastructure:

  • Added comprehensive tests for SqliteApplicationSettings to verify initialization, default seeding, updates, and idempotency. (SqliteApplicationSettingsTests.cs)
  • Moved test fakes to align with the new backend structure. (FakeFileSystemWatcher.cs)

Development Conventions:

  • Documented Blazor code-behind conventions, enforcing separation of markup and logic, and proper use of dependency injection in .razor.cs files. (claude.md)

Additional:

  • Added MudBlazor UI library to dependencies for future UI work. (Directory.Packages.props)

@JeffrySteegmans
JeffrySteegmans merged commit 2657487 into master Mar 7, 2026
1 check failed
@JeffrySteegmans
JeffrySteegmans deleted the features/use-SQLite-for-settings branch March 7, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant