# into-cps-association/dtaas architecture

> Architecture diagram of the GitHub repository into-cps-association/dtaas, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/into-cps-association/dtaas
- Repository: https://github.com/into-cps-association/dtaas

## Overview

#### Purpose and Top-Level Shape
DTaaS is a monorepo for creating, executing, and sharing digital twins from reusable assets. It combines a browser client, backend microservices, deployment/service-management CLIs, and Docker-based installation profiles. Primary user entry points are the web client and operational Python CLIs; service entry points are NestJS applications.

#### Client Application and UI State
The TypeScript/React client bootstraps at `client/src/index.tsx`, assembles providers in `client/src/AppProvider.tsx`, and defines navigation in `client/src/routes.tsx`. It exposes routes for digital-twin authoring, library/cart management, execution history, measurement experiments, configuration, and account settings. Redux-style application and domain state are split between `client/src/store/store.ts` and `client/src/model/store/modelRootState.ts`.

#### Digital-Twin Domain and Backend Boundary
Client domain models orchestrate DT asset CRUD, file handling, configuration, and execution behind backend interfaces. Key boundaries are `client/src/model/backend/digitalTwin.ts`, `client/src/model/backend/DTAssets.ts`, and `client/src/model/backend/interfaces/backendInterfaces.ts`. This layer insulates route/components from concrete storage and execution implementations and adapts DT records, files, and execution histories into client state.

#### GitLab Execution and Measurement Pipeline
The client’s concrete backend integration targets GitLab: it creates/manages pipelines, polls status, fetches logs, and records execution history. Central modules are `client/src/model/backend/gitlab/backend.ts`, `client/src/model/backend/gitlab/execution/pipelineCore.ts`, and `client/src/model/backend/gitlab/execution/pipelinePolling.ts`. Execution UI actions flow from `client/src/route/digitaltwins/execution/executionButtonHandlers.ts` into this layer; status is coordinated by `client/src/model/backend/state/ExecutionStatusService.ts`. Measurement workflows compose repeated execution tasks and runner configurations under `client/src/model/backend/gitlab/measure/`.

#### Library and File Service
The library microservice is a NestJS/GraphQL service providing file operations and optional Git-backed storage. Its process bootstrap and module composition are `servers/lib/src/main.ts` and `servers/lib/src/app.module.ts`; its public resolver is `servers/lib/src/files/files.resolver.ts`. `servers/lib/src/files/files-service.factory.ts` selects local versus Git file-service implementations, forming the storage-provider boundary. Client-side adapters consume this service while preserving the domain interface above.

#### Runner and Logging Services
The execution runner is a NestJS command-execution service: `servers/execution/runner/src/main.ts` starts it, `servers/execution/runner/src/app.controller.ts` exposes its API, and `servers/execution/runner/src/queue.service.ts` serializes/coordinates command work through configured runners. Logging is a separate NestJS ingestion service rooted at `servers/logger/src/main.ts`; `servers/logger/src/logs/logs.service.ts` handles events, with authentication and source throttling enforced by `servers/logger/src/logger-auth.guard.ts` and `servers/logger/src/socket-address-throttler.guard.ts`. The client can retain local logs/history in IndexedDB via `client/src/database/executionHistoryDB.ts` and `client/src/util/logger/indexedDBLogger.ts`.

#### Identity, Deployment, and Operations
The client supports OIDC authentication through `client/src/route/auth/AuthProvider.tsx` and `client/src/util/auth/Authentication.ts`; deployment profiles include Dex and Keycloak configurations. Docker Compose is the primary runtime packaging mechanism, with standalone/secure/integrated-GitLab DTaaS variants at `deploy/dtaas/docker/server/docker-compose.yml`, `deploy/dtaas/docker/secure-server/docker-compose.yml`, and `deploy/dtaas/docker/secure-server_with_integrated-gitlab/docker-compose.yml`. The user-facing platform CLI starts at `cli/src/cmd.py`; the service manager starts at `deploy/services/cli/dtaas_services/cmd.py` and provisions/manages GitLab, InfluxDB, MongoDB, PostgreSQL, RabbitMQ, ThingsBoard, and related Docker services.

