Skip to content

Commit 5faf884

Browse files
committed
Add Blazor UI project
1 parent 6550c0d commit 5faf884

File tree

138 files changed

+64088
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+64088
-35
lines changed

AttendanceListBackend.slnx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
</Folder>
55
<Folder Name="/aspire/">
66
<Project Path="aspire/ALB.AppHost/ALB.AppHost.csproj" />
7+
<Project Path="aspire/ALB.MigrationService/ALB.MigrationService.csproj" />
78
<Project Path="aspire/ALB.ServiceDefaults/ALB.ServiceDefaults.csproj" />
89
</Folder>
910
<Folder Name="/src/">
1011
<Project Path="src/ALB.Api/ALB.Api.csproj" />
12+
<Project Path="src/ALB.Application/ALB.Application.csproj" />
1113
<Project Path="src/ALB.Domain/ALB.Domain.csproj" />
1214
<Project Path="src/ALB.Infrastructure/ALB.Infrastructure.csproj" />
15+
<Project Path="src/ALB.Ui/ALB.Ui.csproj" />
1316
</Folder>
1417
<Folder Name="/test/">
1518
<Project Path="tests/ApiIntegrationTests/ApiIntegrationTests/ApiIntegrationTests.csproj" />

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.0" />
1313
<PackageVersion Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.0" />
1414
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
15+
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.0"/>
1516
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
1617
<PrivateAssets>all</PrivateAssets>
1718
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

aspire/ALB.AppHost/ALB.AppHost.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
<ItemGroup>
2626
<ProjectReference Include="..\..\src\ALB.Api\ALB.Api.csproj" />
27+
<ProjectReference Include="..\..\src\ALB.Ui\ALB.Ui.csproj" />
28+
<ProjectReference Include="..\ALB.MigrationService\ALB.MigrationService.csproj" />
2729
</ItemGroup>
2830

2931
</Project>

aspire/ALB.AppHost/Program.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@
66

77
var postgresdb = postgres.AddDatabase("postgresdb");
88

9-
builder.AddProject<Projects.ALB_Api>("Api")
9+
var migrationService = builder.AddProject<Projects.ALB_MigrationService>("MigrationService")
1010
.WithReference(postgresdb)
1111
.WaitFor(postgresdb);
1212

13+
var api = builder.AddProject<Projects.ALB_Api>("Api")
14+
.WithReference(postgresdb)
15+
.WaitFor(postgresdb)
16+
.WaitFor(migrationService);
17+
18+
builder.AddProject<Projects.ALB_Ui>("Ui")
19+
.WithReference(postgresdb)
20+
.WaitFor(postgresdb)
21+
.WaitFor(migrationService)
22+
.WaitFor(api);
23+
1324
builder.Build().Run();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Aspire.Npgsql"/>
11+
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL"/>
12+
<PackageReference Include="Microsoft.EntityFrameworkCore" />
13+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore"/>
14+
<PackageReference Include="NodaTime" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\..\src\ALB.Infrastructure\ALB.Infrastructure.csproj" />
19+
<ProjectReference Include="..\ALB.ServiceDefaults\ALB.ServiceDefaults.csproj" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using ALB.Infrastructure.Persistence;
2+
3+
using Microsoft.EntityFrameworkCore;
4+
5+
using Npgsql;
6+
7+
var builder = WebApplication.CreateBuilder(args);
8+
9+
builder.AddNpgsqlDataSource("postgresdb",
10+
configureDataSourceBuilder: sourceBuilder => sourceBuilder.UseNodaTime());
11+
12+
builder.AddServiceDefaults();
13+
14+
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
15+
16+
builder.Services.AddDbContextPool<ApplicationDbContext>((serviceProvider, options) =>
17+
{
18+
var dataSource = serviceProvider.GetRequiredService<NpgsqlDataSource>();
19+
options.UseNpgsql(dataSource, npgsqlOptions =>
20+
npgsqlOptions.UseNodaTime());
21+
});
22+
23+
var app = builder.Build();
24+
25+
app.UseMigrationsEndPoint();
26+
// TODO: add migrations when out of dev cycle
27+
using var serviceScope = app.Services.CreateScope();
28+
var context = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
29+
await context.Database.EnsureCreatedAsync();
30+
31+
app.Run();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"http": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"applicationUrl": "http://localhost:5057",
9+
"environmentVariables": {
10+
"ASPNETCORE_ENVIRONMENT": "Development"
11+
}
12+
},
13+
"https": {
14+
"commandName": "Project",
15+
"dotnetRunMessages": true,
16+
"launchBrowser": true,
17+
"applicationUrl": "https://localhost:7075;http://localhost:5057",
18+
"environmentVariables": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
}
21+
}
22+
}
23+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

src/ALB.Api/ALB.Api.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<ItemGroup>
2525
<ProjectReference Include="..\..\aspire\ALB.ServiceDefaults\ALB.ServiceDefaults.csproj"/>
26+
<ProjectReference Include="..\ALB.Application\ALB.Application.csproj" />
2627
<ProjectReference Include="..\ALB.Domain\ALB.Domain.csproj"/>
2728
<ProjectReference Include="..\ALB.Infrastructure\ALB.Infrastructure.csproj"/>
2829
</ItemGroup>

0 commit comments

Comments
 (0)