Skip to content

MartinWheelerDotNet/MyWhiskyShelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

210 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyWhiskyShelf

A Whisky Shelf app to allow you to add bottles / drams you've had, and store information about bottles you own.

Mutation Status

Branch Project Score
Main Total Mutation testing badge
AppHost Mutation testing badge
Application Mutation testing badge
Infrastructure Mutation testing badge
WebApi Mutation testing badge

Quality Gate

Quality gate
Reliability Rating
Security Rating
Maintainability Rating
Technical Debt
Vulnerabilities

Setup

  • 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/

Project Dependency Diagram

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
Loading

Environment Variables

Database

MYWHISKYSHELF_DATA_SEEDING_ENABLED: Enables seeding of test data (default: true)

MYWHISKYSHELF_RUN_MIGRATIONS: Runs the migrations against the database in Aspire (default: true)

Tools

MYWHISKYSHELF_REDIS_INSIGHT_ENABLED: Enables Redis Insight container in Asipre (default: true)

MYWHISKYSHELF_PG_WEB_ENABLED: Enables PgWeb container in Aspire (default: true)

Useful commands

Migrations

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

About

A Whisky Shelf app to allow you to add bottles / drams you've had, and store information about bottles you own.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages