# klausschaefers/quant-ux architecture

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

- Interactive diagram: https://gitdiagram.com/klausschaefers/quant-ux
- Repository: https://github.com/klausschaefers/quant-ux

## Overview

1. This repository is the front end of Quant-UX, a Vue-based product for building prototypes, running usability tests, and analyzing interaction data. The backend is separate (`qux-java`), so this repo is mainly the presentation, client-side state, rendering, and API orchestration layer.

2. The main application entry is `src/main.js`, with routing in `src/router.js` and the top-level shell in `src/App.vue`. The app is organized into route-level views under `src/views`, which split the product into major experiences such as login/account, app list/overview, studio/editor, simulator/testing, help, and legal pages.

3. The largest subsystem is the studio/editor experience under `src/canvas`. This is where users design screens and widgets, edit properties, arrange layers, wire interactions, and configure collaboration, comments, imports/exports, and design tokens. The editor is built from many Vue components, but the real domain behavior is concentrated in the controller layer under `src/canvas/controller`.

4. `src/canvas/controller` is the model and command boundary for the editor. It contains the app model, selection, grouping, screen/widget logic, copy-paste, merge/import utilities, collaboration session handling, and command abstractions. This is the core “business logic” layer that sits between UI components and stored app models.

5. Rendering and interaction handling are separated from model logic. Canvas behavior is implemented by components like `Canvas.vue`, `Render.vue`, `Zoom.vue`, `DnD.vue`, `Lines.vue`, and supporting utilities such as grid/ruler/snapping helpers. This subsystem turns the controller/model state into editable visual layouts and handles pointer/keyboard interaction.

6. The product also includes a simulator/test runner stack under `src/core/simulator` and `src/views/simulator`. That subsystem executes the designed app as a prototype, wiring events, data binding, scripting, REST calls, scrolling, tooltips, audio, animations, and workflow logic into a runtime experience for test sessions.

7. Analytics is a separate end-user mode under `src/canvas/analytic` and `src/views/apps/analytics`. It processes recorded sessions and events into funnels, heatmaps, outlier detection, scatter plots, user journeys, and task-performance views. Supporting algorithms live in `src/dash` and are used to derive those insights from collected interaction data.

8. The app depends on a service layer in `src/services` that isolates all external communication. These services wrap backend APIs for models, comments, uploads, notifications, help content, Git/Figma/Sketch/Swagger imports, AI features, WebSocket collaboration, public sharing, and authentication. This is the main boundary between the Vue UI and the backend infrastructure.

9. Authentication and deployment concerns are built into the frontend. The README and service names indicate support for a custom auth flow plus Keycloak-based auth, with environment-driven configuration for backend proxying and websocket endpoints. The frontend itself is served by a small Node server in `server/start.js` / `server/start_dev.js`, which also acts as the proxy entrypoint in local or containerized deployments.

10. The data model is heavily theme- and template-driven. UI widgets and screens are defined through JSON theme files in `src/themes`, while reusable widget implementations live in `src/core/widgets`. This lets the editor generate and render many kinds of UI components, including forms, navigation, tables, charts, SVG, and mobile-style controls.

11. There is a clear separation between low-level rendering/model utilities and high-level product screens. `src/core` contains shared geometry, layout, responsive, SVG, text, animation, scripting, and model utilities; `src/common`, `src/page`, and `src/plugins` provide reusable UI primitives and page-level components used throughout the app.

12. The repository includes substantial support for import/export and reverse engineering of designs. Importers exist for HTML, YAML, SVG, Sketch, Figma, and Swagger-like data sources; exporters cover images, ZIP, Git, CSS, and comments. The tests and fixture data under `src/unit/data` and `tests/unit/data` show that these conversion paths are core architecture surfaces, not edge features.

13. Styling is a first-class layer, with extensive SCSS organization under `src/style` and multiple theme palettes for editor, simulator, widgets, and dialogs. The UI depends on those style bundles for the product’s different modes rather than using a single generic stylesheet.

14. The repository’s quality and release flow are centered on Node tooling: Vue build scripts, Jest unit tests, ESLint, Docker packaging, and GitHub Actions for image builds. The architecture diagram should therefore show a client-heavy SPA frontend, a thin Node delivery/proxy layer, and external backend services for persistence, auth, mail, collaboration, and websocket sync.

