DOC: Update backend routes directory structure documentation#1367
Conversation
…ture The Routes table in docs/backend/backend_python/directory-structure.md was outdated in two ways: - facetagging.py was listed but no longer exists in backend/app/routes/ - memories.py, models.py, and shutdown.py were active route files that were missing from the table entirely This commit: - Removes the stale facetagging.py entry - Adds memories.py with a description based on its Memories API docstring - Adds models.py with a description based on its model management endpoints - Adds shutdown.py with a description based on its graceful shutdown logic No code changes were made. This is a documentation-only correction. Related to AOSSIE-Org#1257
WalkthroughUpdated the backend directory-structure documentation with consistent tables, revised module descriptions, updated route entries, and a documented ChangesBackend directory documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/backend/backend_python/directory-structure.md`:
- Around line 61-70: The routes table in the backend Python directory structure
doc needs reflowing to satisfy markdownlint MD060. Update the table under the
route files section so the pipe columns are consistently aligned across all
rows, especially the `Description` column entries. Keep the content unchanged
and adjust spacing in the table around the `albums.py`, `memories.py`, and
related rows to make the markdown lint clean.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cdd1e657-68c9-4288-a62e-036e823aaf90
📒 Files selected for processing (1)
docs/backend/backend_python/directory-structure.md
|
Please resolve the merge conflicts before review. Your PR will only be reviewed by a maintainer after all conflicts have been resolved. 📺 Watch this video to understand why conflicts occur and how to resolve them: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/backend/backend_python/directory-structure.md`:
- Line 74: Update the shutdown.py description in the directory structure table
to avoid calling the cross-platform behavior graceful. Describe it as
terminating the backend process on all platforms, or explicitly distinguish
graceful Unix shutdown from immediate Windows termination.
- Around line 101-102: Update the utility descriptions in the directory
structure table: add spaces after the commas in the image_metadata.py and
images.py entries, changing “EXIF,size,format” to “EXIF, size, format” and
“classifies,updates” to “classifies, updates”.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 398fc429-310a-4b02-82d1-ce821641b7b3
📒 Files selected for processing (1)
docs/backend/backend_python/directory-structure.md
| | `images.py` | Deals with image-related operations (adding, deleting, retrieving images and their metadata), plus `GET /images/semantic-search` (see [Semantic Search](semantic-search.md)). | | ||
| | `memories.py` | Provides endpoints to generate photo memories grouped by location and time, retrieve a timeline, and fetch on-this-day recollections. | | ||
| | `models.py` | Installs/uninstalls model tiers (including the `semantic` SigLIP2 bundle), reports install status, tracks SSE download progress, and exposes routes to get hardware recommendations. | | ||
| | `shutdown.py` | Provides a single endpoint to gracefully terminate the PictoPy backend process on all platforms. | |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Do not describe the Windows shutdown path as graceful.
backend/app/routes/shutdown.py calls os._exit(0) on Windows, which bypasses normal cleanup. Use wording such as “terminates the backend process on all platforms,” or distinguish graceful Unix shutdown from immediate Windows termination.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/backend/backend_python/directory-structure.md` at line 74, Update the
shutdown.py description in the directory structure table to avoid calling the
cross-platform behavior graceful. Describe it as terminating the backend process
on all platforms, or explicitly distinguish graceful Unix shutdown from
immediate Windows termination.
| | `image_metadata.py` | Extracts image metadata including EXIF,size,format, and creation date safely | | ||
| | `images.py` | Processes images in folders: thumbnails, detects faces, classifies,updates DB | |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix spacing typos in the utility descriptions.
Please change EXIF,size,format to EXIF, size, format and classifies,updates to classifies, updates.
As per path instructions, documentation and comments must be free of spelling mistakes.
Suggested fix
-| `image_metadata.py` | Extracts image metadata including EXIF,size,format, and creation date safely
+| `image_metadata.py` | Extracts image metadata including EXIF, size, format, and creation date safely
-| `images.py` | Processes images in folders: thumbnails, detects faces, classifies,updates DB
+| `images.py` | Processes images in folders: thumbnails, detects faces, classifies, updates DB📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | `image_metadata.py` | Extracts image metadata including EXIF,size,format, and creation date safely | | |
| | `images.py` | Processes images in folders: thumbnails, detects faces, classifies,updates DB | | |
| | `image_metadata.py` | Extracts image metadata including EXIF, size, format, and creation date safely | | |
| | `images.py` | Processes images in folders: thumbnails, detects faces, classifies, updates DB | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/backend/backend_python/directory-structure.md` around lines 101 - 102,
Update the utility descriptions in the directory structure table: add spaces
after the commas in the image_metadata.py and images.py entries, changing
“EXIF,size,format” to “EXIF, size, format” and “classifies,updates” to
“classifies, updates”.
Source: Path instructions
This PR updates the Routes table in
docs/backend/backend_python/directory-structure.mdto accurately reflect the current state of thebackend/app/routes/directory.Changes
facetagging.pyfrom the documentation, as the file no longer exists in the codebase.memories.py, detailing the endpoints for generating location and time-based photo memories.models.py, documenting the endpoints used for AI model management (download status, hardware recommendations, setup, and deletion).shutdown.py, covering the endpoint responsible for gracefully terminating the backend process.(Note:
test.pywas intentionally omitted since its contents are currently commented out and it does not register an active router.)This addresses the scoped documentation improvements confirmed in the issue discussion.
Closes #1257
Summary by CodeRabbit