How luk707/trmnl-server works
trmnl-server is a Rust BYOS server for TRMNL devices. Devices register through setup to receive an API key, then request display responses while reporting status; management endpoints list devices, retrieve device details, and get or update image rotations. The API also accepts device logs, though the README says they are not persisted. The sampled setup and display handlers show repository-backed device registration and status updates; management handler internals were not sampled, so their persistence links are not inferred.
Main entry points: app.rs Route Table · main.rs Server Startup · mod.rs Device Repository · sqlite.rs SQLite Adapter
Components 17
HTTP API
- Route Table
src/app.rs
Device Workflow
- Device Setup
src/handlers/setup.rs - Display Request
src/handlers/display.rs - Device Logs
src/handlers/log.rs
Management API
- List Devices
src/handlers/list_devices.rs - Device Details
src/handlers/get_device.rs - Read Images
src/handlers/get_device_images.rs - Update Images
src/handlers/put_device_images.rs
Runtime And Persistence
- Server Settings
src/config.rs - Repository Injection
src/layers/device.rs - Device Repository
src/repositories/device/mod.rs - SQLite Adapter
src/repositories/device/sqlite.rs - Database Setup
src/db.rs - Device Database
- Server Startup
src/main.rs
Other components
- TRMNL Device
- Management Client
Connections 20
- TRMNL Device → Route Table: sends requests
- Management Client → Route Table: sends requests
- Route Table → Device Setup: routes setup
- Route Table → Display Request: routes display
- Route Table → Device Logs: routes logs
- Route Table → List Devices: routes listing
- Route Table → Device Details: routes details
- Route Table → Read Images: routes image reads
- Route Table → Update Images: routes image updates
- Server Startup → Server Settings: loads settings
- Server Startup → Route Table: starts router
- Server Startup → Repository Injection: installs layer
- Server Startup → Database Setup: connects and migrates
- Repository Injection → SQLite Adapter: constructs adapter
- Device Setup → Device Repository: checks and creates device
- Display Request → Device Repository: looks up and updates status
- Device Repository → SQLite Adapter: implemented by
- SQLite Adapter → Device Database: reads and writes
- Database Setup → Device Database: initializes
- Server Startup → TRMNL Device: serves requests for