Core Features
Server-side rendering with HTMX. Everything you need to build modern web apps without JavaScript complexity.
🤖 AI-Native & Vibe Coding
Nex is built for the AI era. With Locality of Behavior (LoB) and zero-config routing, AI agents can build full features by reading a single file. No more context loss between routers, controllers, and templates.
# One file, one feature.
# AI reads src/pages/my_feature.ex and understands everything.
📁 File-based Routing
Routes are automatically discovered from your file system. Drop a file in src/pages/, get a route. Support for dynamic routes like [id] and catch-all [...path].
src/pages/index.ex → GET /
src/pages/about.ex → GET /about
src/pages/blog/[id].ex → GET /blog/:id
src/api/users.ex → GET /api/users
⚡ Unified Interface
Every module in Nex uses the same use Nex statement. Whether it's a Page, API, or UI Component, the framework automatically imports what you need based on the file path.
defmodule MyApp.Pages.Tasks do
use Nex
def toggle_status(%{"id" => id}) do
status = DB.toggle(id)
~H"<span>{status}</span>"
end
end
📡 JSON APIs (Next.js Style)
Build REST APIs that follow modern standards. Nex API routes use a req object aligned with Next.js API Routes, providing req.query and req.body for clean parameter handling.
Convention-based routing
Drop files in src/api/ and they automatically become endpoints. Support for dynamic routes like /api/todos/[id].
💾 Built-in State Management
Nex.Store provides a simple key-value store tied to the user's page session. Perfect for form state, shopping carts, and temporary data without a database.
Page-scoped
Data isolated per user session
Zero config
Works out of the box
🔄 Server-Sent Events (SSE)
Real-time streaming is a first-class citizen. Use Nex.stream/1 for live dashboards, chat apps, AI streaming, or progress bars.
# src/api/stream.ex
defmodule MyApp.Api.Stream do
use Nex
def get(_req) do
Nex.stream(fn send ->
send.(%{event: "update", data: "Hello from AI!"})
end)
end
end
🛡️ Built-in Security
Security by default. Automatic CSRF protection for all POST requests. No manual boilerplate required, Nex handles it all behind the scenes.
Production-ready security
CSRF tokens automatically generated and validated. No configuration required.
🔥 Hot Reload
Instant file change detection via WebSocket. Edit your code and see changes immediately without manual refresh. Works in development mode automatically.
🎨 CDN-First Design
No build step required. Use Tailwind CSS and DaisyUI via CDN. Focus on building features, not configuring bundlers.
Ready to build something amazing?
Start with our quick setup guide and explore real-world examples.