# aurora-opensource/streetscape.gl architecture

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

- Interactive diagram: https://gitdiagram.com/aurora-opensource/streetscape.gl
- Repository: https://github.com/aurora-opensource/streetscape.gl

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Framework Components:
- Core Module (/modules/core)
- Layers Module (/modules/layers)
- Monochrome UI Component Library (/modules/monochrome)
- Main Module (/modules/main)

b) Integration Components:
- Python Bindings (/bindings/python)
- XVIZ Protocol Integration
- WebGL Visualization Layer

##### Component Relationships

**[Client Application]**
- ↓
**[streetscape.gl Main Module]**
- ↓
**┌──────┴───────┬─────────────┬────────────┐**
**[Core Module] [Layers] [Monochrome UI] [XVIZ Protocol]**

- ┴──────────┴───────────┘
- ↓
**[WebGL Visualization Frameworks]**

##### Key Architectural Elements

a) Data Flow Layer:
- XVIZ Loaders (File, Live, Stream)
- WebSocket Communication
- Buffer Management

b) Visualization Layer:
- Custom Layer System
- Point Cloud Rendering
- Traffic Light/Lane Visualization

c) UI Component Layer:
- Playback Controls
- Stream Settings
- Metric Displays

##### Implementation Details

- Rectangles: Core modules
- Hexagons: Data processing components

- Blue: Core components
- Green: Data processing
- Orange: UI components
- Purple: Integration points

**┌─────────────────────────────────────┐**
- Client Layer             │
- ┤
- Integration Layer           │
- ┤
- Core Services             │
- ┤
- Visualization Engine         │
- ┤
- Data Processing            │
- ┘

##### Special Notes

- Modular architecture
- Relationship between XVIZ protocol and visualization components
- Extensibility points for custom layers
- Worker farm architecture for performance
- Connection between Python bindings and core functionality

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef client fill:#e1f5fe,stroke:#01579b
    classDef core fill:#e8f5e9,stroke:#1b5e20
    classDef integration fill:#fff3e0,stroke:#e65100
    classDef ui fill:#f3e5f5,stroke:#4a148c
    classDef processing fill:#fbe9e7,stroke:#bf360c
    classDef visualization fill:#e8eaf6,stroke:#1a237e

    %% Client Layer
    subgraph ClientLayer
        Client["Client Application"]:::client
    end

    %% Integration Layer
    subgraph IntegrationLayer
        Main["Main Module"]:::integration
        PythonBindings["Python Bindings"]:::integration
    end

    %% Core Services Layer
    subgraph CoreServices
        CoreModule["Core Module"]:::core
        LayersModule["Layers Module"]:::core
        MonochromeUI["Monochrome UI Library"]:::core
        XVIZProtocol["XVIZ Protocol Integration"]:::core
    end

    %% Visualization Engine Layer
    subgraph VisualizationEngine
        VisLayer["Visualization Layer"]:::visualization
        CustomLayers["Custom Layer System"]:::visualization
        PointCloud["Point Cloud Rendering"]:::visualization
        TrafficLight["Traffic Light Visualization"]:::visualization
    end

    %% Data Processing Layer
    subgraph DataProcessing
        WorkerFarm["Worker Farm"]:::processing
        StreamMgmt["Stream Management"]:::processing
        PlaybackCtrl["Playback Controls"]:::processing
        StreamSettings["Stream Settings"]:::processing
    end

    %% Relationships
    Client --> Main
    Main --> CoreModule
    Main --> LayersModule
    Main --> MonochromeUI
    Main --> XVIZProtocol
    CoreModule --> VisLayer
    LayersModule --> CustomLayers
    MonochromeUI --> PlaybackCtrl
    XVIZProtocol --> WorkerFarm
    WorkerFarm --> StreamMgmt
    VisLayer --> PointCloud
    VisLayer --> TrafficLight
    StreamMgmt --> PlaybackCtrl
    StreamMgmt --> StreamSettings
    PythonBindings --> CoreModule

    %% Click events for component mapping
    click CoreModule "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/core"
    click LayersModule "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/layers"
    click MonochromeUI "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/monochrome"
    click Main "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/main"
    click PythonBindings "https://github.com/aurora-opensource/streetscape.gl/tree/master/bindings/python"
    click XVIZProtocol "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/core/src/loaders"
    click VisLayer "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/core/src/components/log-viewer"
    click PlaybackCtrl "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/core/src/components/playback-control"
    click StreamSettings "https://github.com/aurora-opensource/streetscape.gl/blob/master/modules/core/src/components/stream-settings-panel.js"
    click PointCloud "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/core/src/layers/point-cloud-layer"
    click TrafficLight "https://github.com/aurora-opensource/streetscape.gl/tree/master/modules/layers/src/traffic-light-layer"
    click CustomLayers "https://github.com/aurora-opensource/streetscape.gl/blob/master/modules/core/src/layers/xviz-layer.js"
    click WorkerFarm "https://github.com/aurora-opensource/streetscape.gl/blob/master/modules/core/src/perf/xviz-worker-farm-status.js"
    click StreamMgmt "https://github.com/aurora-opensource/streetscape.gl/blob/master/modules/core/src/utils/stream-utils.js"

    %% Legend
    subgraph Legend
        Client2["Client Components"]:::client
        Core2["Core Components"]:::core
        Integration2["Integration Components"]:::integration
        UI2["UI Components"]:::ui
        Processing2["Processing Components"]:::processing
        Visualization2["Visualization Components"]:::visualization
    end
```
