A web-based git diff viewer and review tool that provides an interface for reviewing code changes. The project consists of:
- FastAPI web server - Serves the review interface and API endpoints
- MCP server integration - Provides tools for starting review sessions and collecting comments
- Git integration - Reads diffs from git repositories and presents them in a reviewable format
- Review session management - Handles comment collection and review state
src/backloop/server.py- Main FastAPI web serversrc/backloop/mcp/server.py- MCP server integrationsrc/backloop/review_manager.py- Review session managementsrc/backloop/git_service.py- Git operations and diff parsingsrc/backloop/models.py- Data modelssrc/backloop/api/router.py- API endpoints
Use empty init.py files and keep them empty. All code goes into separate files.
Alway use package-relative imports of the form from my_project.foo import bar
Before committing code changes, always run the test suite to ensure nothing is broken:
uv run pytestFor faster feedback during development, you can run specific test files:
# Run only unit tests (fast)
uv run pytest tests/test_models.py tests/test_git_service.py
# Run E2E integration tests (slower, but comprehensive)
uv run pytest tests/test_e2e_integration.pyThe E2E integration tests start a real server and test the complete frontend + backend integration, so they take longer to run but provide the most confidence that everything works together correctly.