Repository navigation
Conversation
Program.cs had grown to 313 lines, most of it service registrations. Move them into extension methods under Startup/, one file per concern: - ApiServices: the tenant provider and the API-layer services - AuthSetup: JWT authentication, the fallback policy, auth rate limiting - DatabaseInitialization: migrations, role seeding, the admin user - RecurringJobs: the Hangfire recurring jobs CORS and the middleware pipeline stay in Program.cs, where their order and the comments explaining it are read together. Configuration is still read at the same point in startup. Program.cs is now 105 lines. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Program.cshad grown to 313 lines, most of it service registrations. The setup moves into extension methods underbackend/Talmidon.Api/Startup/, one file per concern:ApiServices.csAddApiServices(): the tenant provider and every API-layer service, in the same groups and with the same commentsAuthSetup.csAddJwtAuthentication()(secret-length check, JWT validation, authenticated-by-default fallback policy) andAddAuthRateLimiting()DatabaseInitialization.csInitializeDatabaseAsync(): migrations, role seeding, the admin userRecurringJobs.csScheduleRecurringJobs(): the four Hangfire recurring jobsCORS and the middleware pipeline stay in
Program.cs, where their order and the comments explaining it are read together.Program.csis now 105 lines.Why
To keep
Program.csreadable as a short outline of startup, rather than a long list of registrations.Behavior
Nothing changes in behavior. Configuration is still read at the same point in startup, which matters because
TalmidonWebApplicationFactoryrelies on that order.Testing
dotnet build: succeeds. The only warnings are 3 CS8604 warnings that were already there inErrorLogTests.cs.dotnet test Talmidon.Tests: 340 of 340 pass against Postgres.Co-authored with Claude Code.