A Whisky Shelf app to allow you to add bottles / drams you've had, and store information about bottles you own.
| Branch | Project | Score |
|---|---|---|
| Main | Total | |
| AppHost | ||
| Application | ||
| Infrastructure | ||
| WebApi |
- Ensure .NET 9 is installed:
https://learn.microsoft.com/en-us/dotnet/core/install/ - Ensure EF Tools is installed:
dotnet tool install --global dotnet-ef - Ensure Aspire CLI is installed:
dotnet tool install --global Aspire.Cli - Ensure docker is installed:
https://docs.docker.com/desktop/
flowchart LR
%% High-level architecture & project relationships
subgraph AppHost["AppHost (Aspire orchestrator)"]
AH["MyWhiskyShelf.AppHost"];
end
subgraph Web["Web API (composition root)"]
WAPI["MyWhiskyShelf.WebApi"];
WDI["DI wiring & endpoint filters"];
end
subgraph Application["Application"]
A1["Use cases / services"];
A2["Repository interfaces"];
A3["DTOs / contracts"];
end
subgraph Core["Core (Domain)"]
C1["Domain models"];
C2["Value objects"];
end
subgraph Infra["Infrastructure"]
I1["Repository implementations · EF Core"];
I2["DbContext, EF entities, mapping"];
I3["Adapters · Redis · File loader"];
I4["DataSeederHostedService"];
end
subgraph Migr["Migrations & runner"]
M1["MyWhiskyShelf.Migrations"];
MS["MyWhiskyShelf.MigrationService"];
end
subgraph SvcDefaults["ServiceDefaults"]
SD["MyWhiskyShelf.ServiceDefaults"];
end
subgraph Tests["Tests"]
T1["WebApi.Tests"];
T2["Application.Tests"];
T3["Infrastructure.Tests"];
T4["IntegrationTests"];
T5["Core.Tests"];
end
%% Runtime flow
Client((Client)) -->|HTTP| WAPI
AH --> WAPI
AH --> MS
%% Compile-time dependencies (solid) and wiring-only (dashed)
WAPI --> Application
WAPI -. "wiring only" .-> Infra
Application --> Core
Infra --> Application
Infra --> Core
%% EF migrations usage
Infra --> I2
M1 --> I2
M1 -. "uses as startup" .-> WAPI
%% Seed & adapters
I4 --> I2
I3 --> Cache[("Redis")]
I3 --> Files[("Filesystem / JSON")]
I1 --> DB[("PostgreSQL")]
%% Service defaults (common hosting, health, etc.)
SD --> WAPI
MYWHISKYSHELF_DATA_SEEDING_ENABLED: Enables seeding of test data (default: true)
MYWHISKYSHELF_RUN_MIGRATIONS: Runs the migrations against the database in Aspire (default: true)
MYWHISKYSHELF_REDIS_INSIGHT_ENABLED: Enables Redis Insight container in Asipre (default: true)
MYWHISKYSHELF_PG_WEB_ENABLED: Enables PgWeb container in Aspire (default: true)
Create the migrations:
$env:ConnectionStrings__myWhiskyShelfDb = 'Host=localhost;Port=;Database=;Username=;Password='
dotnet ef migrations add InitialMigration -p MyWhiskyShelf.Migrations/MyWhiskyShelf.Migrations.csproj -s MyWhiskyShelf.WebApi/MyWhiskyShelf.WebApi.csproj -c MyWhiskyShelf.Infrastructure.Persistence.Contexts.MyWhiskyShelfDbContext -o Migrations
Update all aspire packages accross all projects in the solution: aspire update