Home

Awesome

Spaceman is a cross-platform gRPC client designed to be pleasant to use and pretty to look at. It is available both as a desktop GUI and as a CLI. Its main use-case is manual testing and debugging of gRPC server: simply load a Protobuf descriptor, choose your request, fill in the input message body and send away, to infinity and beyond!

Ok but what's gRPC

gRPC is a modern high-level communication protocol developed at Google. In my mind, gRPC falls more or less in the same basket as HTTP. Nowadays, the latter is not just limited to serving webpages and REST APIs anymore: many applications, that have nothing to do with the web, communicate using it. I like to think of gRPC as a better way to do that.

Some of the advantages are:

In Action

https://user-images.githubusercontent.com/6002855/229349667-a199b57d-9ba3-4349-9bbc-7e46f38ef1a8.mp4

<a href="https://asciinema.org/a/FW9EIDQtEjv2Oq66F3HxZjAQG" target="_blank"><img src="https://asciinema.org/a/FW9EIDQtEjv2Oq66F3HxZjAQG.svg" /></a>

Building

Requirements:

# To build the CLI
$ cargo build --release -p spaceman_cli

# To build the GUI
$ pushd spaceman_gui_back
$ cargo tauri build
$ popd

Protobuf

Spaceman loads compiled Protobuf descriptor files to know which services it can interact with, the methods that each provides, and the format of all exchanged messages so it can properly encode/decode them, as well as offer some basic editing capabilities.

Note that these files are not the same thing as the source .proto file, but they are what you obtain when compiling with protoc instead. Here's how you would compile multiple .proto files into a single descriptor file, recursively including all imports so that it's self-contained and can be loaded into Spaceman from any computer:

$ protoc --include_imports -o load_me.desc *.proto

Technology Stack

Spaceman is built in Rust using Tonic (part of the Tokio ecosystem) for making gRPC calls and heavily relies on Prost-Reflect to interpret Protobuf messages not known at compile time. That's the core of it, the CLI is just a facade built with Clap.

The GUI uses Tauri as a framework for making webview-based desktop apps and the actual frontend is made with Yew: a Rust reactive framework that compiles down to WebAssembly. The text editors are built with Monaco, the same technology that powers Visual Studio Code.

Miscellaneous

Q: Is the project actively maintained
A: Not really, I built this for my own usage (if even that) just because I felt like building something cool with Rust and I thought it came out nice enough to give it a logo and a detailed README.

Q: I'm on Linux and the app behaves weirdly at times
A: This is something that I experienced myself but I really can't do much about it. Tauri uses WebKit2GTK for rendering the webview on Linux and unfortunately, it doesn't play too nicely with WebAssembly. From my (limited) research, the issues that arise more frequently were solved in WebKit a long time ago but the fixes haven't made it into WebKit2GTK yet.