Scaffold some identity stuff and switch to postgres

This commit is contained in:
2025-08-01 15:48:20 +02:00
parent 164aa79dae
commit f74e727a6f
40 changed files with 32156 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0"/>
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
<PropertyGroup>
<OutputType>Exe</OutputType>
@@ -12,12 +12,13 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PresentPortal.ApiService\PresentPortal.ApiService.csproj"/>
<ProjectReference Include="..\PresentPortal.Web\PresentPortal.Web.csproj"/>
<ProjectReference Include="..\PresentPortal.ApiService\PresentPortal.ApiService.csproj" />
<ProjectReference Include="..\PresentPortal.Web\PresentPortal.Web.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" />
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
<PackageReference Include="Aspire.Hosting.Redis" />
</ItemGroup>

View File

@@ -1,14 +1,31 @@
using Microsoft.Extensions.Hosting;
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis("cache");
var apiService = builder.AddProject<Projects.PresentPortal_ApiService>("apiservice");
IResourceBuilder<PostgresServerResource> postgresBuilder = builder.AddPostgres("postgres")
.WithLifetime(ContainerLifetime.Persistent)
.WithDataVolume();
if (builder.Environment.IsDevelopment())
{
postgresBuilder = postgresBuilder
.WithPgWeb();
}
IResourceBuilder<PostgresDatabaseResource> postgres = postgresBuilder
.AddDatabase("presentportal");
var apiService = builder.AddProject<Projects.PresentPortal_ApiService>("apiservice")
.WithReference(postgres)
.WaitFor(postgres);
builder.AddProject<Projects.PresentPortal_Web>("webfrontend")
.WithExternalHttpEndpoints()
.WithReference(cache)
.WaitFor(cache)
.WithReference(apiService)
.WaitFor(apiService);
.WithExternalHttpEndpoints()
.WithReference(cache)
.WaitFor(cache)
.WithReference(apiService)
.WaitFor(apiService);
builder.Build().Run();