Skip to content

Added backend DB schema page with embedded iframe#463

Merged
rahulharpal1603 merged 5 commits intoAOSSIE-Org:mainfrom
ssz2605:add-db-schema
Jul 13, 2025
Merged

Added backend DB schema page with embedded iframe#463
rahulharpal1603 merged 5 commits intoAOSSIE-Org:mainfrom
ssz2605:add-db-schema

Conversation

@ssz2605
Copy link
Contributor

@ssz2605 ssz2605 commented Jul 13, 2025

Summary

  • Added a new docs page: db-schema.md under docs/backend/
  • Embedded the SQLite schema via dbdiagram.io iframe
  • Updated mkdocs.yml to include this in the navigation
image

Closes #458

Summary by CodeRabbit

  • Documentation
    • Added a new "Backend Database Schema" section with an embedded visual diagram of the database design.
    • Updated documentation navigation to include a "DB Schema" entry for easier access.
  • Chores
    • Updated application version to 0.1.1.
  • Documentation
    • Improved backend Python database docs with an interactive schema viewer and direct diagram link.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 13, 2025

Walkthrough

A new documentation file embedding the backend database schema diagram via an iframe has been added. The documentation navigation was updated to include a "DB Schema" entry under the "Home" section, linking to the new schema documentation page.

Changes

File(s) Change Summary
docs/backend/db-schema.md Added a new documentation file embedding the DB schema diagram via iframe.
docs/backend/backend_python/database.md Added a "Database Schema" section with embedded interactive schema viewer and link.
mkdocs.yml Updated navigation to include a "DB Schema" entry under "Home".
backend/app/database/images.py Added clarifying comments to improve code readability; no logic changes.
frontend/src-tauri/tauri.conf.json Updated version from "0.0.1" to "0.1.1".

Assessment against linked issues

Objective Addressed Explanation
Add backend DB diagram page with iframe embedding the dbdiagram.io schema (#458)
Add navigation entry for DB Schema in documentation (#458)

Poem

In docs, a new page now appears,
With diagrams to calm your schema fears.
An iframe window, neat and wide,
Shows tables and links with data inside.
The rabbit hops, documentation complete—
Backend and frontend, now both look neat!
🐇📄

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
mkdocs.yml (1)

60-66: Re-locate “DB Schema” under the existing “Backend” section for clearer IA

Placing the database-specific page at the root of “Home” makes it a sibling of “Overview” and “Setup”, while the rest of the backend docs live under the nested Backend list that follows. Moving it into that existing group keeps related content together and avoids a duplicate top-level entry later if more schema docs appear.

Example diff (indentation adjusted):

-      - DB Schema: backend/db-schema.md
-      - Setup: setup.md
-      - Backend:
+      - Setup: setup.md
+      - Backend:
+          - DB Schema: backend/db-schema.md
           - Python Backend API: backend/backend_python/api.md

This single change improves navigation consistency without affecting page paths.

docs/backend/db-schema.md (1)

5-5: Make the iframe responsive & accessible

Hard-coding width="560" height="315" fixes the iframe to a 16:9 box that clips on narrow screens and lacks an accessibility label. Prefer a responsive style, loading="lazy", and a title attribute:

-<iframe width="560" height="315" src='https://dbdiagram.io/e/685704c4f039ec6d364647e1/68701a53f413ba350850acf9'> </iframe>
+<iframe
+  src="https://dbdiagram.io/e/685704c4f039ec6d364647e1/68701a53f413ba350850acf9"
+  title="PictoPy backend database schema"
+  style="width:100%; aspect-ratio:16/9; border:0;"
+  loading="lazy"
+  allowfullscreen>
+</iframe>

This scales with the viewport, adds an explicit title for screen-readers, and delays loading until the iframe scrolls into view.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe758be and 7faccf6.

📒 Files selected for processing (2)
  • docs/backend/db-schema.md (1 hunks)
  • mkdocs.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Backend Tests
  • GitHub Check: Tauri Tests
🔇 Additional comments (1)
docs/backend/db-schema.md (1)

1-6: Consider an offline-friendly fallback

Because the diagram is hosted externally, builds viewed without internet access (e.g., on an internal network or PDF export) will render a blank area. Providing a static PNG/SVG export or link underneath the iframe mitigates this.

No code change required now—just flagging the potential UX gap.


This section embeds our current database design.

<iframe width="560" height="315" src='https://dbdiagram.io/e/685704c4f039ec6d364647e1/68701a53f413ba350850acf9'> </iframe>
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to create a separate file for this, just put this in backend/backend_python/database.md. Also ensure that the width and height does not have a weird ratio.

Allow users to open the db diagram via this link also: https://dbdiagram.io/d/PictoPy-685704c4f039ec6d364647e1

@rahulharpal1603 rahulharpal1603 added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 13, 2025
@ssz2605
Copy link
Contributor Author

ssz2605 commented Jul 13, 2025

Python.Backend.Database.-.PictoPy.and.4.more.pages.-.Personal.-.Microsoft.Edge.2025-07-13.13-30-42.mp4

@ssz2605
Copy link
Contributor Author

ssz2605 commented Jul 13, 2025

@rahulharpal1603 How's this one? If this is fine then I can update the PR with these changes

@rahulharpal1603
Copy link
Contributor

@rahulharpal1603 How's this one? If this is fine then I can update the PR with these changes

It is good, just shift the schema part to the top of the database section

@ssz2605
Copy link
Contributor Author

ssz2605 commented Jul 13, 2025

@rahulharpal1603 Okay I will.

@ssz2605
Copy link
Contributor Author

ssz2605 commented Jul 13, 2025

@rahulharpal1603 Now please check

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7faccf6 and 1e34603.

📒 Files selected for processing (3)
  • backend/app/database/images.py (5 hunks)
  • docs/backend/backend_python/database.md (2 hunks)
  • frontend/src-tauri/tauri.conf.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • docs/backend/backend_python/database.md
  • backend/app/database/images.py
🧰 Additional context used
🪛 Biome (1.9.4)
frontend/src-tauri/tauri.conf.json

[error] 32-32: unexpected character <

(parse)


[error] 32-32: unexpected character <

(parse)


[error] 32-32: unexpected character <

(parse)


[error] 32-32: unexpected character <

(parse)


[error] 32-32: unexpected character <

(parse)


[error] 32-32: unexpected character <

(parse)


[error] 32-32: String values must be double quoted.

(parse)


[error] 33-33: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 33-33: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 33-33: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 33-34: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 33-34: unexpected character =

(parse)


[error] 34-34: unexpected character =

(parse)


[error] 34-34: unexpected character =

(parse)


[error] 34-34: unexpected character =

(parse)


[error] 34-34: unexpected character =

(parse)


[error] 34-34: unexpected character =

(parse)


[error] 34-34: unexpected character =

(parse)


[error] 35-35: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 35-35: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 35-35: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 35-36: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 35-36: unexpected character >

(parse)


[error] 36-36: unexpected character >

(parse)


[error] 36-36: unexpected character >

(parse)


[error] 36-36: unexpected character >

(parse)


[error] 36-36: unexpected character >

(parse)


[error] 36-36: unexpected character >

(parse)


[error] 36-36: unexpected character >

(parse)


[error] 36-36: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: unexpected character (

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: unexpected character (

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: unexpected character &

(parse)


[error] 36-36: String values must be double quoted.

(parse)


[error] 36-36: unexpected character )

(parse)


[error] 36-36: unexpected character )

(parse)

@rahulharpal1603 rahulharpal1603 merged commit 54e56da into AOSSIE-Org:main Jul 13, 2025
5 checks passed
@rahulharpal1603
Copy link
Contributor

Thank you @ssz2605!

@ssz2605
Copy link
Contributor Author

ssz2605 commented Jul 13, 2025

@rahulharpal1603 Always up for contributing!!.

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: Add backend DB diagram on the docs page

2 participants

Comments