You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Group Program.cs DI/service registration into extension methods #291
src/Cluckwork.Api/Program.cs is ~1026 lines. Endpoint mapping is already modular (each feature has its own Map<Feature>Endpoints extension), and the run-then-exit CLI commands are being extracted separately (#288). The remaining bulk is the long inline service-registration block — dozens of builder.Services.Add… calls for persistence/EF, identity/JWT, telemetry/OTel, rate limiting, feature handlers/validators/repositories, health checks, etc.
Proposal
Group the registrations into AddCluckwork*(this IServiceCollection, IConfiguration) extension methods by concern, e.g.:
So the ConfigureServices section of Program.cs reads as a handful of builder.Services.AddCluckwork*() calls, keeping the wiring discoverable and the bootstrapper small.
Constraints
Pure, behaviour-preserving refactor — no registration added/removed/reordered in a way that changes resolution; the full suite must stay green unchanged.
Follow the existing Map<Feature>Endpoints extension-method convention.
Activity
refactor(api): extract run-then-exit CLI commands out of Program.cs (#…
feat(api): migrate command + prod migration split (#263) + extract CL…
docs: pin the one-serving-instance deploy invariant (#271) (#484)