acalejos

acalejos

Merquery - Interactive HTTP Toolkit Inspired by Postman

I’m excited to share Merquery, a new library I’m working on to bring interactive HTTP tooling to Elixir.

This project started off as a way to practice making Livebook Smart Cells, where I wanted to implement a Postman-Styled Smart Cell. As I made progress I realized that there’s a lot of potential in this tool for tighter integration with Elixir.

Merquery currently consists of 2 components:

  • Merquery Smart Cell that provides an interactive way to work with HTTP requests, akin to Postman
  • A mix task – mix merquery.generate – which introspects on your router and generates Merquery smart cells pre-filled with the information relevant to each route.

Merquery takes advantage of the Livebook ecosystem to have built in support for serialization and secret storage, so you can save queries for later usage and use keys from your Livebook Hub token vault.

It also can be used to generate source code just as all Smart Cells do. You can use Merquery as a learning tool to learn how to use Elixir HTTP clients.

The library is currently in its infancy, but below are some ideas I have going forward.

These are just some ideas for features I currently have, but are subject to change:

  • Finish basic REST operations support
  • Registering custom plugins
  • Improve mix merquery.generate
    • Allow customized parameters for routes, etc.
    • Add Table of Contents at Top
  • Migrate to TailwindCSS and distinctive design palette
  • Req plugin discoverability - Host a location where Req plugins can be submitted for others to
    discover for use with Merquery
  • Livebook routes instant deploy - Have a mix task (e.g. mix merquery.deploy) to automatically
    deploy the generated livebook from mix merquery.generate
  • Support other HTTP clients and their unique features (HTTPoison, Tesla, etc. )
  • Move Vue to Composition API and breakout components to SPCs

Any feedback is much appreciated!

Most Liked

acalejos

acalejos

I’ve added some more features to this as well as fixed several bugs. Currently still just on GitHub Main

Highlights:

  • Import / export support with cURL thanks to the new CurlReq library
  • Automatically add plugins to the setup cell rather than requiring you to copy / paste
  • Variable input type so now you can param / header value to the value of an existing bound variable

Demos:
https://x.com/ac_alejos/status/1798180009300926797
https://x.com/ac_alejos/status/1798199529285779929
https://x.com/ac_alejos/status/1798920380704510460

jonatanklosko

jonatanklosko

Creator of Livebook

@acalejos cool stuff!

Move Vue to Composition API and breakout components to SPCs

FTR we’ve recently started using an actual bundler setup in Kino and moved towards React for smart cells, with Tailwind. There is a @livebook/kino-bundler package that encapsulates the basic setup (including Livebook Tailwind config). You can see kino Remote execution cell or kino_bumblebee Task cell for examples. Still, the idea is that you can use whatever setup and framework you prefer, I am mentioning this just for completeness : )

krasenyp

krasenyp

Please, don’t say CRUD/REST. They’re not equivalent. Quite the opposite, actually.

linusdm

linusdm

Awesome! A programmable postman. Very cool.

Having a mix task to side-load Livebook in any mix project would be useful. Maybe that could be solved generically, and not specifically for Merquery. I have projects that have some livemd files useful during development. Although Livebook desktop is super easy to set up, it would be even smoother to have a mix taks you could fire up, with a specific livebook loaded by default. Just thinking out loud here…

acalejos

acalejos

@krasenyp

Please, don’t say CRUD/REST. They’re not equivalent. Quite the opposite, actually.

Good point, not sure why I put CRUD. Probably typing too fast. Removed mention of it in the post :slight_smile:

@jonatanklosko

FTR we’ve recently started using an actual bundler setup in Kino and moved towards React for smart cells, with Tailwind. There is a @livebook/kino-bundler package that encapsulates the basic setup (including Livebook Tailwind config). You can see kino Remote execution cell or kino_bumblebee Task cell for examples. Still, the idea is that you can use whatever setup and framework you prefer, I am mentioning this just for completeness : )

Thanks for the suggestion and all of the great work on Livebook! I already wanted to move to Tailwind and clean up the JS side, so I think that would be a good move. Looking at the repos you mentioned, it seems much cleaner.

@linusdm

Having a mix task to side-load Livebook in any mix project would be useful. Maybe that could be solved generically, and not specifically for Merquery. I have projects that have some livemd files useful during development. Although Livebook desktop is super easy to set up, it would be even smoother to have a mix taks you could fire up, with a specific livebook loaded by default. Just thinking out loud here…

Yeah that sounds like a more generic use case. Perhaps it would involve starting up a Remote Execution Cell

Awesome! A programmable postman. Very cool.

Glad you like it! Yeah, I think Req plugins offer an easy entry point for customizing it, and plan on leaning into them with this project.

Where Next?

Popular in Libraries Top

marcuslankenau
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to pa...
New
kip
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir. I...
574 16576 179
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
tfwright
After working on it for a couple of months and using it in production for most of that time, today I’ve released LiveAdmin, a LiveView ba...
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

Sub Categories:

We're in Beta

About us Mission Statement