# fthozdemir/daedalos architecture

> Architecture diagram of the GitHub repository fthozdemir/daedalos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fthozdemir/daedalos
- Repository: https://github.com/fthozdemir/daedalos

## Overview

##### Main Components (Top Level)

a. Frontend Layer:
- Desktop Environment (core UI)
- Window Management System
- Start Menu & Taskbar
- File System Interface

b. Application Layer:
- Native Web Apps (Browser, Terminal, etc.)
- Emulators (BoxedWine, js-dos, etc.)
- Media Players (Video, Audio, PDF)
- Development Tools (Monaco Editor, DevTools)

c. System Services:
- File System Service (BrowserFS)
- Process Management
- Window Management
- Background Services (Clock, AI Chat)

##### Key Relationships to Highlight

- Data flow between components
- Component dependencies
- User interaction paths
- File system access patterns

##### Architectural Patterns to Emphasize

a. Web Workers Architecture:
- Parallel processing for background tasks
- OffscreenCanvas usage for animations
- Worker communication patterns

b. Storage Architecture:
- IndexedDB integration
- File system abstraction
- Cache management

c. Window Management:
- Window state management
- Event handling system
- Drag and drop functionality

##### Technical Details

Create subsections showing:
- BrowserFS implementation
- Web API integrations
- External service connections (NTP, IPFS)
- Application loading/lifecycle

##### Implementation Notes

Callouts for:
- React/Next.js framework usage
- TypeScript implementation
- Web API utilization
- Performance optimizations

##### Storage Layer (foundation)

Remember to emphasize the web-based nature of the system while showing how it mimics traditional desktop OS functionality. Include notes about browser compatibility and performance considerations.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI_Layer
        DE[Desktop Environment]
        WMS[Window Management System]
        SM[Start Menu]
        TB[Taskbar]
        FSI[File System Interface]
        MS[Menu System]
    end

    subgraph Apps_Layer
        subgraph Native_Apps
            BR[Browser]
            TE[Terminal]
            FE[File Explorer]
            ME[Monaco Editor]
        end

        subgraph Media_Players
            VP[Video Player]
            PDF[PDF Viewer]
        end

        subgraph Emulators
            BW[BoxedWine]
            DOS[JS-DOS]
            V86[V86]
        end
    end

    subgraph System_Services
        FSS[File System Service]
        PM[Process Management]
        SM_S[Session Management]

        subgraph Background_Services
            CLK[Clock Service]
            AI[AI Chat Service]
        end
    end

    %% Relationships
    DE --> WMS
    DE --> FSI
    WMS --> Apps_Layer
    SM --> Native_Apps
    SM --> Media_Players
    SM --> Emulators
    TB --> Background_Services
    FSI --> FSS
    Native_Apps --> FSS
    Media_Players --> FSS
    Emulators --> FSS
    PM --> Apps_Layer
    SM_S --> Apps_Layer

    %% Styling
    classDef core fill:#2374ab
    classDef apps fill:#2a9d8f
    classDef services fill:#e9c46a
    classDef storage fill:#8338ec
    classDef ui fill:#264653

    class DE,WMS,SM,TB,FSI,MS ui
    class BR,TE,FE,ME,VP,PDF,BW,DOS,V86 apps
    class FSS,PM,SM_S,CLK,AI services

    %% Click Events
    click DE "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Desktop/"
    click WMS "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Window/"
    click SM "https://github.com/fthozdemir/daedalOS/tree/main/components/system/StartMenu/"
    click TB "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Taskbar/"
    click FSI "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Files/"
    click MS "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Menu/"
    click BR "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/Browser/"
    click TE "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/Terminal/"
    click FE "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/FileExplorer/"
    click ME "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/MonacoEditor/"
    click VP "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/VideoPlayer/"
    click PDF "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/PDF/"
    click BW "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/BoxedWine/"
    click DOS "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/JSDOS/"
    click V86 "https://github.com/fthozdemir/daedalOS/tree/main/components/apps/V86/"
    click FSS "https://github.com/fthozdemir/daedalOS/tree/main/contexts/fileSystem/"
    click PM "https://github.com/fthozdemir/daedalOS/tree/main/contexts/process/"
    click SM_S "https://github.com/fthozdemir/daedalOS/tree/main/contexts/session/"
    click CLK "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Taskbar/Clock/"
    click AI "https://github.com/fthozdemir/daedalOS/tree/main/components/system/Taskbar/AI/"
```
