# debrief/reactol architecture

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

- Interactive diagram: https://gitdiagram.com/debrief/reactol
- Repository: https://github.com/debrief/reactol

## Overview

##### Main Components

a. Frontend Architecture (Primary Focus):
- React Application Layer
- OpenLayers Map Integration
- State Management (Redux, based on the store.ts and slices)
- UI Components Layer
- Data Processing Layer

b. Data Processing Components:
- Track Processing System
- Geospatial Calculations Engine
- Time Management System
- Data Loaders

##### Key Relationships to Highlight

**[User Interface Layer]**
- ↓↑
**[React Components]**
- ↓↑
**[State Management]**
- ↓↑
**[Data Processing Layer]**
- ↓↑
**[Map Rendering Layer]**

##### Specific Implementation Details

a. UI Components Section:
- GraphModal
- HomeControl
- Layers
- LoadTrackModal
- Properties
- TimeControl
- Spatial Components (Map, Track, Zone, Point)

b. Data Processing Section:
- Calculations (bearing, course, range, speed)
- Track Filtering
- Time Management
- GeoJSON Processing

c. Integration:
- OpenLayers Integration
- Tile Management
- Spatial Features Handling

##### Additional Elements

- Data format transformations (JSON, GeoJSON)
- Time control flow
- Calculation pipeline
- State update cycle

**[User Interface]**
- ↓↑
**[React Component Layer]**
- UI Components
- Spatial Components
- Control Components
- ↓↑
**[Application Core]**
- State Management
- Data Processing
- Time Management
- ↓↑
**[Map Integration Layer]**
- OpenLayers
- Tile System
- Spatial Rendering

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI
        UI1[GraphModal]:::ui
        UI2[HomeControl]:::ui
        UI3[Layers]:::ui
        UI4[LoadTrackModal]:::ui
        UI5[Properties]:::ui
        UI6[TimeControl]:::ui
    end

    subgraph Spatial
        SP1[Map]:::spatial
        SP2[Track]:::spatial
        SP3[Zone]:::spatial
        SP4[Point]:::spatial
        SP5[AutoGraticule]:::spatial
        SP6[MouseCoordinates]:::spatial
    end

    subgraph DataProcessing
        DP1[Calculations Engine]:::data
        DP2[Track Filtering]:::data
        DP3[Track Calculations]:::data
        DP4[Feature Processing]:::data
    end

    subgraph TimeManagement
        TM1[Time Support]:::time
        TM2[Time Bounds]:::time
        TM3[Time Value Processing]:::time
        TM4[DTG Conversion]:::time
    end

    subgraph StateManagement
        SM1[Store]:::state
        SM2[Context]:::state
        SM3[Features Slice]:::state
    end

    subgraph DataLoaders
        DL1[JSON Loader]:::loader
        DL2[OpRep Loader]:::loader
    end

    subgraph MapIntegration
        MI1[Tile System]:::map
        MI2[Map Styles]:::map
    end

    UI --> SM1
    Spatial --> SM1
    SM1 --> DataProcessing
    DataProcessing --> TimeManagement
    TimeManagement --> MapIntegration
    DataLoaders --> DataProcessing

    classDef ui fill:#2196F3,stroke:#1565C0,color:#fff
    classDef spatial fill:#4CAF50,stroke:#2E7D32,color:#fff
    classDef data fill:#FF9800,stroke:#EF6C00,color:#fff
    classDef time fill:#9C27B0,stroke:#6A1B9A,color:#fff
    classDef state fill:#673AB7,stroke:#4527A0,color:#fff
    classDef loader fill:#795548,stroke:#4E342E,color:#fff
    classDef map fill:#607D8B,stroke:#37474F,color:#fff

    click UI1 "https://github.com/debrief/reactol/blob/main/src/components/GraphModal/index.tsx"
    click UI2 "https://github.com/debrief/reactol/blob/main/src/components/HomeControl/index.tsx"
    click UI3 "https://github.com/debrief/reactol/blob/main/src/components/Layers/index.tsx"
    click UI4 "https://github.com/debrief/reactol/blob/main/src/components/LoadTrackModal/index.tsx"
    click UI5 "https://github.com/debrief/reactol/blob/main/src/components/Properties/index.tsx"
    click UI6 "https://github.com/debrief/reactol/blob/main/src/components/TimeControl/index.tsx"
    
    click SP1 "https://github.com/debrief/reactol/blob/main/src/components/spatial/Map/index.tsx"
    click SP2 "https://github.com/debrief/reactol/blob/main/src/components/spatial/Track/index.tsx"
    click SP3 "https://github.com/debrief/reactol/blob/main/src/components/spatial/Zone/index.tsx"
    click SP4 "https://github.com/debrief/reactol/blob/main/src/components/spatial/Point/index.tsx"
    click SP5 "https://github.com/debrief/reactol/blob/main/src/components/spatial/AutoGraticule/index.tsx"
    click SP6 "https://github.com/debrief/reactol/blob/main/src/components/spatial/MouseCoordinates/index.tsx"
    
    click DP1 "https://github.com/debrief/reactol/tree/main/src/helpers/calculations/"
    click DP2 "https://github.com/debrief/reactol/blob/main/src/helpers/filterTrack.ts"
    click DP3 "https://github.com/debrief/reactol/blob/main/src/helpers/trackCalculations.ts"
    click DP4 "https://github.com/debrief/reactol/blob/main/src/helpers/combineFeatures.ts"
    
    click TM1 "https://github.com/debrief/reactol/blob/main/src/helpers/time-support.ts"
    click TM2 "https://github.com/debrief/reactol/blob/main/src/helpers/timeBounds.ts"
    click TM3 "https://github.com/debrief/reactol/blob/main/src/helpers/timeVal.ts"
    click TM4 "https://github.com/debrief/reactol/blob/main/src/helpers/toDTG.ts"
    
    click SM1 "https://github.com/debrief/reactol/blob/main/src/state/store.ts"
    click SM2 "https://github.com/debrief/reactol/blob/main/src/state/AppContext.tsx"
    click SM3 "https://github.com/debrief/reactol/blob/main/src/state/geoFeaturesSlice.ts"
    
    click DL1 "https://github.com/debrief/reactol/blob/main/src/helpers/loaders/loadJson.ts"
    click DL2 "https://github.com/debrief/reactol/blob/main/src/helpers/loaders/loadOpRep.ts"
    
    click MI1 "https://github.com/debrief/reactol/tree/main/public/tiles/"
    click MI2 "https://github.com/debrief/reactol/blob/main/public/leaflet.css"
```