Main entry points: [`deploy/dtaas/docker/server/docker-compose.yml`](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/deploy/dtaas/docker/server/docker-compose.yml) (Docker Compose profiles), [`client/src/AppProvider.tsx`](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/AppProvider.tsx) (App providers), [`client/src/model/backend/digitalTwin.ts`](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/digitalTwin.ts) (Digital-twin backend boundary), [`client/src/model/backend/gitlab/backend.ts`](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/backend.ts) (GitLab backend adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_client_bootstrap["React bootstrap<br/>client entry<br/>[index.tsx]"]
  node_client_providers["App providers<br/>composition<br/>[AppProvider.tsx]"]
  node_client_routes["Application routes<br/>navigation<br/>[routes.tsx]"]
  node_client_state[("Client state<br/>Redux state<br/>[store.ts]")]
  node_client_domain{{"Digital-twin backend boundary<br/>domain adapter<br/>[digitalTwin.ts]"}}
  node_client_backend_interfaces{{"Backend interfaces<br/>port definitions"}}
  node_execution_actions["Execution UI actions<br/>UI handlers"]
  node_gitlab_backend{{"GitLab backend adapter<br/>[backend.ts]"}}
  node_pipeline_core["Pipeline execution<br/>pipeline orchestration<br/>[pipelineCore.ts]"]
  node_pipeline_polling["Pipeline polling<br/>status polling<br/>[pipelinePolling.ts]"]
  node_execution_status["Execution status service<br/>state coordinator"]
  node_local_history[("Local execution history<br/>IndexedDB persistence")]
  node_auth{{"OIDC authentication<br/>identity client<br/>[AuthProvider.tsx]"}}
end

subgraph group_services["Backend services"]
  node_library_service["Library GraphQL service<br/>NestJS service<br/>[main.ts]"]
  node_file_resolver{{"Files resolver<br/>GraphQL API<br/>[files.resolver.ts]"}}
  node_file_storage_factory{{"Storage provider factory<br/>storage boundary"}}
  node_runner_service["Execution runner<br/>NestJS command service<br/>[queue.service.ts]"]
  node_logging_service["Logging ingestion<br/>NestJS service<br/>[logs.service.ts]"]
end

subgraph group_operations["Deployment &amp; operations"]
  node_platform_cli["Platform CLI<br/>Python CLI<br/>[cmd.py]"]
  node_service_manager["Service manager CLI<br/>Python CLI<br/>[cmd.py]"]
  node_compose_profiles["Docker Compose profiles<br/>runtime packaging<br/>[docker-compose.yml]"]
end

node_client_bootstrap -->|"mounts"| node_client_providers
node_client_providers -->|"provides"| node_client_routes
node_client_providers -->|"initializes"| node_client_state
node_client_providers -->|"configures"| node_auth
node_client_routes -->|"uses"| node_client_domain
node_client_domain -->|"depends on"| node_client_backend_interfaces
node_execution_actions -->|"starts executions"| node_gitlab_backend
node_gitlab_backend -->|"manages"| node_pipeline_core
node_pipeline_core -->|"polls via"| node_pipeline_polling
node_pipeline_polling -->|"updates"| node_execution_status
node_execution_status -->|"publishes status"| node_client_state
node_gitlab_backend -->|"records history"| node_local_history
node_client_domain -->|"file operations"| node_library_service
node_library_service -->|"exposes"| node_file_resolver
node_file_resolver -->|"uses"| node_file_storage_factory
node_pipeline_core -->|"executes commands"| node_runner_service
node_runner_service -->|"emits logs"| node_logging_service
node_platform_cli -->|"deploys"| node_compose_profiles
node_service_manager -->|"manages services"| node_compose_profiles
node_compose_profiles -.->|"runs"| node_library_service
node_compose_profiles -.->|"runs"| node_runner_service
node_compose_profiles -.->|"runs"| node_logging_service

click node_client_bootstrap "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/index.tsx"
click node_client_providers "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/AppProvider.tsx"
click node_client_routes "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/routes.tsx"
click node_client_state "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/store/store.ts"
click node_client_domain "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/digitalTwin.ts"
click node_client_backend_interfaces "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/interfaces/backendInterfaces.ts"
click node_execution_actions "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/route/digitaltwins/execution/executionButtonHandlers.ts"
click node_gitlab_backend "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/backend.ts"
click node_pipeline_core "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/execution/pipelineCore.ts"
click node_pipeline_polling "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/execution/pipelinePolling.ts"
click node_execution_status "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/state/ExecutionStatusService.ts"
click node_local_history "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/database/executionHistoryDB.ts"
click node_auth "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/route/auth/AuthProvider.tsx"
click node_library_service "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/lib/src/main.ts"
click node_file_resolver "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/lib/src/files/files.resolver.ts"
click node_file_storage_factory "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/lib/src/files/files-service.factory.ts"
click node_runner_service "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/execution/runner/src/queue.service.ts"
click node_logging_service "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/logger/src/logs/logs.service.ts"
click node_platform_cli "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/cli/src/cmd.py"
click node_service_manager "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/deploy/services/cli/dtaas_services/cmd.py"
click node_compose_profiles "https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/deploy/dtaas/docker/server/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_bootstrap,node_client_providers,node_client_routes,node_client_state,node_client_domain,node_client_backend_interfaces,node_execution_actions,node_gitlab_backend,node_pipeline_core,node_pipeline_polling,node_execution_status,node_local_history,node_auth toneBlue
class node_library_service,node_file_resolver,node_file_storage_factory,node_runner_service,node_logging_service toneAmber
class node_platform_cli,node_service_manager,node_compose_profiles toneMint
```

## Components

### Browser client

- [React bootstrap](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/index.tsx): client entry · `client/src/index.tsx`
- [App providers](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/AppProvider.tsx): composition · `client/src/AppProvider.tsx`
- [Application routes](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/routes.tsx): navigation · Authoring, library, execution, measurements, configuration, and account views. · `client/src/routes.tsx`
- [Client state](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/store/store.ts): Redux state · Application and digital-twin domain state. · `client/src/store/store.ts`
- [Digital-twin backend boundary](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/digitalTwin.ts): domain adapter · Abstracts asset, file, configuration, and execution operations. · `client/src/model/backend/digitalTwin.ts`
- [Backend interfaces](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/interfaces/backendInterfaces.ts): port definitions · `client/src/model/backend/interfaces/backendInterfaces.ts`
- [Execution UI actions](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/route/digitaltwins/execution/executionButtonHandlers.ts): UI handlers · `client/src/route/digitaltwins/execution/executionButtonHandlers.ts`
- [GitLab backend adapter](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/backend.ts): backend adapter · Concrete pipeline, log, and execution-history integration. · `client/src/model/backend/gitlab/backend.ts`
- [Pipeline execution](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/execution/pipelineCore.ts): pipeline orchestration · `client/src/model/backend/gitlab/execution/pipelineCore.ts`
- [Pipeline polling](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/gitlab/execution/pipelinePolling.ts): status polling · `client/src/model/backend/gitlab/execution/pipelinePolling.ts`
- [Execution status service](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/model/backend/state/ExecutionStatusService.ts): state coordinator · `client/src/model/backend/state/ExecutionStatusService.ts`
- [Local execution history](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/database/executionHistoryDB.ts): IndexedDB persistence · `client/src/database/executionHistoryDB.ts`
- [OIDC authentication](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/client/src/route/auth/AuthProvider.tsx): identity client · `client/src/route/auth/AuthProvider.tsx`

### Backend services

- [Library GraphQL service](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/lib/src/main.ts): NestJS service · Provides file operations and Git-backed or local storage. · `servers/lib/src/main.ts`
- [Files resolver](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/lib/src/files/files.resolver.ts): GraphQL API · `servers/lib/src/files/files.resolver.ts`
- [Storage provider factory](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/lib/src/files/files-service.factory.ts): storage boundary · Selects local or Git file-service implementation. · `servers/lib/src/files/files-service.factory.ts`
- [Execution runner](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/execution/runner/src/queue.service.ts): NestJS command service · Serializes command work across configured runners. · `servers/execution/runner/src/queue.service.ts`
- [Logging ingestion](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/servers/logger/src/logs/logs.service.ts): NestJS service · Authenticated, throttled log-event ingestion. · `servers/logger/src/logs/logs.service.ts`

### Deployment & operations

- [Platform CLI](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/cli/src/cmd.py): Python CLI · User-facing DTaaS operations entry point. · `cli/src/cmd.py`
- [Service manager CLI](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/deploy/services/cli/dtaas_services/cmd.py): Python CLI · Provisions and manages supporting Docker services. · `deploy/services/cli/dtaas_services/cmd.py`
- [Docker Compose profiles](https://github.com/into-cps-association/dtaas/blob/feature/distributed-demo/deploy/dtaas/docker/server/docker-compose.yml): runtime packaging · Standalone, secure, and integrated-GitLab installations. · `deploy/dtaas/docker/server/docker-compose.yml`

## Connections

- React bootstrap → App providers: mounts
- App providers → Application routes: provides
- App providers → Client state: initializes
- App providers → OIDC authentication: configures
- Application routes → Digital-twin backend boundary: uses
- Digital-twin backend boundary → Backend interfaces: depends on
- Execution UI actions → GitLab backend adapter: starts executions
- GitLab backend adapter → Pipeline execution: manages
- Pipeline execution → Pipeline polling: polls via
- Pipeline polling → Execution status service: updates
- Execution status service → Client state: publishes status
- GitLab backend adapter → Local execution history: records history
- Digital-twin backend boundary → Library GraphQL service: file operations
- Library GraphQL service → Files resolver: exposes
- Files resolver → Storage provider factory: uses
- Pipeline execution → Execution runner: executes commands
- Execution runner → Logging ingestion: emits logs
- Platform CLI → Docker Compose profiles: deploys
- Service manager CLI → Docker Compose profiles: manages services
- Docker Compose profiles → Library GraphQL service: runs
- Docker Compose profiles → Execution runner: runs
- Docker Compose profiles → Logging ingestion: runs
