feat: pivot to social media workflow app
Some checks failed
Backend CI/CD / build_and_deploy (push) Has been cancelled
Frontend CI/CD / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-04-24 12:58:35 -04:00
parent 0f4acc1b6d
commit df3e602015
349 changed files with 18685 additions and 16010 deletions

View File

@@ -1,5 +1,6 @@
using System.Text;
using Hutopy.Modules.Identity.Data;
using Socialize.Data;
using Socialize.Infrastructure.Security;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Facebook;
using Microsoft.AspNetCore.Authentication.Google;
@@ -7,7 +8,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
namespace Hutopy;
namespace Socialize;
public static class DependencyInjection
{
@@ -18,9 +19,10 @@ public static class DependencyInjection
services.AddHttpContextAccessor();
services.AddHealthChecks()
.AddDbContextCheck<IdentityDbContext>();
.AddDbContextCheck<AppDbContext>();
services.AddHttpClient();
services.AddScoped<AccessScopeService>();
// Customise default API behaviour
services.Configure<ApiBehaviorOptions>(options =>
@@ -31,6 +33,27 @@ public static class DependencyInjection
return services;
}
public static IServiceCollection AddAppData(
this IServiceCollection services,
string postgresConnectionString)
{
services.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(postgresConnectionString));
return services;
}
public static async Task<IApplicationBuilder> UseAppDataAsync(
this IApplicationBuilder app,
CancellationToken cancellationToken = default)
{
using IServiceScope scope = app.ApplicationServices.CreateScope();
await using AppDbContext context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await context.Database.EnsureCreatedAsync(cancellationToken);
return app;
}
public static IServiceCollection AddAuthorizationAndAuthentication(this IServiceCollection services,
ConfigurationManager configuration)
{