Skip to content

DOC: Update backend routes directory structure documentation#1367

Open
Dotify71 wants to merge 4 commits into
AOSSIE-Org:mainfrom
Dotify71:docs/fix-routes-directory-structure
Open

DOC: Update backend routes directory structure documentation#1367
Dotify71 wants to merge 4 commits into
AOSSIE-Org:mainfrom
Dotify71:docs/fix-routes-directory-structure

Conversation

@Dotify71

@Dotify71 Dotify71 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This PR updates the Routes table in docs/backend/backend_python/directory-structure.md to accurately reflect the current state of the backend/app/routes/ directory.

Changes

  • Removed facetagging.py from the documentation, as the file no longer exists in the codebase.
  • Added memories.py, detailing the endpoints for generating location and time-based photo memories.
  • Added models.py, documenting the endpoints used for AI model management (download status, hardware recommendations, setup, and deletion).
  • Added shutdown.py, covering the endpoint responsible for gracefully terminating the backend process.

(Note: test.py was 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

  • Documentation
    • Updated backend directory documentation by reformatting sections into consistent “Name/Description” tables.
    • Refreshed the documented inventory across database modules, ML model wrappers, and utility/schemas.
    • Added entries for newly documented route modules and revised existing route descriptions.
    • Removed an outdated route entry from the documented structure.

…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
@github-actions github-actions Bot added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updated the backend directory-structure documentation with consistent tables, revised module descriptions, updated route entries, and a documented reset_embeddings.py script.

Changes

Backend directory documentation

Layer / File(s) Summary
Update backend directory inventory
docs/backend/backend_python/directory-structure.md
Reformatted configuration, database, model, route, schema, utility, and script sections into Name/Description tables; added current modules and revised descriptions, including route and script inventory changes.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: Documentation

Suggested reviewers: rohan-pandeyy

Poem

A rabbit hops through tables bright,
With names and notes arranged just right,
New routes peek and scripts appear,
Old entries vanish, clean and clear,
Documentation brings delight!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documentation update to the backend routes directory structure.
Linked Issues check ✅ Passed The PR matches #1257 by improving backend documentation structure and accurately listing active route files.
Out of Scope Changes check ✅ Passed The changes are confined to the documented backend directory structure and do not introduce unrelated scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ffc0d48 and 54698b7.

📒 Files selected for processing (1)
  • docs/backend/backend_python/directory-structure.md

Comment thread docs/backend/backend_python/directory-structure.md Outdated
@Dotify71 Dotify71 changed the title docs: fix stale and missing entries in backend routes directory structure DOC: Update backend routes directory structure documentation Jul 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR has merge conflicts.

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:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f711db and 12724a0.

📒 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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Comment on lines +101 to +102
| `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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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.

Suggested change
| `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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Visual & Structural Improvements (Multi-assignable issue)

1 participant