# lucasjunqueira-var/tilbuci architecture

> Architecture diagram of the GitHub repository lucasjunqueira-var/tilbuci, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lucasjunqueira-var/tilbuci
- Repository: https://github.com/lucasjunqueira-var/tilbuci

## Overview

##### Main System Components

a) Client-Side Applications
- Editor Application (Haxe-based)
- Player Component
- Multiple Runtime Environments (Desktop, Mobile, PWA, Website)

b) Server-Side Infrastructure
- Web Services Layer
- Media Management
- User Management
- Database Layer

##### Key Architectural Elements to Highlight

a) Frontend Architecture:
- Main components under app/Source/com/tilbuci:
- Editor (core editing functionality)
- Player (runtime player)
- UI Components (extensive UI system)
- Components (various media types)
- Plugin System
- Script Engine

b) Backend Architecture:
- Web Services (server/app/WS* files)
- Core Services (Movie, Scene, Media management)
- Data Storage
- Export Systems (Desktop, Cordova, PWA, Website)

**[Client Layer]**
- Editor Interface
- UI Components
- Media Handlers
- Script Engine

- Player Runtime
- Display Engine
- Plugin System
- Contraptions

- Export Targets
- Desktop
- PWA
- Website
- Cordova

**[Server Layer]**
- Web Services API
- User Management
- Media Services
- Movie Management
- Scene Management

- Core Services
- File Management
- Export Services
- Analytics

- Data Storage

##### Important Relationships

- Data flow between Editor and Server
- Plugin integration points
- Media asset flow
- Runtime deployment paths
- User interaction flows

##### Technical Details

Annotations for:
- Haxe compilation targets
- PHP backend services
- Database schema references
- Export format specifications
- Plugin API endpoints

- User Interface Layer
- Business Logic Layer
- Data Access Layer
- Runtime Environments
- External Services

This structure will help other developers understand both the high-level architecture and the detailed component interactions while maintaining clarity about the system's capabilities and constraints.

## Diagram (Mermaid)

```mermaid
%%{init: {
  'theme': 'base',
  'themeVariables': {
    'primaryColor': '#2b2b2b',
    'primaryTextColor': '#fff',
    'primaryBorderColor': '#7C0000',
    'lineColor': '#F8B229',
    'secondaryColor': '#006100',
    'tertiaryColor': '#fff'
  }
}}%%

flowchart TB
    classDef frontend fill:#4a90e2,stroke:#2b2b2b,color:#fff
    classDef backend fill:#f39c12,stroke:#2b2b2b,color:#fff
    classDef runtime fill:#2ecc71,stroke:#2b2b2b,color:#fff
    classDef storage fill:#95a5a6,stroke:#2b2b2b,color:#fff
    classDef plugin fill:#9b59b6,stroke:#2b2b2b,color:#fff

    subgraph Client["Client Layer"]
        Editor["Editor Application"]:::frontend
        Player["Player Component"]:::frontend
        
        subgraph UI["UI Layer"]
            UIComp["UI Components"]:::frontend
            DisplayComp["Display Components"]:::frontend
            DataDef["Data Definitions"]:::frontend
        end
        
        subgraph Core["Core Systems"]
            Plugin["Plugin System"]:::plugin
            Script["Script Engine"]:::frontend
            Contraptions["Contraptions System"]:::frontend
        end
        
        subgraph Runtime["Runtime Environments"]
            Desktop["Desktop Export"]:::runtime
            PWA["PWA Export"]:::runtime
            Website["Website Export"]:::runtime
            Cordova["Cordova Export"]:::runtime
        end
    end
    
    subgraph Server["Server Layer"]
        WebServices["Web Services API"]:::backend
        
        subgraph Services["Core Services"]
            MovieMgmt["Movie Management"]:::backend
            SceneMgmt["Scene Management"]:::backend
            MediaMgmt["Media Management"]:::backend
            UserMgmt["User Management"]:::backend
        end
        
        subgraph Export["Export Services"]
            ExportSys["Export System"]:::backend
        end
        
        DB[(Database)]:::storage
    end

    Editor --> WebServices
    Player --> WebServices
    WebServices --> Services
    Services --> DB
    Core --> Runtime
    ExportSys --> Runtime

    click Editor "https://github.com/lucasjunqueira-var/tilbuci/blob/main/app/Source/com/tilbuci/Editor.hx"
    click Player "https://github.com/lucasjunqueira-var/tilbuci/blob/main/app/Source/com/tilbuci/Player.hx"
    click UIComp "https://github.com/lucasjunqueira-var/tilbuci/tree/main/app/Source/com/tilbuci/ui/"
    click DisplayComp "https://github.com/lucasjunqueira-var/tilbuci/tree/main/app/Source/com/tilbuci/display/"
    click Plugin "https://github.com/lucasjunqueira-var/tilbuci/tree/main/app/Source/com/tilbuci/plugin/"
    click Script "https://github.com/lucasjunqueira-var/tilbuci/tree/main/app/Source/com/tilbuci/script/"
    click DataDef "https://github.com/lucasjunqueira-var/tilbuci/tree/main/app/Source/com/tilbuci/def/"
    click Contraptions "https://github.com/lucasjunqueira-var/tilbuci/tree/main/app/Source/com/tilbuci/contraptions/"
    click WebServices "https://github.com/lucasjunqueira-var/tilbuci/blob/main/server/app/Webservice.php"
    click MediaMgmt "https://github.com/lucasjunqueira-var/tilbuci/blob/main/server/app/WSMedia.php"
    click UserMgmt "https://github.com/lucasjunqueira-var/tilbuci/blob/main/server/app/WSUser.php"
    click MovieMgmt "https://github.com/lucasjunqueira-var/tilbuci/blob/main/server/app/WSMovie.php"
    click SceneMgmt "https://github.com/lucasjunqueira-var/tilbuci/blob/main/server/app/WSScene.php"
    click ExportSys "https://github.com/lucasjunqueira-var/tilbuci/tree/main/server/export/"
    click Desktop "https://github.com/lucasjunqueira-var/tilbuci/tree/main/server/export/desktop/"
    click PWA "https://github.com/lucasjunqueira-var/tilbuci/tree/main/server/export/pwa/"
    click Website "https://github.com/lucasjunqueira-var/tilbuci/tree/main/server/export/site/"
    click Cordova "https://github.com/lucasjunqueira-var/tilbuci/tree/main/server/export/cordova/"
```
