rizwankhalid

rizwankhalid

API Management Console - runtime route toggling for Phoenix apps

Hi everyone.

I’ve been working on a Phoenix LiveView library that lets you enable/disable routes in real time from a protected dashboard — no redeploy needed. Route discovery happens automatically from your router, and disabled routes return 403 at the Plug level before they ever reach your controller.

What it does:

  • Automatically discovers routes from Phoenix.Router.routes/0

  • One-click toggle, individual or bulk, live via LiveView

  • Blocks disabled routes with 403 via a route guard plug

  • Provides session-based login with admin/viewer roles

  • Audit log (who did what, when), with CSV export

  • Includes search, dark mode, and protected/immutable route(s) config

  • Dead render fallback — works even for API-only apps without LiveView JS

Why I built this:
I work on a small team. We had a business requirement to expose some endpoints publicly. Nothing bad happened — no security incident, no hack — but the thought stuck with me: these endpoints are out there, and if something ever goes wrong, what’s the quickest way to limit the blast radius?

That question grew into this idea. The first step isn’t a perfect fix — it’s to turn it off, limit exposure, and buy time to think, hotfix, or deploy a permanent solution. I asked AI to help me explore and assess the use cases, and what started as a small concern grew into something I thought might be valuable beyond just my team.

The honest part about the package:
This is my first Hex package. I’m new to open source. I’m posting this to get your genuine feedback on whether this idea has legs:

  • Is this actually useful for teams, or is it solving a problem that’s better handled differently?

  • Would you use something like this? If not, why not?

  • What’s missing? What’s over-engineered?

A couple of honest caveats:

  • Without LiveView JS loaded (e.g. --no-assets apps), it falls back to a dead-render mode — most features still work, but a few JS-dependent ones (bulk checkboxes) are hidden in that mode.

  • Storage is currently CubDB only (single-node). PostgreSQL support is something I’m considering adding — thoughts welcome on whether that’d actually be useful to you.

Also: The free-tier route selection UI (the 50-route cap) still needs some work, and I have features like scheduled toggles and PostgreSQL storage in mind. If you spot bugs or design issues, please let me know — I’ll fix them.

Try it out

# mix.exs
{:api_management_console, "~> 0.1"}

Then use ApiManagementConsoleV2.Router in your router and mount it with api_console “/admin/api-console”.

I’d genuinely love to hear:

  • Your first impressions

  • What would make this a “must-have” for your team

  • What I should prioritize next

This is a work in progress, and I’m here to improve it based on real-world needs.

Thanks for reading — and if you try it, let me know how it goes! :folded_hands:

First Post!

rizwankhalid

rizwankhalid

Quick update: I’ve implemented the route-selection feature for the free tier, which I flagged as unfinished in my original post.

Previously, the first 50 routes (ordered alphabetically by name) were automatically selected as “managed” — meaning the set could shift if routes were added, removed, or renamed. Now you can explicitly choose which routes to actively manage, and that choice persists rather than
being decided for you.

Repo’s updated: GitHub - rizwan-khalid-1/api-management-console: Runtime API route control for Phoenix apps — discover, toggle, audit, and guard routes from a LiveView dashboard. 5-second emergency shutdowns, no redeployment needed. · GitHub

Still open to any thoughts, questions, or edge cases if anyone has a chance to take a look.

Where Next?

Popular in Announcing Top

kelvinst
Hey everyone! Well, we made this lib a while ago and now we decided to finally go out and public with it! It’s a tool for creating and m...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps w...
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
407 13366 120
New
dominicletz
Hi, I thought I had posted my library before but seems I hadn’t. The project is still in early stages but it’s growing and so I think it...
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 11283 107
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 10796 134
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement