# socone-chinguyen/dashboard_source architecture

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

- Interactive diagram: https://gitdiagram.com/socone-chinguyen/dashboard_source
- Repository: https://github.com/socone-chinguyen/dashboard_source

## Overview

##### Project type and purpose
- This is a C++-based dashboard library/tool that provides a REST-style API (using Oatpp) for ingesting simulation events from SilKit and exposing dashboard operations to client code. It comprises two main deliverables:
- A “Service” module that hosts an HTTP server, listens for SilKit simulation events, transforms them into DTOs, and exposes endpoints.
- A “Client” module that invokes those endpoints (create/update dashboards, instances, participants, etc.) and marshals/unmarshals the DTOs.
- IntegrationTests glue the client and service in a test harness.

##### File structure
- Top-level:
- CMakeLists.txt – build and dependency management.
- Client/ – client-side API client, command classes, mocks, and unit tests.
- Service/ – server-side event handlers, queues, mapper to Oatpp DTOs, mocks, and unit tests.
- Dto/ – shared data transfer object definitions used by both sides.
- IntegrationTests/ – end-to-end tests spinning up a fake server and a test client runner.
- OatppContext.* & OatppHeaders.* – bootstrap of the Oatpp web server and HTTP helpers.

##### README for additional insights
- The README is a placeholder (“# tesst”), so rely on file names and directory structure to infer architecture.

##### Elements
– Blue for Service components,
– Green for Client components,
– Yellow for shared DTOs,
– Gray for external dependencies and tests.

##### Detail
- Document data flows (Event → DTO → HTTP → Command → API call → Response).
- The goal is maximum clarity on who calls whom, who transforms what, and where tests/mock intercept.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Layer
    SilKitSimulation["SilKit Simulation Engine"]:::external

    %% Service Layer
    subgraph "Service Module"
        direction TB
        EventQueue["SilKitEventQueue"]:::service
        EventHandler["SilKitEventHandler"]:::service
        CachingHandler["CachingSilKitEventHandler"]:::service
        Mapper["SilKitToOatppMapper"]:::service
        OatppCtx["OatppContext (HTTP Server)"]:::service
        OatppHdrs["OatppHeaders"]:::service
    end

    %% DTO Layer
    subgraph "Shared DTO Layer"
        direction TB
        DtoLayer["Dto/*"]:::dto
    end

    %% Client Layer
    subgraph "Client Module"
        direction TB
        ApiClient["DashboardSystemApiClient"]:::client
        ServiceClient["DashboardSystemServiceClient"]:::client
        Commands["Command Classes"]:::client
    end

    %% IntegrationTests Layer
    subgraph "IntegrationTests"
        direction TB
        TestRunner["ClientServerTestRunner"]:::tests
        TestController["DashboardSystemApiController"]:::tests
        TestComponents["DashboardTestComponents"]:::tests
    end

    %% Build Config
    CMake["CMakeLists.txt"]:::config
    Readme["README.md"]:::config

    %% Relationships
    SilKitSimulation -->|"Event"| EventQueue
    EventQueue -->|"Event"| EventHandler
    EventHandler -->|"Event"| CachingHandler
    CachingHandler -->|"Event"| Mapper
    Mapper -->|"DTO"| DtoLayer
    Mapper -->|"maps to"| OatppCtx
    OatppHdrs --> OatppCtx

    ApiClient -->|"HTTP"| OatppCtx
    ServiceClient -->|"wraps"| ApiClient
    Commands -->|"uses"| ServiceClient
    Commands -->|"DTO"| DtoLayer
    ApiClient -->|"DTO"| DtoLayer

    DtoLayer <--> EventHandler
    DtoLayer <--> ApiClient

    TestRunner -.->|"mock"| EventQueue
    TestRunner -.->|"mock"| ApiClient
    TestRunner --> TestController
    TestController --> Commands

    CMake --> ServiceModule
    CMake --> ClientModule
    CMake --> DtoLayer
    CMake --> IntegrationTests
    Readme --> CMake

    %% Click Events - Service
    click EventQueue "https://github.com/socone-chinguyen/dashboard_source/blob/main/Service/SilKitEventQueue.hpp"
    click EventHandler "https://github.com/socone-chinguyen/dashboard_source/blob/main/Service/SilKitEventHandler.hpp"
    click CachingHandler "https://github.com/socone-chinguyen/dashboard_source/blob/main/Service/CachingSilKitEventHandler.hpp"
    click Mapper "https://github.com/socone-chinguyen/dashboard_source/blob/main/Service/SilKitToOatppMapper.hpp"
    click OatppCtx "https://github.com/socone-chinguyen/dashboard_source/blob/main/OatppContext.hpp"
    click OatppHdrs "https://github.com/socone-chinguyen/dashboard_source/blob/main/OatppHeaders.hpp"

    %% Click Events - DTO
    click DtoLayer "https://github.com/socone-chinguyen/dashboard_source/blob/main/Dto/BulkUpdateDto.hpp"

    %% Click Events - Client
    click ApiClient "https://github.com/socone-chinguyen/dashboard_source/blob/main/Client/DashboardSystemApiClient.hpp"
    click ServiceClient "https://github.com/socone-chinguyen/dashboard_source/blob/main/Client/DashboardSystemServiceClient.hpp"
    click Commands "https://github.com/socone-chinguyen/dashboard_source/blob/main/Client/CreateDashboard.hpp"

    %% Click Events - IntegrationTests
    click TestRunner "https://github.com/socone-chinguyen/dashboard_source/blob/main/IntegrationTests/ClientServerTestRunner.hpp"
    click TestController "https://github.com/socone-chinguyen/dashboard_source/blob/main/IntegrationTests/DashboardSystemApiController.hpp"

    %% Styles
    classDef service fill:#cce5ff,stroke:#005cbf,color:#005cbf;
    classDef client fill:#d4edda,stroke:#155724,color:#155724;
    classDef dto fill:#fff3cd,stroke:#856404,color:#856404;
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef tests fill:#f8f9fa,stroke:#343a40,color:#343a40,stroke-dasharray: 5 5;
    classDef config fill:#f0f0f0,stroke:#888888,color:#888888;
    class ServiceModule,ClientModule internal;
    class CMake,Readme config;
```
