Files
ClaudeDo/src/ClaudeDo.App/CLAUDE.md
T
2026-08-05 16:46:02 +02:00

1.5 KiB

ClaudeDo.App

Desktop entry point for the ClaudeDo application. Configures DI, initializes the database, and launches the Avalonia window.

Responsibility

  • Program.cs — STA thread, DI container registration (repositories, services, viewmodels), schema init, Avalonia builder
  • App.axaml / App.axaml.cs — Avalonia application lifecycle, main window creation, static ServiceProvider accessor
  • ViewLocator.cs — reflection-based IDataTemplate that maps ViewModels to Views by naming convention

Project references: ClaudeDo.Data, ClaudeDo.Ui. Package versions are in the .csproj — see the root CLAUDE.md for the tech stack.

DI Registration Pattern

  • Singletons — IDbContextFactory, all repositories, GitService, WorkerClient, IReleaseClient, UpdateCheckService, IPrimeScheduleApi, INotesApi, InstallerLocator/WorkerLocator, the three island VMs, and IslandsShellViewModel (the window's DataContext)
  • Transients — modal VMs, several exposed as Func<T> factories for on-demand dialog creation (e.g. Func<DiffViewerViewModel>). ConflictResolverViewModel uses a Func<string, ConflictResolverViewModel> factory keyed by taskId (singleton factory, handed to IslandsShellViewModel.ConflictResolverFactory).

Notes

  • This project owns the composition root — all wiring happens here
  • ViewLocator resolves FooViewModel -> FooView by replacing "ViewModel" with "View" in the type name
  • AvaloniaUI diagnostics are conditionally included (DEBUG only)