Files

20 lines
2.6 KiB
Markdown

# Tech stack decisions: hero-module
| # | Decision | Rationale | Alternatives and why not |
|---|---|---|---|
| T1 | **Magick.NET-Q8-AnyCPU 15.1.0** (Apache-2.0) behind `IImageProcessor` | Widest formats (JPEG, PNG, GIF, BMP, TIFF, WebP, AVIF read and write; HEIC/HEIF read as a declared capability), WebP and AVIF output, 128 MB peak for 24 MP, resource limits; proven on win-x64 and linux-x64 (library-proof.md) | NetVips (reserve; no BMP, LGPL natives); ImageSharp 4 (paid licence key needed to build); SkiaSharp (no TIFF or AVIF) |
| T2 | Q8 build (8 bit per channel) | Enough for web output, half the memory of Q16 | Q16 |
| T3 | `IMediaStore` with a **file-system store** in a directory outside the release (`Media:Directory`) | Bryan's decision; database store possible later behind the interface | Database blobs (rejected by Bryan; `max_allowed_packet` risk) |
| T4 | New module project `SlpModularCms.Modules.Hero` + test project; `Core.Media` in the existing Core project | Follows the existing module layout and the decision for a general media service | A separate Media assembly (not needed yet) |
| T5 | EF Core with the existing MySQL provider and hand-written migration, `NonLockingMySQLHistoryRepository` | Same as Offerings | n/a |
| T6 | Frontend: existing React, React Query, i18n; focus editor an own component; `focusMath` TypeScript twin | Bryan's choice (no cropping package) | react-easy-crop |
| T7 | Property-based tests: **FsCheck** (xUnit integration) for the pure functions in C#; **fast-check** if already present in the frontend, otherwise example vectors shared between C# and TypeScript | Extension partial; check the existing test dependencies in H1 and add only what is missing | Hand-written random loops |
| T8 | Start-up self-test as a hosted service; clean-up as a hosted `BackgroundService` (daily) | Same pattern as `ContactRetentionService` | A cron outside the host |
| T9 | Rate limiting through the existing ASP.NET Core rate limiter policies (`hero-public`, `media-public`, `hero-upload`) | Existing mechanism | n/a |
## Package and publish notes
- `Magick.NET-Q8-AnyCPU` carries natives for several platforms; the self-contained win-x64 publish must keep only the matching native (to be verified in a publish test in H1) and the Linux publish must include `Magick.Native-Q8-x64.dll.so` or `-arm64`.
- The CI vulnerability scan covers the new package automatically (transitive and direct).
- The package size (about 35 MB per platform native) is acceptable for the release artifacts; checked against the SCP upload limit (see `deployment-instructions.md` 1.7.3) in Infrastructure Design.