uridemo

Only-GitHub URI dispatcher demo for frontend, backend, and firmware-style code.

This repo is intentionally usable without npm or PyPI publishing:

URI Shape

scheme://target[/resource]/(command|query)/operation

Examples:

device://device-01/led/command/set
device://device-01/ping/command/send
process://bridge/command/smoke
log://frontend/session/command/write
log://backend/logs/query/recent

log:// is first-class: frontend, backend, and firmware-style clients can write logs through URI commands, and the frontend reads backend logs through log://backend/logs/query/recent.

Run Locally

make serve

The default port comes from .env:

URIDEMO_PORT=39785

If the configured port is already in use, the Python server prints a friendly message and, when URIDEMO_PORT_FALLBACK=auto, binds an available port instead of raising a traceback.

Open:

http://127.0.0.1:39785/

Smoke test:

make smoke

Shell Client

The shell client dispatches the same URI commands through the backend HTTP transport. It uses URI constants from .env, so the shell, frontend, backend, and firmware-style adapter share one command contract.

make shell-commands
make shell-state
make shell-led-on
make shell-ping
make shell-process
make shell-log
make shell-logs
make shell-call

Direct usage:

python3 examples/shell-client.py led on
python3 examples/shell-client.py log --layer firmware "firmware log from shell"

Docker Compose

make docker-up

The host and container port are read from .env:

URIDEMO_PORT=39785

Open:

http://127.0.0.1:39785/

Smoke against compose:

make docker-smoke

Stop compose:

make docker-down

Run all local checks:

make test

Use From GitHub

Python:

pip install "git+https://github.com/tellmesh/uridemo.git@main#subdirectory=python"

Browser/Node can import or vendor js/index.js directly from a checkout, submodule, subtree, or raw GitHub URL.