Get Started
1. Install the Installer
Nex comes with a convenient installer to bootstrap new projects quickly.
mix archive.install hex nex_new
2. Create a New Project
Run the nex.new Mix task to create a new project directory.
mix nex.new my_app
cd my_app
3. Understand the Project Structure
Every Nex project follows a simple, convention-based structure.
my_app/
├── src/
│ ├── pages/ # Page modules (auto-routed)
│ │ ├── index.ex # GET /
│ │ └── [id].ex # GET /id (dynamic route)
│ ├── api/ # JSON API endpoints (Next.js style)
│ │ └── todos/
│ │ └── index.ex # GET/POST /api/todos
│ ├── components/ # Reusable UI components
│ └── layouts.ex # Global HTML layout
├── mix.exs
└── .env # Environment variables
Key concept - Nex is AI-Native. Just drop a file in src/pages/ and it automatically becomes a route. No router configuration needed!
4. Run in Development Mode
Nex includes a built-in development server with hot reloading enabled by default. Changes to your code are reflected instantly.
mix nex.dev
Open http://localhost:4000 in your browser. You should see your new Nex app running!
5. Build Your First Page
Create a new page with HTMX handlers. Pages are just Elixir modules that render HTML.
See the examples directory for complete working examples of pages with HTMX handlers, real-time streaming, and more.
6. Deploy with Docker
Every Nex project includes a Dockerfile. Deploy to any platform that supports containers.
docker build -t my_app .
docker run -p 4000 my_app
Popular deployment platforms
- Railway - Connect your GitHub repo and deploy automatically
- Fly.io - Use fly launch (Dockerfile detected automatically)
- Render - Create a new Web Service from your repository
Next Steps
Learn the Basics
Understand file-based routing, HTMX integration, and state management.
View FeaturesSee Examples
Explore real-world examples including chat apps, todos, and dynamic routes.
Browse Examples