ui-engine

module
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MIT

README

ui-engine

Version: 0.19.0

Objects present themselves. You write HTML templates.

This is not your grandfather's web framework. Traditional frameworks build UIs from pages, routes, and components. ui-engine builds UIs from objects that present themselves—a Contact renders as a detail view, a list row, an editor, or a dropdown option depending on context. Same object, different presentations.

Contact object → presents as:
  ├── Contact.DEFAULT.html      (full detail view)
  ├── Contact.list-item.html    (compact row)
  └── Contact.option.html       (dropdown option)

No frontend JavaScript. No API layers. No state management. Objects ARE the state.

How It Works

-- Backend: domain objects + presenters
Contact = {type = "Contact"}
function Contact:fullName()
    return self.firstName .. " " .. self.lastName
end

ContactPresenter = {type = "ContactPresenter"}
function ContactPresenter:delete()
    app:removeContact(self.contact)
end
<!-- Frontend: just HTML templates with bindings -->
<input ui-value="firstName">
<span ui-value="fullName()"></span>
<button ui-action="save()">Save</button>

Modify objects directly. UI updates automatically. No plumbing required.

Quick Start

./build/ui-engine-demo --port 8000 --dir demo

Open http://localhost:8000 to see the Contact Manager demo.

See demo/README.md for details.

Documentation

  • USAGE.md — Complete guide: bindings, events, path properties, ViewList, namespaces
  • TRADEOFFS.md — When to use ui-engine vs traditional web architecture
  • demo/ — Working examples (Contact Manager, Simple Adder)

Key Features

  • Declarative bindingsui-value, ui-action, ui-view, ui-html, ui-attr-*, ui-class-*
  • Automatic change detection — no observer pattern, no boilerplate
  • Hot-reloading — edit backend code or templates, see changes instantly (state preserved)
  • ViewList — automatic presenter wrapping for collections
  • Namespace system — multiple views per type (list-item, detail, etc.)

Best For

  • Desktop applications — Electron-style apps without the complexity
  • Internal tools — Admin panels, dashboards, dev tools
  • Kiosk/embedded UIs — Local displays, point-of-sale, industrial HMI
  • Rapid prototyping — Get from idea to working UI in minutes

The reactive WebSocket architecture assumes low latency between client and server, making it ideal for local or LAN deployments rather than internet-scale web apps.

Current Focus

Embedded Lua backend for the frictionless project. The architecture supports other backends (Go, proxied external programs) but Lua is the priority.

Directories

Path Synopsis
Package cli provides the command-line interface for remote-ui.
Package cli provides the command-line interface for remote-ui.
cmd
ui command
Package main is the entry point for the UI server.
Package main is the entry point for the UI server.
ui-engine command
Package main is the entry point for the remote-ui server.
Package main is the entry point for the remote-ui server.
internal
backend
CRC: crc-Backend.md Spec: main.md (UI Server Architecture section) Package backend provides the Backend interface and implementations for the UI server's backend layer.
CRC: crc-Backend.md Spec: main.md (UI Server Architecture section) Package backend provides the Backend interface and implementations for the UI server's backend layer.
bundle
Package bundle provides functionality for bundling site files into the binary.
Package bundle provides functionality for bundling site files into the binary.
config
Package config handles configuration loading from CLI flags, environment variables, and TOML files.
Package config handles configuration loading from CLI flags, environment variables, and TOML files.
lua
Package lua provides the Lua runtime and hot-loading support.
Package lua provides the Lua runtime and hot-loading support.
path
CRC: crc-PathSyntax.md Spec: protocol.md
CRC: crc-PathSyntax.md Spec: protocol.md
presenter
Package presenter implements the Presenter System.
Package presenter implements the Presenter System.
protocol
CRC: crc-MessageBatcher.md Spec: protocol.md
CRC: crc-MessageBatcher.md Spec: protocol.md
router
CRC: crc-Router.md Spec: interfaces.md
CRC: crc-Router.md Spec: interfaces.md
server
CRC: crc-BackendSocket.md, crc-ProtocolDetector.md, crc-PacketProtocol.md Spec: deployment.md
CRC: crc-BackendSocket.md, crc-ProtocolDetector.md, crc-PacketProtocol.md Spec: deployment.md
viewdef
Package viewdef provides viewdef hot-loading support.
Package viewdef provides viewdef hot-loading support.
lib
go
CRC: crc-BackendConnection.md Spec: libraries.md Package uiclient provides a client library for connecting to UI server.
CRC: crc-BackendConnection.md Spec: libraries.md Package uiclient provides a client library for connecting to UI server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL