Skip to content

Robotics-Lab-UCSB/mirai

Repository files navigation

mirai

This is the websockets backend for the virtual robotics lab, built on Tokio's axum. The source code is licensed under a permissive Berkeley-style license. At this time we do not admit GPL code into the dependencies.

In order to push code, you must create a new branch and send a PR where all checks pass. Any pushes directly to main will be rejected immediately. Additionally, all checks must pass before your PR can be merged. Please run nix flake check to run all checks and fix any failing ones that may occur.

We recommend you work in a personal development branch or fork of the repository to avoid losing work.

Hacking

Using Nix

The easiest way to hack on the project is using Nix to manage all dependencies. You can install it on macOS and Linux by running

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
  sh -s -- install

On Windows, either use WSL, or use the non-Nix instructions below.

With Nix installed and flakes enabled, run

nix build

to compile the code project. A binary will be in result/bin.

To directly build and run the project, execute:

nix run

Run all tests and checks using:

nix flake check

Format all files using:

nix fmt

Spin up a development environment that provides the full development toolchain including rustc, cargo, rust-analyzer, rustfmt, and more using:

nix develop

Once you are in the development shell, feel free to invoke the commands detailed below in the non-Nix instructions directly, which should provide a faster development experience.

Generic non-Nix instructions

If you don't have or don't want to install Nix, you need to manually install a Rust toolchain and bring your own tooling.

It's recommended you use rustup, but you can obtain Rust through your distribution's package manager as well. We currently use rustc and cargo stable version 1.83.0.

Then you can run all the cargo commands as usual:

Run the project in development mode:

cargo run

Build an optimized release binary:

cargo build --release

Audit dependencies for security advisories:

cargo audit

Format all Rust code:

cargo fmt

Lint code:

cargo clippy

About

virtual lab websockets backend in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published