|
| 1 | +--- |
| 2 | +title: Kiosk runtime watchdog for unattended public machines |
| 3 | +summary: Design of a minimal, failure-safe runtime guard responsible for supervising and recovering a web-based kiosk application running on public, unattended machines. |
| 4 | + |
| 5 | +category: System architecture |
| 6 | +featured: false |
| 7 | +priority: 70 |
| 8 | +tags: ["kiosk", "watchdog", "public systems", "reliability", "unattended runtime", "failure recovery", "system architecture"] |
| 9 | +links: |
| 10 | + - label: Architecture showcase (GitHub) |
| 11 | + href: "https://github.com/rocketdeploy-dev/showcase-kiosk-runtime-watchdog" |
| 12 | + kind: repo |
| 13 | + - label: Related case study – Kiosk Web Application |
| 14 | + href: "/en/case-studies/kiosk-web-application/" |
| 15 | + kind: deep-dive |
| 16 | + - label: Let’s talk |
| 17 | + href: "/en/contact/" |
| 18 | + kind: cta |
| 19 | +--- |
| 20 | + |
| 21 | +## System context |
| 22 | + |
| 23 | +This case study focuses on a **runtime supervision layer** used in web-based kiosks operating on **public, unattended machines**, such as parcel lockers or self-service terminals. |
| 24 | + |
| 25 | +Unlike the main kiosk application — which handles user interaction and business flow — this component is responsible for **protecting the device runtime itself**. |
| 26 | + |
| 27 | +It operates as the **outermost execution layer**, loaded directly by the kiosk browser and responsible for: |
| 28 | +- presenting a neutral startup and fallback screen, |
| 29 | +- embedding the actual kiosk application, |
| 30 | +- supervising its readiness and liveness, |
| 31 | +- recovering automatically when the embedded application fails or stalls. |
| 32 | + |
| 33 | +This layer exists specifically because **public kiosks cannot rely on human intervention**. |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Deployment context |
| 38 | + |
| 39 | +The kiosk system is deployed across **two physically separate environments** within the same machine enclosure: |
| 40 | + |
| 41 | +- a **physical kiosk device**, running a locked-down operating system and a browser in kiosk mode, |
| 42 | +- a **local server unit**, responsible for hosting the main kiosk web application. |
| 43 | + |
| 44 | +The **runtime watchdog described in this case study runs directly on the physical kiosk device**. |
| 45 | +It is loaded locally by the kiosk browser and remains operational regardless of the state of the main application. |
| 46 | + |
| 47 | +The actual kiosk SPA is: |
| 48 | +- hosted on a **separate machine**, |
| 49 | +- deployed as a long-running web service, |
| 50 | +- accessible only within the machine’s internal LAN. |
| 51 | + |
| 52 | +This separation ensures that: |
| 53 | +- failures in the application runtime do not compromise the device runtime, |
| 54 | +- the kiosk screen can always recover independently, |
| 55 | +- device-level supervision remains simple, trusted, and stable. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Core problem |
| 60 | + |
| 61 | +In unattended kiosk environments: |
| 62 | +- browser processes may freeze, |
| 63 | +- remote applications may fail independently of the device, |
| 64 | +- network connectivity may be intermittent, |
| 65 | +- restarting the device or browser is slow and operationally expensive. |
| 66 | + |
| 67 | +Relying solely on the kiosk application to manage its own health is insufficient. |
| 68 | + |
| 69 | +A separate, **simpler and more trusted execution layer** is required to: |
| 70 | +- supervise the application, |
| 71 | +- detect failure conditions, |
| 72 | +- and restore a usable state without manual action. |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Architectural decision |
| 77 | + |
| 78 | +A deliberate decision was made to introduce a **dedicated kiosk shell / watchdog**, separated from the main application. |
| 79 | + |
| 80 | +Key characteristics of this layer: |
| 81 | +- implemented as a **single static HTML file**, |
| 82 | +- served locally on the device, |
| 83 | +- no build step, framework, or runtime dependencies, |
| 84 | +- uses only standard browser APIs. |
| 85 | + |
| 86 | +The embedded kiosk application is loaded into an iframe and treated as an **untrusted execution surface**. |
| 87 | + |
| 88 | +Visibility is granted only after the application proves readiness and is continuously earned via heartbeat signals. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Execution model |
| 93 | + |
| 94 | +### Initialization |
| 95 | + |
| 96 | +1. The kiosk shell renders a neutral startup screen immediately. |
| 97 | +2. The target kiosk application is loaded into an iframe. |
| 98 | +3. Until a readiness signal is received, the iframe remains hidden. |
| 99 | +4. If initialization exceeds a defined timeout, the iframe is reloaded. |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +### Normal operation |
| 104 | + |
| 105 | +- The embedded application must periodically emit heartbeat messages. |
| 106 | +- Each heartbeat refreshes a timestamp maintained by the shell. |
| 107 | +- As long as heartbeats arrive on time, the application remains visible. |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +### Failure and recovery |
| 112 | + |
| 113 | +If heartbeats stop or timeouts are exceeded: |
| 114 | +- the iframe is hidden, |
| 115 | +- a fallback or maintenance message is shown, |
| 116 | +- the embedded application is reloaded after a delay. |
| 117 | + |
| 118 | +Recovery is: |
| 119 | +- automatic, |
| 120 | +- deterministic, |
| 121 | +- independent of user interaction. |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Why a single-file watchdog |
| 126 | + |
| 127 | +Using a single-file HTML watchdog was a conscious architectural choice. |
| 128 | + |
| 129 | +### Benefits: |
| 130 | +- minimal attack surface, |
| 131 | +- extremely low operational complexity, |
| 132 | +- trivial deployment and updates, |
| 133 | +- predictable runtime behavior. |
| 134 | + |
| 135 | +### Trade-offs: |
| 136 | +- no modularity or extension mechanisms, |
| 137 | +- logic must remain intentionally simple, |
| 138 | +- visual customization is limited. |
| 139 | + |
| 140 | +In this context, **simplicity is a feature**, not a limitation. |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +## Relationship to the kiosk application |
| 145 | + |
| 146 | +This watchdog does not replace the kiosk application. |
| 147 | + |
| 148 | +Instead: |
| 149 | +- the **kiosk application** handles user flows, backend integration, and UI, |
| 150 | +- the **watchdog shell** handles runtime supervision and recovery. |
| 151 | + |
| 152 | +Together, they form a system where: |
| 153 | +- failures are isolated, |
| 154 | +- recovery is guaranteed, |
| 155 | +- and the device always converges back to a usable state. |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## Security considerations (high-level) |
| 160 | + |
| 161 | +Operating in a public environment required: |
| 162 | +- treating the embedded application as untrusted, |
| 163 | +- avoiding any persistent credentials or secrets, |
| 164 | +- limiting local state to in-memory timestamps, |
| 165 | +- relying exclusively on explicit runtime signals. |
| 166 | + |
| 167 | +The watchdog enforces **execution safety**, not business security. |
| 168 | + |
| 169 | +--- |
| 170 | + |
| 171 | +## Visual documentation note |
| 172 | + |
| 173 | +This component runs exclusively on **public machines**. |
| 174 | + |
| 175 | +For this reason: |
| 176 | +- UI screenshots are intentionally omitted, |
| 177 | +- branding and layout details are not shown, |
| 178 | +- behavior is described through execution flow instead of visuals. |
| 179 | + |
| 180 | +This avoids exposing recognizable interfaces while preserving architectural clarity. |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +## Final outcome |
| 185 | + |
| 186 | +The result is a **small but critical architectural layer** that: |
| 187 | +- significantly increases kiosk reliability, |
| 188 | +- isolates application-level failures from the device runtime, |
| 189 | +- enables continuous unattended operation, |
| 190 | +- and does so with minimal complexity. |
| 191 | + |
| 192 | +This case study highlights how **robust systems are often built from very small, well-scoped components** — especially at the edges of execution. |
| 193 | + |
| 194 | +--- |
| 195 | + |
| 196 | +## Architecture showcase (GitHub) |
| 197 | + |
| 198 | +This case study focuses on **context, decisions, and outcomes**. |
| 199 | + |
| 200 | +For a deeper look at: |
| 201 | +- execution supervision, |
| 202 | +- heartbeat-based health signaling, |
| 203 | +- and deterministic recovery logic, |
| 204 | + |
| 205 | +see the dedicated **architecture showcase** repository: |
| 206 | + |
| 207 | +👉 https://github.com/rocketdeploy-dev/showcase-kiosk-runtime-watchdog |
0 commit comments