# turingine/turingine-runtime architecture

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

- Interactive diagram: https://gitdiagram.com/turingine/turingine-runtime
- Repository: https://github.com/turingine/turingine-runtime

## Overview

Turingine is a kiosk-oriented application platform for direct DRM/KMS display and evdev input, with an optional X11 bridge for standard graphical apps. The main user workflow is selecting a configured app in the homescreen, which launches it natively or through the X11 stack; native apps share the display and input services. The repository also includes a terminal, graphing app, calculator-related modules, and a math-rendering library. Several of those app directories have no sampled source, so their internal wiring is not shown.

Main entry points: [`apps/homescreen/main.c`](https://github.com/turingine/turingine-runtime/blob/main/apps/homescreen/main.c) (Homescreen launcher), [`core/display/drm_display.c`](https://github.com/turingine/turingine-runtime/blob/main/core/display/drm_display.c) (DRM display), [`core/input/evdev_input.c`](https://github.com/turingine/turingine-runtime/blob/main/core/input/evdev_input.c) (Evdev input), [`apps/terminal/main.c`](https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/main.c) (Native terminal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kiosk["Kiosk and bridge"]
  node_config["Homescreen config<br/>[homescreen.conf]"]
  node_homescreen["Homescreen launcher<br/>[main.c]"]
  node_x11bridge["X11 display bridge<br/>[main.c]"]
end

subgraph group_native["Native applications"]
  node_terminal["Native terminal<br/>[main.c]"]
  node_term_shell["Terminal shell<br/>[term_shell.c]"]
  node_term_render["Terminal renderer<br/>[term_render.c]"]
end

subgraph group_platform["Platform services"]
  node_drm["DRM display<br/>[drm_display.c]"]
  node_evdev["Evdev input<br/>[evdev_input.c]"]
  node_font["Bitmap font<br/>[font8x16.h]"]
end

subgraph group_math["Math applications"]
  node_grapher["Function grapher<br/>[graph.cpp]"]
  node_calculator["Calculator modules"]
  node_math_render["Math expression renderer"]
end

node_user(("Kiosk user"))
node_x11server["Xvfb / Openbox"]
node_giac["Giac math engine"]
node_hardware["Display and input devices"]

node_user -->|"selects app"| node_homescreen
node_homescreen -->|"reads settings"| node_config
node_homescreen -->|"renders through"| node_drm
node_homescreen -->|"reads input"| node_evdev
node_homescreen -.->|"starts standard-app stack"| node_x11server
node_homescreen -.->|"starts bridge"| node_x11bridge
node_terminal -->|"renders through"| node_drm
node_terminal -->|"reads input"| node_evdev
node_terminal -->|"dispatches commands"| node_term_shell
node_terminal -->|"draws terminal"| node_term_render
node_term_shell -->|"prints output"| node_term_render
node_term_render -->|"uses glyphs"| node_font
node_x11bridge -->|"captures frames / injects events"| node_x11server
node_x11bridge -->|"presents frames"| node_drm
node_x11bridge -->|"reads input"| node_evdev
node_grapher -->|"presents graphics"| node_drm
node_grapher -->|"reads input"| node_evdev
node_grapher -->|"evaluates functions"| node_giac
node_drm -->|"drives display"| node_hardware
node_evdev -->|"reads events"| node_hardware

click node_config "https://github.com/turingine/turingine-runtime/blob/main/config/homescreen.conf"
click node_homescreen "https://github.com/turingine/turingine-runtime/blob/main/apps/homescreen/main.c"
click node_x11bridge "https://github.com/turingine/turingine-runtime/blob/main/apps/x11_bridge/main.c"
click node_terminal "https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/main.c"
click node_term_shell "https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/term_shell.c"
click node_term_render "https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/term_render.c"
click node_grapher "https://github.com/turingine/turingine-runtime/blob/main/apps/Grapher/graph.cpp"
click node_calculator "https://github.com/turingine/turingine-runtime/tree/main/apps/calculator"
click node_math_render "https://github.com/turingine/turingine-runtime/tree/main/core/math_render"
click node_drm "https://github.com/turingine/turingine-runtime/blob/main/core/display/drm_display.c"
click node_evdev "https://github.com/turingine/turingine-runtime/blob/main/core/input/evdev_input.c"
click node_font "https://github.com/turingine/turingine-runtime/blob/main/core/common/font8x16.h"

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_config,node_homescreen,node_x11bridge,node_user toneBlue
class node_terminal,node_term_shell,node_term_render toneAmber
class node_drm,node_evdev,node_font toneMint
class node_grapher,node_calculator,node_math_render toneRose
class node_x11server,node_giac,node_hardware toneIndigo
```

## Components

### Kiosk and bridge

- [Homescreen config](https://github.com/turingine/turingine-runtime/blob/main/config/homescreen.conf): `config/homescreen.conf`
- [Homescreen launcher](https://github.com/turingine/turingine-runtime/blob/main/apps/homescreen/main.c): `apps/homescreen/main.c`
- [X11 display bridge](https://github.com/turingine/turingine-runtime/blob/main/apps/x11_bridge/main.c): `apps/x11_bridge/main.c`

### Native applications

- [Native terminal](https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/main.c): `apps/terminal/main.c`
- [Terminal shell](https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/term_shell.c): `apps/terminal/term_shell.c`
- [Terminal renderer](https://github.com/turingine/turingine-runtime/blob/main/apps/terminal/term_render.c): `apps/terminal/term_render.c`

### Platform services

- [DRM display](https://github.com/turingine/turingine-runtime/blob/main/core/display/drm_display.c): `core/display/drm_display.c`
- [Evdev input](https://github.com/turingine/turingine-runtime/blob/main/core/input/evdev_input.c): `core/input/evdev_input.c`
- [Bitmap font](https://github.com/turingine/turingine-runtime/blob/main/core/common/font8x16.h): `core/common/font8x16.h`

### Math applications

- [Function grapher](https://github.com/turingine/turingine-runtime/blob/main/apps/Grapher/graph.cpp): `apps/Grapher/graph.cpp`
- [Calculator modules](https://github.com/turingine/turingine-runtime/tree/main/apps/calculator): `apps/calculator`
- [Math expression renderer](https://github.com/turingine/turingine-runtime/tree/main/core/math_render): `core/math_render`

### Other components

- **Kiosk user**
- **Xvfb / Openbox**
- **Giac math engine**
- **Display and input devices**

## Connections

- Kiosk user → Homescreen launcher: selects app
- Homescreen launcher → Homescreen config: reads settings
- Homescreen launcher → DRM display: renders through
- Homescreen launcher → Evdev input: reads input
- Homescreen launcher → Xvfb / Openbox: starts standard-app stack
- Homescreen launcher → X11 display bridge: starts bridge
- Native terminal → DRM display: renders through
- Native terminal → Evdev input: reads input
- Native terminal → Terminal shell: dispatches commands
- Native terminal → Terminal renderer: draws terminal
- Terminal shell → Terminal renderer: prints output
- Terminal renderer → Bitmap font: uses glyphs
- X11 display bridge → Xvfb / Openbox: captures frames / injects events
- X11 display bridge → DRM display: presents frames
- X11 display bridge → Evdev input: reads input
- Function grapher → DRM display: presents graphics
- Function grapher → Evdev input: reads input
- Function grapher → Giac math engine: evaluates functions
- DRM display → Display and input devices: drives display
- Evdev input → Display and input devices: reads events
