Building Slatron: How Rust Revolutionized Digital Signage Systems
Share this article
Digital signage systems often struggle with reliability and flexibility, but developer Justin Woodring's latest project—Slatron—aims to change that. After several failed attempts spanning years, Woodring rebuilt his TV scheduling and automation system from the ground up in Rust, creating a robust distributed architecture that solves critical pain points plaguing both hobbyist and commercial solutions.
Learning From Past Failures
Woodring's initial approach combined a React frontend with SQLite and a separate Python script—a flawed architecture that caused database lock errors and race conditions under load. "It fell apart as soon as I needed anything complex," he admits. This experience shaped Slatron's core philosophy: strict separation of concerns across three Rust-based components:
- slatron-server: Central scheduler (Axum/SQLite)
- slatron-node: Edge player with MPV integration
- slatron-ui: React management dashboard
Engineering Breakthroughs
Cross-Compilation Simplified
Static linking proved crucial for generating nightly ARM64 (Raspberry Pi), x86_64 (servers), and Apple Silicon binaries. By leveraging Rust's vendored and bundled features for OpenSSL and SQLite, Woodring avoided complex cross-compilation setups:
[dependencies]
openssl = { version = "0.10", features = ["vendored"] }
libsqlite3-sys = { version = "0.26", features = ["bundled"] }
This enabled straightforward GitHub Actions matrix builds without host-system dependencies.
Single-Binary Deployment
Slatron's server embeds the React UI during compilation via a build.rs script when using the embed-ui feature. The binary serves UI assets from memory while maintaining local filesystem fallback for development:
// Runtime asset handling
if embedded_assets_exist() {
serve_from_memory()
} else {
serve_from("./static")
}
Programmable Displays with Rhai
Slatron's most innovative feature is its Rhai scripting engine, transforming displays into context-aware systems. Scripts can dynamically modify content based on external factors like weather, trigger hardware integrations, or generate real-time overlays:
// Rhai script example
fn on_load(settings) {
if settings.get("content_type") != "commercial" {
mpv_overlay("logo.png", 1800, 50, 0.8);
}
}
Developer Experience Innovations
Woodring prioritized "Day 0" usability with interactive onboarding:
// CLI onboarding wizard
if config_missing {
let host = Input::new().with_prompt("Server Host").interact()?;
generate_config_file(host);
}
Why This Matters
Slatron demonstrates Rust's maturation for systems programming—particularly its ability to simplify historically complex tasks like cross-compilation and embedded assets. More significantly, it reimagines digital signage as programmable platforms rather than static players, opening possibilities for responsive environments in retail, broadcasting, and public spaces. The project exemplifies how learning from failure and leveraging modern toolchains can transform ambitious visions into deployable reality.
Source: Justin Woodring's blog