# tombarys/roam-depot-nautilus architecture

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

- Interactive diagram: https://gitdiagram.com/tombarys/roam-depot-nautilus
- Repository: https://github.com/tombarys/roam-depot-nautilus

## Overview

##### Main Components

a) Frontend Layer (User Interface):
- Task Visualization (Spiral Display)
- Event Renderer
- Progress Tracker

b) Core Processing Layer:
- Task Manager
- Duration Calculator
- Time Slot Allocator
- Progress State Handler
- Event Parser
- Time Range Parser (12h/24h format)
- Event Validator
- Task Scheduler
- Push-forward Algorithm
- Task Reordering System

c) Integration Layer:
- Roam Research API Interface
- TODO Trigger Extension Integration
- Settings Manager

##### Component Relationships

- User Input → Roam Research Page
- Roam Research Page ↔ Nautilus Component
- Nautilus Component → Task Manager
- Task Manager ↔ Event Parser
- Task Manager ↔ Task Scheduler
- All Components ↔ Settings Manager

##### Technical Stack Indicators

Technology usage:
- ClojureScript (main implementation)
- JavaScript (helpers)
- CSS (styling)
- Webpack (bundling)

##### Integration Layer (bottom)

Important Implementation Details to Highlight:
- The component is initialized through Roam's template system (`;;Nautilus`)
- Settings are managed through Roam Depot's extension system
- Task processing happens in real-time based on the current time
- Progress tracking is handled through both UI interactions and text markers

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        RP["Roam Research Page"]
        subgraph NC["Nautilus Component"]
            TV["Task Visualization"]:::ui
            ER["Event Renderer"]:::ui
            PT["Progress Tracker"]:::ui
            LG["Legend Generator"]:::ui
        end
    end

    subgraph PL["Processing Layer"]
        subgraph TM["Task Manager"]
            DC["Duration Calculator"]:::task
            TSA["Time Slot Allocator"]:::task
            PSH["Progress State Handler"]:::task
        end
        
        subgraph EP["Event Parser"]
            TRP["Time Range Parser"]:::event
            EV["Event Validator"]:::event
        end
        
        subgraph TS["Task Scheduler"]
            PFA["Push-forward Algorithm"]:::task
            TRS["Task Reordering System"]:::task
        end
    end

    subgraph IL["Integration Layer"]
        RAI["Roam Research API Interface"]:::integration
        TTI["TODO Trigger Extension"]:::integration
        SM["Settings Manager"]:::integration
    end

    %% Technical Stack
    subgraph Tech["Technical Stack"]
        CLJS["ClojureScript"]:::tech
        JS["JavaScript"]:::tech
        CSS["CSS"]:::tech
        WP["Webpack"]:::tech
    end

    %% Relationships
    RP --> NC
    NC --> TM
    TM <--> EP
    TM <--> TS
    EP <--> RAI
    TS <--> RAI
    TTI <--> RAI
    SM --> NC
    SM --> TM
    SM --> EP
    SM --> TS

    %% Click Events
    click NC "https://github.com/tombarys/roam-depot-nautilus/blob/onload-v2/src/component.cljs"
    click EP "https://github.com/tombarys/roam-depot-nautilus/blob/onload-v2/src/component-ical.cljs"
    click TTI "https://github.com/tombarys/roam-depot-nautilus/blob/onload-v2/src/entry-helpers.js"
    click Tech "https://github.com/tombarys/roam-depot-nautilus/blob/onload-v2/src/index.js"
    click UI "https://github.com/tombarys/roam-depot-nautilus/blob/onload-v2/extension.css"
    click WP "https://github.com/tombarys/roam-depot-nautilus/blob/onload-v2/webpack.config.js"

    %% Styling
    classDef ui fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef task fill:#4169E1,stroke:#333,stroke-width:2px,color:#fff
    classDef event fill:#FFD700,stroke:#333,stroke-width:2px
    classDef integration fill:#90EE90,stroke:#333,stroke-width:2px
    classDef tech fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["UI Components"]:::ui
        L2["Task Processing"]:::task
        L3["Event Handling"]:::event
        L4["Integration Points"]:::integration
        L5["Technical Stack"]:::tech
    end
```