Main entry points: [`src/canvas`](https://github.com/klausschaefers/quant-ux/tree/master/src/canvas) (Canvas UI), [`src/views/apps`](https://github.com/klausschaefers/quant-ux/tree/master/src/views/apps) (App workspace), [`src/services`](https://github.com/klausschaefers/quant-ux/tree/master/src/services) (Services), [`tests/unit`](https://github.com/klausschaefers/quant-ux/tree/master/tests/unit) (Tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_entry["Entry & routes"]
  node_n_main["main<br/>Vue entry<br/>[main.js]"]
  node_n_router["router<br/>Route map<br/>[router.js]"]
  node_n_app["App shell<br/>Root shell<br/>[App.vue]"]
  node_n_views["Views"]
  node_n_login["Login/account<br/>Auth pages"]
  node_n_apps["App workspace<br/>Product pages"]
end

subgraph group_grp_studio["Studio editor"]
  node_n_studio["Studio<br/>Editor mode<br/>[Studio.vue]"]
  node_n_canvas["Canvas UI<br/>Editor canvas"]
  node_n_controller["Controller<br/>Model boundary"]
  node_n_toolbar["Toolbar<br/>Property UI"]
  node_n_render["Render & input<br/>Canvas render<br/>[Render.vue]"]
  node_n_share["Share mode<br/>Public view"]
end

subgraph group_grp_runtime["Runtime & analytics"]
  node_n_simulator["Simulator<br/>Prototype runtime"]
  node_n_sim_core["Runtime core<br/>Simulation engine"]
  node_n_analytics["Analytics<br/>Insight mode"]
  node_n_dash["Dash algorithms<br/>Analytics math"]
end

subgraph group_grp_shared["Shared platform"]
  node_n_services["Services<br/>API layer"]
  node_n_core["Core libs<br/>Shared engine"]
  node_n_widgets["Widgets<br/>Component library"]
  node_n_themes["Themes"]
  node_n_styles["Styles<br/>SCSS system"]
end

subgraph group_grp_delivery["Delivery & tooling"]
  node_n_server["Node server<br/>Delivery proxy<br/>[start.js]"]
  node_n_tests["Tests<br/>Verification"]
end

node_n_main -->|"configures"| node_n_router
node_n_main -->|"mounts"| node_n_app
node_n_router -->|"routes to"| node_n_views
node_n_views -->|"includes"| node_n_login
node_n_views -->|"includes"| node_n_apps
node_n_apps -->|"opens"| node_n_studio
node_n_apps -->|"opens"| node_n_analytics
node_n_apps -->|"opens"| node_n_simulator
node_n_studio -->|"composes"| node_n_canvas
node_n_canvas -->|"drives"| node_n_controller
node_n_canvas -->|"renders"| node_n_render
node_n_canvas -->|"configures"| node_n_toolbar
node_n_canvas -->|"shares"| node_n_share
node_n_controller -->|"calls"| node_n_services
node_n_render -->|"uses"| node_n_core
node_n_render -->|"skins"| node_n_styles
node_n_toolbar -->|"uses"| node_n_widgets
node_n_toolbar -->|"loads"| node_n_themes
node_n_simulator -->|"executes"| node_n_sim_core
node_n_sim_core -->|"fetches"| node_n_services
node_n_analytics -->|"derives from"| node_n_dash
node_n_analytics -->|"reads"| node_n_services
node_n_server -->|"serves"| node_n_main
node_n_services -.->|"proxies via"| node_n_server
node_n_tests -.->|"verifies"| node_n_controller
node_n_tests -.->|"verifies"| node_n_sim_core
node_n_tests -.->|"verifies"| node_n_dash

click node_n_main "https://github.com/klausschaefers/quant-ux/blob/master/src/main.js"
click node_n_router "https://github.com/klausschaefers/quant-ux/blob/master/src/router.js"
click node_n_app "https://github.com/klausschaefers/quant-ux/blob/master/src/App.vue"
click node_n_views "https://github.com/klausschaefers/quant-ux/tree/master/src/views"
click node_n_login "https://github.com/klausschaefers/quant-ux/tree/master/src/views/user"
click node_n_apps "https://github.com/klausschaefers/quant-ux/tree/master/src/views/apps"
click node_n_studio "https://github.com/klausschaefers/quant-ux/blob/master/src/views/apps/Studio.vue"
click node_n_canvas "https://github.com/klausschaefers/quant-ux/tree/master/src/canvas"
click node_n_controller "https://github.com/klausschaefers/quant-ux/tree/master/src/canvas/controller"
click node_n_toolbar "https://github.com/klausschaefers/quant-ux/tree/master/src/canvas/toolbar"
click node_n_render "https://github.com/klausschaefers/quant-ux/blob/master/src/canvas/Render.vue"
click node_n_share "https://github.com/klausschaefers/quant-ux/tree/master/src/canvas/share"
click node_n_simulator "https://github.com/klausschaefers/quant-ux/tree/master/src/views/simulator"
click node_n_sim_core "https://github.com/klausschaefers/quant-ux/tree/master/src/core/simulator"
click node_n_analytics "https://github.com/klausschaefers/quant-ux/tree/master/src/views/apps/analytics"
click node_n_dash "https://github.com/klausschaefers/quant-ux/tree/master/src/dash"
click node_n_services "https://github.com/klausschaefers/quant-ux/tree/master/src/services"
click node_n_core "https://github.com/klausschaefers/quant-ux/tree/master/src/core"
click node_n_widgets "https://github.com/klausschaefers/quant-ux/tree/master/src/core/widgets"
click node_n_themes "https://github.com/klausschaefers/quant-ux/tree/master/src/themes"
click node_n_styles "https://github.com/klausschaefers/quant-ux/tree/master/src/style"
click node_n_server "https://github.com/klausschaefers/quant-ux/blob/master/server/start.js"
click node_n_tests "https://github.com/klausschaefers/quant-ux/tree/master/tests/unit"

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_n_main,node_n_router,node_n_app,node_n_views,node_n_login,node_n_apps toneBlue
class node_n_studio,node_n_canvas,node_n_controller,node_n_toolbar,node_n_render,node_n_share toneAmber
class node_n_simulator,node_n_sim_core,node_n_analytics,node_n_dash toneMint
class node_n_services,node_n_core,node_n_widgets,node_n_themes,node_n_styles toneRose
class node_n_server,node_n_tests toneIndigo
```

## Components

### Entry & routes

SPA bootstrap and top-level navigation

- [main](https://github.com/klausschaefers/quant-ux/blob/master/src/main.js): Vue entry · Bootstraps the frontend application · `src/main.js`
- [router](https://github.com/klausschaefers/quant-ux/blob/master/src/router.js): Route map · Defines application navigation and page boundaries · `src/router.js`
- [App shell](https://github.com/klausschaefers/quant-ux/blob/master/src/App.vue): Root shell · Top-level application container and layout chrome · `src/App.vue`
- [Views](https://github.com/klausschaefers/quant-ux/tree/master/src/views): Route views · Login, app overview, studio, simulator, help, and legal pages · `src/views`
- [Login/account](https://github.com/klausschaefers/quant-ux/tree/master/src/views/user): Auth pages · User authentication and account flows · `src/views/user`
- [App workspace](https://github.com/klausschaefers/quant-ux/tree/master/src/views/apps): Product pages · App list, overview, design, share, and settings surfaces · `src/views/apps`

### Studio editor

Design, editing, and canvas interactions

- [Studio](https://github.com/klausschaefers/quant-ux/blob/master/src/views/apps/Studio.vue): Editor mode · Main design and editing experience · `src/views/apps/Studio.vue`
- [Canvas UI](https://github.com/klausschaefers/quant-ux/tree/master/src/canvas): Editor canvas · Visual editor surface and interaction layer · `src/canvas`
- [Controller](https://github.com/klausschaefers/quant-ux/tree/master/src/canvas/controller): Model boundary · App model, selection, commands, grouping, import/export, and collaboration logic · `src/canvas/controller`
- [Toolbar](https://github.com/klausschaefers/quant-ux/tree/master/src/canvas/toolbar): Property UI · Editing controls, properties, dialogs, and mode-specific panels · `src/canvas/toolbar`
- [Render & input](https://github.com/klausschaefers/quant-ux/blob/master/src/canvas/Render.vue): Canvas render · Canvas drawing, zooming, drag/drop, selection, rulers, and pointer handling · `src/canvas/Render.vue`
- [Share mode](https://github.com/klausschaefers/quant-ux/tree/master/src/canvas/share): Public view · Shared model presentation and share controller · `src/canvas/share`

### Runtime & analytics

Prototype execution and insight modes

- [Simulator](https://github.com/klausschaefers/quant-ux/tree/master/src/views/simulator): Prototype runtime · Executes designed apps as testable prototypes · `src/views/simulator`
- [Runtime core](https://github.com/klausschaefers/quant-ux/tree/master/src/core/simulator): Simulation engine · Event, script, REST, animation, scroll, tooltip, and workflow execution · `src/core/simulator`
- [Analytics](https://github.com/klausschaefers/quant-ux/tree/master/src/views/apps/analytics): Insight mode · Session analysis, funnels, heatmaps, journeys, and outlier views · `src/views/apps/analytics`
- [Dash algorithms](https://github.com/klausschaefers/quant-ux/tree/master/src/dash): Analytics math · Clustering, density, outlier detection, and dimensionality reduction · `src/dash`

### Shared platform

Common core, widgets, services, and UI primitives

- [Services](https://github.com/klausschaefers/quant-ux/tree/master/src/services): API layer · Backend API, auth, collaboration, import/export, uploads, and notifications · `src/services`
- [Core libs](https://github.com/klausschaefers/quant-ux/tree/master/src/core): Shared engine · Geometry, layout, rendering, scripting, responsive, and utility primitives · `src/core`
- [Widgets](https://github.com/klausschaefers/quant-ux/tree/master/src/core/widgets): Component library · Reusable UI widgets and theme-driven building blocks · `src/core/widgets`
- [Themes](https://github.com/klausschaefers/quant-ux/tree/master/src/themes): JSON themes · Widget and screen templates plus visual palettes · `src/themes`
- [Styles](https://github.com/klausschaefers/quant-ux/tree/master/src/style): SCSS system · Mode-specific style bundles for editor, simulator, widgets, and dialogs · `src/style`

### Delivery & tooling

Node delivery, build, and test surfaces

- [Node server](https://github.com/klausschaefers/quant-ux/blob/master/server/start.js): Delivery proxy · Local/container entrypoint and frontend delivery proxy · `server/start.js`
- [Tests](https://github.com/klausschaefers/quant-ux/tree/master/tests/unit): Verification · Unit tests and fixture data for core editor, runtime, and import paths · `tests/unit`

## Connections

- main → router: configures · Application bootstraps routing
- main → App shell: mounts · Root Vue shell is mounted by the entrypoint
- router → Views: routes to · Route table points at page-level views
- Views → Login/account: includes · Auth and account pages
- Views → App workspace: includes · Product workspace pages
- App workspace → Studio: opens · Studio is the central workspace mode
- App workspace → Analytics: opens · Analytics is a workspace mode
- App workspace → Simulator: opens · Simulator is a workspace mode
- Studio → Canvas UI: composes · Studio is built around the canvas subsystem
- Canvas UI → Controller: drives · UI delegates model logic to the controller boundary
- Canvas UI → Render & input: renders · Canvas view layer turns model state into editable layouts
- Canvas UI → Toolbar: configures · Toolbar and dialogs expose editing operations
- Canvas UI → Share mode: shares · Shared model presentation uses a dedicated mode
- Controller → Services: calls · Editor logic persists and syncs via services
- Render & input → Core libs: uses · Canvas interaction builds on shared geometry and layout utilities
- Render & input → Styles: skins · Rendering depends on editor-specific styles
- Toolbar → Widgets: uses · Properties and widgets are built from reusable component primitives
- Toolbar → Themes: loads · Theme templates drive widget and screen generation
- Simulator → Runtime core: executes · Simulator page relies on runtime execution engine
- Runtime core → Services: fetches · Runtime interacts with backend APIs and data sources
- Analytics → Dash algorithms: derives from · Insight views are powered by analysis algorithms
- Analytics → Services: reads · Analytics mode loads session and event data
- Node server → main: serves · Node server delivers the SPA and proxy entrypoints
- Services → Node server: proxies via · Frontend service layer targets the delivery/proxy boundary
- Tests → Controller: verifies · Tests cover the editor model and command logic
- Tests → Runtime core: verifies · Tests cover simulator and runtime behavior
- Tests → Dash algorithms: verifies · Tests cover analytics algorithms
