zhenfeng-zhu
Nex - A minimalist web framework for indie hackers and startups
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:
Rapid development – Ship features, not prototypes
Indie hackers & startups – Build profitable products
Internal tools & dashboards – Admin panels, data dashboards
Real-time applications – Live dashboards, chat, streaming with SSE
Server-side rendering done right – Modern web apps without JavaScript overhead
What makes it different:
- File-based routing – No configuration. Drop a file in
src/pages/, get a route. - HTMX-first – Build interactive UIs with server-side rendering. No JavaScript framework needed.
- Hot reload – Instant feedback while developing via WebSocket.
- Real-time ready – Built-in Server-Sent Events for streaming data.
- Zero config – Works out of the box with sensible defaults.
- 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:
- Hex Package (nex_core): nex_core | Hex
- Hex Package (nex_new): nex_new | Hex
- API Docs: nex_core v0.4.3 — Documentation
- GitHub:
https://github.com/gofenix/nex
Looking forward to hearing from you!
Most Liked
chrismccord
Nex looks neat!
Great initiative! (I really wish Phoenix would have a less boilerplate code approach, and this is a great foundation)
Periodic reminder that phoenix_playground exists and this is a full Phoenix LiveView app:
Mix.install([
{:phoenix_playground, "~> 0.1.8"}
])
defmodule DemoLive do
use Phoenix.LiveView
def mount(_params, _session, socket) do
{:ok, assign(socket, count: 0)}
end
def render(assigns) do
~H"""
<span>{@count}</span>
<button phx-click="inc">+</button>
<style type="text/css">
body { padding: 1em; }
</style>
"""
end
def handle_event("inc", _params, socket) do
{:noreply, assign(socket, count: socket.assigns.count + 1)}
end
end
PhoenixPlayground.start(live: DemoLive)
bartblast
Hey @zhenfeng-zhu! Congrats on the Nex launch – it’s great to see more innovation in the Elixir web ecosystem.
Quick thought on the HTMX vs Datastar vs LiveView wrapper approach (saw the Reddit thread as well): I’d suggest focusing on either HTMX or Datastar rather than creating a LiveView wrapper, since LiveView itself could evolve to adopt similar simplification patterns over time – or evolve in other directions entirely. The key issue is that you wouldn’t control that evolution.
@thiagomajesk – I appreciate your thoughts from our earlier conversation about coordination in the community. While I understand the desire for consolidation, I think there’s real value in having different opinionated solutions that take distinct approaches. It’s not always about competing for the same users – often it’s about growing the Elixir pie by offering developers choices that match their specific needs and philosophies.
The simplicity-first philosophy that Nex is pursuing definitely resonates, and I’m heading in a similar direction with Hologram’s standalone mode (which is admittedly long overdue – sorry about that! – but the funding side quest took quite a lot of time, though successful. Big news coming soon). The key difference is the approach: server-driven frameworks like LiveView, HTMX, and Datastar excel at certain use cases, while Hologram takes a different path by compiling Elixir to JavaScript and running it client-side. This avoids latency issues and opens the door to local-first features down the road.
Different problems, different solutions – and that diversity can strengthen the ecosystem as a whole.
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 ![]()
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance











