zhenfeng-zhu

zhenfeng-zhu

Hello Elixir community!

I’m excited to share Nex, a web framework I’ve been building for the past few months. It’s designed for indie hackers, startups, and anyone who wants to ship web applications fast without enterprise complexity.

The philosophy:

Nex embraces simplicity and convention over configuration. It’s built for:

  • :rocket: Rapid development – Ship features, not prototypes
  • :bullseye: Indie hackers & startups – Build profitable products
  • :bar_chart: Internal tools & dashboards – Admin panels, data dashboards
  • :counterclockwise_arrows_button: Real-time applications – Live dashboards, chat, streaming with SSE
  • :globe_with_meridians: Server-side rendering done right – Modern web apps without JavaScript overhead

What makes it different:

  1. File-based routing – No configuration. Drop a file in src/pages/, get a route.
  2. HTMX-first – Build interactive UIs with server-side rendering. No JavaScript framework needed.
  3. Hot reload – Instant feedback while developing via WebSocket.
  4. Real-time ready – Built-in Server-Sent Events for streaming data.
  5. Zero config – Works out of the box with sensible defaults.
  6. Production-ready – Docker included, deploy to Railway/Fly.io/Render in minutes.

Quick example:

defmodule MyApp.Pages.Todos do
  use Nex.Page

  def mount(_params) do
    %{todos: fetch_todos()}
  end

  def render(assigns) do
    ~H"""
    <h1>My Todos</h1>

    <form hx-post="/add_todo" hx-target="#todos" hx-swap="beforeend">
      <input type="text" name="title" required />
      <button>Add</button>
    </form>

    <ul id="todos">
      <li :for={todo <- @todos}>{todo.title}</li>
    </ul>
    """
  end

  def add_todo(%{"title" => title}) do
    todo = create_todo(title)

    ~H"<li>{@todo.title}</li>"
  end
end

Get started:

mix archive.install hex nex_new
mix nex.new my_app
cd my_app
mix nex.dev

Visit http://localhost:4000 and you’re running.

What’s included:

  • File-based routing with dynamic routes ([id], [slug], [...path])
  • HTMX integration with automatic CSRF protection
  • Server-Sent Events for real-time streaming
  • JSON API support
  • Hot reload development experience
  • Production-ready Docker setup

Example projects:

I’ve included several examples to get you started:

  • chatbot – AI chat with streaming responses using SSE
  • chatbot_sse – Real-time streaming with HTMX SSE extension
  • guestbook – Simple guestbook with persistence
  • dynamic_routes – Comprehensive showcase of all routing patterns

What’s NOT included:

  • Built-in ORM (use Ecto directly)
  • Authentication system (integrate your own)
  • Asset pipeline (use CDN for Tailwind/DaisyUI)

This is intentional – Nex stays minimal so you can choose your own tools.

I’d love your feedback!

  • Have you tried it? What worked? What didn’t?
  • What features would make it more useful?
  • Any pain points with the current approach?
  • Would you use this for your projects?

Links:

https://github.com/gofenix/nex

Looking forward to hearing from you!

Showing Posts 1 to 10

jam

jam

Nice, this looks great. I had a similar idea in mind. My initial thought is that I wish this used datastar instead of htmx.

zhenfeng-zhu

zhenfeng-zhu OP

I will think about it

sodapopcan

sodapopcan

Nice!

Not to start a war but my vote as a non-but-potential-user is for htmx (unless it supports both).

garrison

garrison

Glad to see this, I think we need more web frameworks!

WRT the above, my understanding is that these “hypermedia frameworks” (htmx maintains a list) are generally designed to interop with pretty much any standard backend, so you shouldn’t really have to worry about picking a winner.

thiagomajesk

thiagomajesk

I’ve been waiting for something like this for a while. Great initiative! (I really wish Phoenix would have a less boilerplate code approach, and this is a great foundation)

ostap

ostap

IMO it’s all about the learning curve. I suppose someone coming over from Next.js would prefer Nex’s same file-based routing concept. As for HTMX, I vote LiveView :slightly_smiling_face:

sodapopcan

sodapopcan

LiveView’s great (it keeps the roof over my head) but it’s not a one-size-fits-all (nor is any framework, though LiveView is a little more honest about that).

And I would say that file-based routing would be familiar to anyone who started back in the 90s writing spaghetti PHP/ASP/etc for who HTMX also feels familiar, no need to bring Next into the discussion :grin:

zhenfeng-zhu

zhenfeng-zhu OP

Love this discussion! The learning curve was definitely top
of mind when designing Nex - wanted to make it feel natural
for Next.js folks.

And hey, LiveView fans are welcome here too :grinning_face_with_smiling_eyes: We’re all
trying to make web dev better in our own ways!

sodapopcan

sodapopcan

Oh, so it is Next inspired, woops :joy:

EDIT: Oh, right, “Nex”… lol, doi me.

jam

jam

Kind of. They do similar things in different ways so you’d still need to rewrite things if you wanted to switch from one to the other.

Comparing solely htmx to datastar, htmx is less capable out of the box. Datastar = htmx + sse + alpine. All in a smaller footprint. I also think their default to fat morph is a nice DX win. Feels a lot more declarative.

Objectively I don’t see a good reason to chose htmx over Datastar but I can understand the subjective “I’m used to htmx”.

I also think they’re doing some interesting things with their web component lib, Rocket.

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
pferriby
Introductory paragraph I’ll be looking for a keen junior or someone that has a couple of years experience in the real world (so you’ve be...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews