Files
lux/AGENTS.md
T
Samuele Locatelli c67c40d81b Fix vocabolario
2026-06-08 17:21:30 +02:00

3.5 KiB

LUX - Agent Instructions

.NET 8 MES (Manufacturing Execution System) for window/door/casing production.

Solutions & Projects

Two solutions:

Lux.All.sln - Main application (build this):

  • Lux.UI - Blazor Server (identity-secured app), entry point
  • Lux.UI.Client - Blazor WASM (shared client lib)
  • Lux.API - REST API (JWD-to-SVG/Engine calls via Redis)
  • EgwCoreLib.Lux.Core - Core domain/business library (NuGet package)
  • EgwCoreLib.Lux.Data - EF Core data layer + migrations (NuGet package)

Lux.Report.sln - Reporting:

  • Lux.Report.Server - Blazor Server report host
  • Lux.Report.Manager - Blazor Server report manager
  • Lux.Report.Data - Report domain + EF models

Commands

dotnet restore Lux.All.sln
dotnet build Lux.All.sln
dotnet run --project Lux.UI          # run main app (development)
dotnet run --project Lux.API         # run API

No test project exists. TestDevExpress/ is a Blazor demo app, not unit tests.

Central package management: Directory.Packages.props controls all versions. Edit there, not in individual .csproj files.

Architecture notes

  • Lux.UI depends on both EgwCoreLib.Lux.Core and EgwCoreLib.Lux.Data
  • Lux.API depends on Core + Data (no UI layer)
  • Lux.UI.Client (WASM) shares Components/ Blazor components with Lux.UI
  • Data layer uses both SQL Server (Identità via ApplicationDbContext) e MySQL (Pomelo, via DataLayerContext)
  • Redis is used for Engine communication channels and caching
  • All projects use <Nullable>enable</Nullable> and <ImplicitUsings>enable</ImplicitUsings>
  • .pubxml IIS publish profiles are version-controlled under Properties/PublishProfiles/
  • Every project has a post-build.ps1 that runs version stamping

Migrations

  • Identity migrations: Lux.UI/Data/Migrations/ (SQL Server, ApplicationDbContext)
  • Domain migrations: EgwCoreLib.Lux.Data/Migrations/ (MySQL, DataLayerContext)

CI/CD

GitLab CI in .gitlab-ci.yml. NuGet sources must be fixed before restore:

dotnet nuget remove source "Steamware Nexus Proxy"
dotnet nuget remove source "nexus-proxy-v3"
dotnet nuget remove source "nexus-hosted"
dotnet nuget add source https://nexus.steamware.net/repository/nuget-proxy-v3/index.json -n nexus-proxy-v3 -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
dotnet nuget add source https://nexus.steamware.net/repository/nuget-hosted/ -n nexus-hosted -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text

Frameworks

  • Radzen.Blazor (UI components)
  • DevExpress (Blazor reporting, used in Report projects + TestDevExpress)
  • Newtonsoft.Json, Swashbuckle, NLog, OpenTelemetry (API + UX)
  • Scrutor (DI extensions)
  • ZiggyCreatures.FusionCache (L1 memory + L2 Redis caching, used in VocabolarioService)

VocabolarioService (translation/i18n)

Located in EgwCoreLib.Lux.Data\Services\Admin\. Follows Repository + Service pattern:

  • VocabolarioRepository (EF Core access via IDbContextFactory)
  • VocabolarioService (Cache orchestration + domain logic)
  • VocabModel / LinguaModel (EF Core entities, table: admin_vocabolario, admin_lingua)

FusionCache (GetOrFetchAsync helper): L1 Memory (1/3 of total duration) + L2 Redis (fail-safe). Tags used for partial invalidation.

  • GetAll e GetById usano 10 min expiration
  • GetByLang e ListLingue usano 5 min expiration
  • Traduci() usa 5 min L1 + 15 min fail-safe
  • CRUD operations (Clone/Delete/Upsert/UpsertMany) invalidano la cache Fusion con _cache.ClearAsync()