DEV Community

moss chan
moss chan

Posted on

Shipping a Zero-Backend Industrial HMI as a Double-Click HTML File (Vue 3 + IndexedDB) - with a Real Injection Molding Flash Case

Most injection molding engineers live at the press controller, not in curl or a 180-field enterprise MES. So when we turned our molding physics engine into an API, we also needed a front end that a process tech could open on a locked-down shop-floor PC in seconds.

The result is AICraft Studio: an open-source (MIT), zero-backend industrial HMI built with Vue 3 + TypeScript + Tailwind CSS v4. This post walks through the architecture decisions and a real thin-wall PP flash case computed through it.

Repo: github.com/DreamwayChan/aicraft-studio

AICraft Studio dark HMI


Design constraint #1: no backend we have to run for you

Factories are (rightly) paranoid about where their process data goes. Mold geometry, cycle times and trial history are competitive information.

So Studio is a pure static SPA:

  • Machines, molds, polymers and T1 -> T2 -> T3 trial history live in the browser's IndexedDB, with 1-click JSON export/import for backup or handover.
  • The API key lives in localStorage, and the browser calls the calculation endpoint directly over HTTPS. There is no Studio server in the middle storing anything.
  • Only ~15 algorithm-critical fields are needed per mold (wall thickness, shot weight, screw diameter, flow length, tonnage...), instead of the 180+ master-data fields our old enterprise system required.

Design constraint #2: it must run where IT says "no installs"

We ship four ways to run the exact same app:

Mode How Who it's for
Hosted open /studio/ anyone, zero setup
Portable double-click AICraft-Studio-Portable.html (built with npm run build:portable) shop-floor PCs without Node or Docker
Docker ~22 MB nginx image plants that want it on their intranet
Dev npm install && npm run dev contributors

The portable single-file build turned out to be the most requested option: process engineers email it around or put it on a USB stick.

Design constraint #3: show the physics, not just numbers

A setup sheet that says MEL = 39.94 is useless if the tech can't see why. Studio renders:

  • an SVG screw stroke and cushion map (MEL, IL0..ILn, VPTL, cushion, suck-back, swept volume),
  • a barrel thermal strip (BT4 -> BT1 -> NT) with delta badges after tuning,
  • a dual-domain profile chart (stroke-domain injection speed/pressure, time-domain packing and cooling, previous-round overlay),
  • the engine's recommend_thinking trace and process-window headroom gauges.

Real case: thin-wall PP lid with moderate flash

Input: PP, 0.9 mm wall, 22 g shot, 140 mm flow length, Ø36 mm screw, 130 T clamp.

T1 first-shot (computed)

Key Meaning Value
MEL metering end position 39.94 mm
ML0 metering position stage 0 32.94 mm
VPTL V/P switchover position 12.84 mm
IP0 / IP1 injection pressure stages 140 / 103.7 MPa
IV0 / IV1 injection speed stages 35.59 / 71.19 mm/s
NT / BT1 nozzle / zone 1 temp 236 / 258 °C
CT cooling time 10 s
PP0 / PT0 holding 0 / 0 (fill-only T1 by design)

Process window: clamp headroom +2%, cooling headroom +0%, injection speed headroom +40%, fill/freeze headroom +58%.

T2 after reporting FLASH / moderate

The engine fires Rule.dat #99 (IF FLASH_mid AND HOLDEXIST_low THEN MEL_reduce_mid) and then a dose-coupling guard:

  • MEL: 39.94 -> 36.61 mm (-3.33)
  • ML0: 32.94 -> 29.61 mm (-3.33)
  • IL0: 31.33 -> 28.00 mm (-3.33)

No pressure or speed change. With zero packing and a press at +2% clamp headroom, the flash comes from overfilling, so the fix is a smaller dose, not more tonnage. That's the kind of reasoning a generic LLM skips.


The same call from code

Studio has a live cURL / Python / JSON / MCP export panel, so anything you click in the UI can be pasted into a script or agent:

curl -X POST https://aicraft4injection.com/v1/first-shot \
  -H "Authorization: Bearer $AICRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "business_id": "PP-LID-130T",
    "target_shot_weight_g": 22,
    "polymer": { "polymer_abbreviation": "PP" },
    "mold": { "product_ave_thickness": 0.9, "product_max_length": 140 },
    "machine": {
      "clamping_force": 130,
      "injector": { "injector_screw_diameter_mm": 36 }
    }
  }'
✨ อัปเดตล่าสุด: moss chan cdefcae/shipping a zero backend industrial hmi as a double click html file vue indexeddb with a ha - Kapook Update 2025 ✨ อัปเดตล่าสุด: moss chan cdefcae/shipping a zero backend industrial hmi as a double click html file vue indexeddb with a ha - Kapook Update 2025
curl -X POST https://aicraft4injection.com/v1/optimize \
  -H "Authorization: Bearer $AICRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "business_id": "PP-LID-130T",
    "defect_info": [{ "defect": "FLASH", "level": "moderate" }]
  }'
✨ อัปเดตล่าสุด: moss chan cdefcae/shipping a zero backend industrial hmi as a double click html file vue indexeddb with a ha - Kapook Update 2025 ✨ อัปเดตล่าสุด: moss chan cdefcae/shipping a zero backend industrial hmi as a double click html file vue indexeddb with a ha - Kapook Update 2025

Because business_id is set, the second call loads the full stored T1 state, so you never have to re-send ~50 parameters.

For agents, the same tools are exposed over Streamable HTTP MCP at https://aicraft4injection.com/mcp (Bearer header), or via the open-source stdio server aicraft-mcp-server.


Try it

If you've built local-first tools for factory environments, I'd love to hear how you handled storage, updates and "no install" policies in the comments.

Top comments (0)