* Extended functionalities

* Added different UIs
This commit is contained in:
2026-06-24 21:43:40 +02:00
parent 282f4864c4
commit f15bb7a916
348 changed files with 59057 additions and 498 deletions

View File

@@ -62,12 +62,23 @@ builder.Services.AddDbContext<AppDbContext>(options =>
// ---------------------------------------------------------------------------
// Application services
// ---------------------------------------------------------------------------
builder.Services.AddSingleton<IRefreshTokenStore, InMemoryRefreshTokenStore>();
builder.Services.AddSingleton<IRefreshTokenStore, DbRefreshTokenStore>();
builder.Services.AddHostedService<RefreshTokenCleanupService>();
builder.Services.AddSingleton<IPasswordHasher<ApplicationUser>, PasswordHasher<ApplicationUser>>();
builder.Services.AddScoped<ITokenService, TokenService>();
builder.Services.AddScoped<IAuthService, AuthService>();
builder.Services.AddScoped<IRecipeService, RecipeService>();
builder.Services.AddScoped<IRecipeManagementService, RecipeManagementService>();
builder.Services.AddScoped<IRecipeExcelService, RecipeExcelService>();
builder.Services.AddScoped<IDietTrackingService, DietTrackingService>();
builder.Services.AddScoped<IIngredientCatalogService, IngredientCatalogService>();
builder.Services.AddScoped<IMealPlanService, MealPlanService>();
builder.Services.Configure<MealPlan.Api.Services.AI.OpenAiOptions>(
builder.Configuration.GetSection(MealPlan.Api.Services.AI.OpenAiOptions.SectionName));
builder.Services.AddHttpClient<MealPlan.Api.Services.AI.IOpenAiChatService, MealPlan.Api.Services.AI.OpenAiChatService>();
builder.Services.AddScoped<MealPlan.Api.Services.Generators.ICatalogMatchingService, MealPlan.Api.Services.Generators.CatalogMatchingService>();
builder.Services.AddScoped<MealPlan.Api.Services.Generators.IDietGeneratorService, MealPlan.Api.Services.Generators.DietGeneratorService>();
builder.Services.AddScoped<MealPlan.Api.Services.Generators.IRecipeGeneratorService, MealPlan.Api.Services.Generators.RecipeGeneratorService>();
// ---------------------------------------------------------------------------
// Authentication / authorization (JWT bearer)
@@ -163,6 +174,19 @@ builder.WebHost.ConfigureKestrel(options => options.AddServerHeader = false);
var app = builder.Build();
if (args.Contains("--fix-sequences", StringComparer.OrdinalIgnoreCase))
{
await using var scope = app.Services.CreateAsyncScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
var messages = await SequenceMaintenance.ResyncIdentitySequencesAsync(db);
foreach (var message in messages)
{
Console.WriteLine(message);
}
return;
}
// ---------------------------------------------------------------------------
// HTTP request pipeline
// ---------------------------------------------------------------------------