I'm not sure Velto is the best fit for embedded IoT applications, since it's mainly a minimal web framework for Rust. But if you can share a bit more about what you're trying to do, I'd be happy to help figure it out.
Making UIs for controlling embedded applications remotely is a field where standardized frameworks are scarce. Basic idea is to use client-server scheme already present in web stack for easy UI and communication with the device. It's like a web app you'd normally use like a SaaS app, but instead of serving on the internet to everyone, it serves over an intranet, from an embedded MCU and exposes functionality of the embedded device (a robot, drone, automated machinery etc.)
Embassy framework for embedded applications has a net stack: embassy/embassy-net at main · embassy-rs/embassy · GitHub for supporting different networking architectures in different MCUs. But afaik it doesn't cover the area of serving web "pages" on that network stack.
Do you mean using Velto to serve a web page as the frontend, and then using the page's UI to interact with the backend—for example, a button that turns on a light?
Yes a minimal example is exactly what you described. I'm looking for a web framework that can work with no_std environments and has a tiny footprint. Like this:
Interesting idea! Velto does depend on quite a bit of std, so making it work in a no_std environment would be a pretty big lift.
That said, the use case you're describing—serving lightweight UIs from embedded devices—is really compelling. If you're up for experimenting, it could be fun to explore what’s possible, even if it means starting small or finding a hybrid approach.
Happy to dig in more if you share a few constraints you're working with!
no_std requirement is not necessary with certain embedded platforms like Raspberry Pi and similar. Basically any platform that has a memory management unit and can run OSes like linux.
Which means Velto can be tested on those platforms today
I'll see what comes out of the thread in embedded section and investigate if a web framework can be no_std.
Velto doesn’t currently support UI event handling out of the box, but that’s definitely something that could be added.
As long as the frontend can send events back to the backend—like through simple HTTP requests or WebSocket messages—you can hook into them and trigger whatever logic you need.
I would suggest to just use (local copy of as linked function is unstable) normalize_lexically before joining URL to static directory name. This should not allow path traversal attacks as long as static directory does not contain symlinks to the outside (and if it does it is only your problem if your framework is the one who has put them there).
@ZyX-II@R081n Path traversal has been addressed in version 1.0.1 of Velto using the pathx crate, which provides a Normalize extension trait that adds the normalize function to std::path::Path,
It it right understanding that a web server is a part of your framework? I am also web framework freak. But my framework is completely decoupled from a web server. But I got a nice idea from your framework - it's template engine. I was under impression that no more template engine on the server side, but I was wrong. You proved an opposite. Thank you.
Thanks! I really liked how simple Flask and Jinja2 templates felt to use in Python, so I thought I could replicate the same simplicity in Rust. i'm also thinking about adding JSX-style templates, not removing the current ones, just an extra option
It's a very beneficial to learn Python before Rust, because you know many nice things to bring there. Unfortunately I am dumb in Python, and even do not know what to ask AI to teach me. I will try - show me cool features of Python for a Rust programmer.