Add DI, config, and API service for Blazor frontend

Introduce configuration classes and environment-specific settings files. Add DI extensions for registering API/app settings and HttpClient. Implement ITuneRipperApiService with robust error handling and logging. Update Program.cs for config loading and startup logging. Add usage documentation and update imports for new services and extensions. Improves maintainability and developer experience.
This commit is contained in:
Michal Vrba
2025-12-11 14:37:38 +01:00
parent e2d9ee3c59
commit 8bfcc3617b
9 changed files with 695 additions and 2 deletions
@@ -5,7 +5,21 @@ public class ApiSettings
public const string SectionName = "ApiSettings";
public string? BaseUrl { get; set; }
public string? HttpBaseUrl { get; set; }
public string? ApiKey { get; set; }
public int TimeoutSeconds { get; set; } = 30;
public bool EnableLogging { get; set; } = true;
public int RetryAttempts { get; set; } = 3;
public int RetryDelaySeconds { get; set; } = 2;
}
public class AppSettings
{
public const string SectionName = "AppSettings";
public string? AppName { get; set; }
public string? Version { get; set; }
public string? Environment { get; set; }
public bool EnableDetailedErrors { get; set; } = true;
public bool DebugMode { get; set; } = false;
}