How into-cps-association/dtaas works
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: docker-compose.yml Docker Compose profiles · AppProvider.tsx App providers · digitalTwin.ts Digital-twin backend boundary · backend.ts GitLab backend adapter
Components 21
Browser client
- React bootstrap
client/src/index.tsx - App providers
client/src/AppProvider.tsx - Application routes · Authoring, library, execution, measurements, configuration, and account views.
client/src/routes.tsx - Client state · Application and digital-twin domain state.
client/src/store/store.ts - Digital-twin backend boundary · Abstracts asset, file, configuration, and execution operations.
client/src/model/backend/digitalTwin.ts - Backend interfaces
client/src/model/backend/interfaces/backendInterfaces.ts - Execution UI actions
client/src/route/digitaltwins/execution/executionButtonHandlers.ts - GitLab backend adapter · Concrete pipeline, log, and execution-history integration.
client/src/model/backend/gitlab/backend.ts - Pipeline execution
client/src/model/backend/gitlab/execution/pipelineCore.ts - Pipeline polling
client/src/model/backend/gitlab/execution/pipelinePolling.ts - Execution status service
client/src/model/backend/state/ExecutionStatusService.ts - Local execution history
client/src/database/executionHistoryDB.ts - OIDC authentication
client/src/route/auth/AuthProvider.tsx
Backend services
- Library GraphQL service · Provides file operations and Git-backed or local storage.
servers/lib/src/main.ts - Files resolver
servers/lib/src/files/files.resolver.ts - Storage provider factory · Selects local or Git file-service implementation.
servers/lib/src/files/files-service.factory.ts - Execution runner · Serializes command work across configured runners.
servers/execution/runner/src/queue.service.ts - Logging ingestion · Authenticated, throttled log-event ingestion.
servers/logger/src/logs/logs.service.ts
Deployment & operations
- Platform CLI · User-facing DTaaS operations entry point.
cli/src/cmd.py - Service manager CLI · Provisions and manages supporting Docker services.
deploy/services/cli/dtaas_services/cmd.py - Docker Compose profiles · Standalone, secure, and integrated-GitLab installations.
deploy/dtaas/docker/server/docker-compose.yml
Connections 22
- 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