acalejos

acalejos OP

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!

First 7 of 7 Posts Switch mode

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 OP

@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.

acalejos

acalejos OP

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

acalejos

acalejos OP

Big update added support for request bodies, the last major missing component.

  • Supports x-wwww-form-urlencoded bodies
  • Supports Raw field to put custom payloads with support for syntax highlighting and prettification. Also supports custom Elixir code for the body.
  • Import and export cURL command supports new body payloads
  • Other UI bug fixes and improvements

Demos:
https://x.com/ac_alejos/status/1801811605123928566
https://x.com/ac_alejos/status/1801819740370878739

acalejos

acalejos OP

Added support for passthrough options and made a new, more comprehensive demo showcasing many of the newer features:

GitHub API Demo

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 14960 120
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

Other Trending Topics Top

ElixirConf
Lightning Talk: Jacob Swanner - Put your Scaller (Named Correctly) | ElixirConf US 2025 https://www.youtube.com/watch?v=dqqZSSxs-MA Co...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
bjorng
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New

We're in Beta

About us Mission Statement