Repository navigation
refactor(api): organize code by feature - #66
Merged
Merged
Conversation
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.
Summary
Reorganizes the Express backend around product features so its high-level structure matches the frontend's feature-based organization and the architecture already documented for GoForLift.
This is a structure-only refactor. Routes, contracts, database behavior, authentication behavior, and API responses are unchanged.
What changed
apps/api/src/authtoapps/api/src/features/auth.apps/api/src/exercisestoapps/api/src/features/exercises.featuresdirectory level.server.tscomposition-root imports to use the new feature paths.config,db, andtestat the API source root because they support multiple features and are shared infrastructure.Resulting structure
Why this structure
authandexercisesrepresent product capabilities, so grouping them underfeaturesmakes feature ownership visible at a glance and keeps related routes, services, middleware, and tests together.config,db, andtestremain outsidefeaturesbecause they are shared infrastructure. Moving them under a specific feature would imply ownership that they do not have.This also makes the API consistent with the existing architectural guidance in
AGENTS.mdanddocs/architecture.md. No documentation changes were necessary because both files already prescribe this organization.Behavioral impact
None. Git recognizes all 18 source-file changes as moves, with only relative import paths adjusted. Endpoint URLs remain:
/auth/*/exercises/healthVerification