Skip to content

Architecture

Table of Contents

  1. Overview
  2. Content Tree Architecture
  3. Technical Requirements
  4. Database Schema
  5. Security Considerations
  6. Implementation Details
  7. Best Practices
  8. Future Enhancements

Overview

Loryth CMS is built with a modular architecture that emphasizes content management flexibility, version control, and scalability. At its core, it uses a sophisticated content tree structure that manages content relationships and versioning.

Content Tree Architecture

Structure Overview

graph TD 
    CT[Content Tree] --> H[Head Revision] 
    CT --> N[Nodes] 
    CT --> R[Revisions]
    N --> N1[Node 1]
    N --> N2[Node 2]
    N --> N3[Node 3]

    R --> R1[Revision 1]
    R --> R2[Revision 2]
    R --> R3[Revision 3]

    R1 --> MD1[Metadata]
    R1 --> C1[Content]
    R1 --> S1[Status]

    R2 --> MD2[Metadata]
    R2 --> C2[Content]
    R2 --> S2[Status]

    class CT tree
    class H,R,R1,R2,R3 revision
    class N,N1,N2,N3 node
    class MD1,MD2,C1,C2,S1,S2 content

Core Components

  1. Content Tree
  2. Acts as the root container for all content
  3. Maintains references to:

    • Current head revision
    • All content nodes
    • Complete revision history
  4. Content Nodes

  5. Represent individual content items
  6. Can be organized hierarchically
  7. Hold structural relationship information
  8. Support multiple content types

  9. Content Revisions

  10. Version-controlled snapshots of content
  11. Properties:
    • Unique version number
    • Author information
    • Timestamp
    • Change comments
    • Content status (PENDING, PUBLISHED, etc.)
  12. Support for branching and merging

Version Control System

The content tree implements a Git-like version control system with the following features:

  1. Linear History

    graph LR
       R1[Rev 1] --> R2[Rev 2] --> R3[Rev 3] --> R4[Rev 4]

  2. Branching Support

    graph LR
       R1[Rev 1] --> R2[Rev 2] --> R3[Rev 3]
       R2 --> B1[Branch A]
       R2 --> B2[Branch B]

Content States

Content revisions can exist in the following states:

  1. PENDING
  2. Changes are saved but not published
  3. Available for review and editing

  4. PUBLISHED

  5. Content is live and publicly accessible
  6. Represents the current production version

  7. ARCHIVED

  8. Historical versions
  9. Preserved for audit and rollback purposes

Key Features

  1. Atomic Updates
  2. All changes within a revision are atomic
  3. Ensures content consistency

  4. Revision Tracking

  5. Complete audit trail of changes
  6. Author attribution
  7. Timestamp information
  8. Change comments

  9. Content Relationships

  10. Hierarchical structure support
  11. Cross-referencing between content items
  12. Maintains referential integrity

  13. Version Management

  14. Easy rollback to previous versions
  15. Compare different revisions
  16. Branch management for concurrent editing

Implementation Details

The content tree is implemented using: - SQLAlchemy for database operations - UUID-based identifiers for global uniqueness - Relationship mappings for efficient queries - Optimistic locking for concurrent access

Best Practices

When working with the content tree:

  1. Revision Management
  2. Always create new revisions for significant changes
  3. Include meaningful commit messages
  4. Review changes before publishing

  5. Content Organization

  6. Use logical hierarchical structures
  7. Maintain clean content relationships
  8. Regular cleanup of unused revisions

  9. Performance Considerations

  10. Implement lazy loading for large content trees
  11. Use appropriate indexes
  12. Cache frequently accessed revisions

Database Schema

erDiagram
    ContentTree ||--o{ Node : contains
    Node ||--o{ Revision : has
    Revision ||--|| Metadata : has
    Revision ||--|| Content : has
    Revision ||--|| Status : has

Future Enhancements

Planned improvements to the content tree architecture include:

  1. Enhanced Branching
  2. Improved merge conflict resolution
  3. Branch policies and permissions

  4. Performance Optimizations

  5. Revision pruning strategies
  6. Improved caching mechanisms

  7. Advanced Features

  8. Content scheduling
  9. Automated content workflows
  10. Enhanced diff visualization