Announcing lavagna v2, a collaborative blackboard made with bevy and WebRTC
Dear Rust community, I’m excited to announce the release of lavagna v2!
https://github.com/alepez/lavagna
https://reddit.com/link/13oz078/video/9xyco9k6ef1b1/player
lavagna is a collaborative blackboard software that is designed for creating simple sketches during online meetings. It has an (optional) minimal UI to avoid distractions from your drawings. You can control colors and line width using the keyboard or the optional toolbar.
So why version 2?
- I’ve ported the application from being based on pixels crate to the powerful bevy game engine
- I’ve added zoom and pan features, you can now create infinite sketches on an endless plane.
- It now supports wasm, so you can use it right inside your browser.
The project repo is https://github.com/alepez/lavagna and there’s also an online demo https://lavagna.devand.dev/?collab-url=wss://lavagna-server.devand.dev/demo
The “collaboration” feature is achieved thanks to matchbox crate, a peer-to-peer WebRTC networking library.
lavagna is not a huge software, with only about 1k lines of code. It was more of a rewriting to bevy than a porting. Switching from pixels to bevy has hugely changed the architecture, as bevy uses the ECS (Entity Component System) architecture.
I switched to bevy to take advantage of some of its already exising plugins, like bevy\_pancam for zoom and pan, bevy\_prototype\_lyon for drawing. If you want to know more about ECS and how it is implemented in bevy: https://bevyengine.org/learn/book/getting-started/ecs/
I think bevy’s ECS is excellently implemented and very easy to use.
Before lavagna v2, the networking was implemented over matchbox and tokio, while now I’m using the easier bevy\_matchbox.
And what about the binary size? Applying some cheats found in the Unofficial Bevy Cheat Book and in the Minimizing Rust Binary Size article I’ve achieved to fit the whole wasm binary in less than 10M, which become 2.8M when gzip compressed.
Feel free to try it, both on web (here) or native (links in the release page). Feedbacks are really appreciated! To create new rooms, just change collab-url parameter in the demo url or set --collab-url command line argument on native version.