Move projects to src; add Neutrino secret

This commit is contained in:
Holden
2026-06-19 22:52:38 -05:00
parent 2cfc5e7369
commit 95751904fa
90 changed files with 32 additions and 10 deletions

View File

@@ -0,0 +1,50 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using RecNet.Application.Common.Interfaces;
using RecNet.Domain.Configuration;
using RecNet.Domain.GameVersions;
using RecNet.Domain.Profiles;
using RecNet.Infrastructure.Persistence;
using RecNet.Infrastructure.Persistence.Repositories;
using RecNet.Infrastructure.Services.Configuration;
using RecNet.Infrastructure.Services.Meta;
using RecNet.Infrastructure.Services.Steam;
using RecNet.Infrastructure.Services.Tokens;
namespace RecNet.Infrastructure;
public static class DependencyInjection
{
public static TBuilder AddInfrastructure<TBuilder>(this TBuilder builder)
where TBuilder : IHostApplicationBuilder
{
builder.AddNpgsqlDbContext<DatabaseContext>("recnet");
builder.Services
.AddOptions<JwtOptions>()
.Bind(builder.Configuration.GetSection("Jwt"))
.Validate(options => !string.IsNullOrWhiteSpace(options.Secret), "JWT secret is required.")
.ValidateOnStart();
builder.Services
.AddOptions<SteamOptions>()
.Bind(builder.Configuration.GetSection("Steam"));
builder.Services.AddHttpClient<ISteamAuthService, SteamAuthService>(client =>
{
client.BaseAddress = new Uri("https://api.steampowered.com/");
});
builder.Services.AddScoped<IPlatformAuthValidator, SteamAuthValidator>();
builder.Services.AddScoped<IPlatformAuthValidator, MetaAuthValidator>();
builder.Services.AddScoped<IGameVersionRepository, GameVersionRepository>();
builder.Services.AddScoped<IProfileRepository, ProfileRepository>();
builder.Services.AddScoped<IServerConfigRepository, ServerConfigRepository>();
builder.Services.AddScoped<IConfigService, ConfigService>();
builder.Services.AddScoped<ITokenService, TokenService>();
return builder;
}
}