refactor(backend): Split main.py into modular route files#87
Merged
Conversation
- Frontend tests only run when frontend/ changes - Backend tests only run when backend/ changes - Vercel skips deploy if no frontend changes - Uses dorny/paths-filter for change detection
- Replace 826 lines with 105 lines - Import and include all routers - Add lifespan context for startup/shutdown - Keep middleware and error handlers
- Change imports from 'main' to 'dependencies' and 'routes.repos' - Update file path checks to look in route modules instead of main.py - All 49 tests passing
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
- Fix HIGH: Path traversal in input_validator.py - Use os.path.normpath instead of Path.resolve() - Avoid filesystem access during validation - Safer containment check without symlink resolution - Fix MEDIUM: Add explicit permissions to CI workflow - Add 'contents: read' permission block - Limits GITHUB_TOKEN scope per security best practices
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
Refactors the monolithic
main.py(826 lines) into modular route files for better maintainability and separation of concerns.Closes #52
Changes
New Files
dependencies.pyroutes/health.pyroutes/playground.pyroutes/repos.pyroutes/search.pyroutes/analysis.pyroutes/api_keys.pyRefactored
Updated Tests
maintodependenciesandroutes.reposArchitecture
Testing
Notes
/api/v1/) will be addressed in feat(backend): Add API versioning (/api/v1/) #55