Nex

The simplest way to build HTMX apps in Elixir

Nex is a minimalist, HTMX-first toolkit for building server-rendered Elixir apps fast.

Why Nex

Nex is built for developers who want to ship real products without dragging in SPA complexity or framework ceremony.

What Nex Is and Is Not

Nex is a pragmatic framework for:

Nex is not trying to be:

Quick Start

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

Then open http://localhost:4000. This default scaffold is the basic starter: the lightest way to learn Nex. Generated apps include AGENTS.md plus a project-local skill at .agents/skills/nex-project/SKILL.md for AI onboarding.

If you want the product starter with auth, database wiring, and a protected dashboard:

mix nex.new my_app --starter saas

Example Project Structure

my_app/
├── .agents/
└── skills/
└── nex-project/
└── SKILL.md
├── AGENTS.md
├── src/
├── api/
└── todos/
└── index.ex
├── components/
└── pages/
├── _app.ex
├── _document.ex
├── index.ex
└── [id].ex
├── mix.exs
└── Dockerfile

Core Capabilities

Pages and Routing

HTMX and SSR

APIs and Realtime

Developer Experience

Monorepo Map

Main Product Line: Nex

Start Here

If you want the fastest path into Nex, use this sequence:

  1. Read this README
  2. Start with mix nex.new for the default basic scaffold, or use mix nex.new --starter saas when you want the auth + database starter
  3. Open one focused example
  4. Open more of the gallery once the basics click

Browse the gallery in examples/. The canonical example metadata now lives in examples/catalog.exs, which drives the website, CI matrix, and batch verification scripts.

A Tiny Example

defmodule MyApp.Pages.Index do
use Nex
def mount(_params) do
%{count: Nex.Store.get(:count, 0)}
end
def render(assigns) do
~H"""
<div>
<h1>Counter</h1>
<div id="counter-display">{@count}</div>
<button hx-post="/increment" hx-target="#counter-display" hx-swap="outerHTML">+</button>
</div>
"""
end
def increment(_req) do
count = Nex.Store.update(:count, 0, &(&1 + 1))
~H"<div id="counter-display">{count}</div>"
end
end

Documentation and Packages

Open Source

If you want to contribute or evaluate the repository for adoption, start here:

License

MIT