Bookmark Domain Entity Relationship Diagram
The data model for the Bookmark Domain is centered around three core entities: Bookmark Entities, Grouping with Collections, and Tagging System.
- Bookmark: The primary entity representing a saved URL. It maintains its own state (Active, Archived, Trashed) and metadata. It has a many-to-many relationship with Tags, stored internally as a list of Tag IDs.
- Tag: A label used to categorize bookmarks. It includes a color attribute and tracks its own usage count across bookmarks.
- Collection: A grouping mechanism for bookmarks. Collections can be "manual" (explicitly managed) or "smart" (populated via a filter rule). It maintains an ordered list of Bookmark IDs.
The relationships are many-to-many in nature, although the implementation uses ID lists within the entities rather than separate join tables, reflecting the in-memory repository pattern used in the codebase.
Note: While the system classification and some docstrings mention "users", no User entity or user-specific fields (like user_id) were found in the current implementation. The API appears to be designed for a single-user context or handles multi-tenancy outside the domain model.
Key Architectural Findings:
- The data model is implemented using Python dataclasses and Enums, managed by an in-memory repository.
- Bookmarks have a many-to-many relationship with Tags, implemented via a list of Tag IDs in the Bookmark entity.
- Collections have a many-to-many relationship with Bookmarks, implemented via a list of Bookmark IDs in the Collection entity.
- Enums are used for BookmarkStatus (ACTIVE, ARCHIVED, TRASHED), CollectionType (MANUAL, SMART), and TagColor (RED, BLUE, GREEN, etc.).
- No User entity or user-related foreign keys were found in the codebase, despite mentions in documentation.
Loading diagram...