A modern Phoenix 1.8 application with:
- Phoenix LiveView for real-time server-rendered UI
- Inertia.js + Svelte 5 for SPA-like experiences
- Vite for lightning-fast frontend builds with HMR
- Tailwind CSS v4 for utility-first styling
- DaisyUI for beautiful component classes
- SQLite for simple, file-based database
- Bun for fast package management
- Phoenix 1.8.1
- Elixir 1.15+
- Ecto with SQLite adapter
- Vite 6.3+ (replaces ESBuild)
- Svelte 5.0 with runes
- Inertia.js 2.2+
- Tailwind CSS 4.1+
- DaisyUI 5.1+
To start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit:
localhost:4000- Home pagelocalhost:4000/demo- LiveView demolocalhost:4000/inertia/counter- Inertia + Svelte demo
When you run mix phx.server, Vite automatically starts on port 5173 and provides:
- Hot Module Replacement (HMR) for instant updates
- Fast builds with on-demand compilation
- Automatic CSS injection
- Development: Vite dev server on port 5173 with HMR
- Production:
mix assets.deploybuilds optimized bundles
assets/
├── css/
│ └── app.css # Tailwind CSS v4 with DaisyUI
├── js/
│ └── app.js # Main entry point (Phoenix + Inertia)
├── svelte/
│ └── Counter.svelte # Svelte 5 components
├── vite.config.mjs # Vite configuration
└── package.json # Frontend dependencies
This project uses phoenix_vite for seamless Vite integration:
- Automatic dev server startup
- HMR for Svelte components
- Optimized production builds
- Asset fingerprinting
Components use modern Svelte 5 syntax:
<script>
let { counter = 0 } = $props()
let currentCounter = $state(counter)
</script>Mix and match LiveView and Inertia:
- Use LiveView for real-time features
- Use Inertia + Svelte for rich client interactions
- Share the same database and backend logic
Ready to run in production? Please check our deployment guides.
Follow these steps to run the application in a production-like environment:
- Build static assets:
MIX_ENV=prod mix assets.deploy
- Export the runtime configuration (adjust values as needed):
export DATABASE_URL="ecto://127.0.0.1/phx_prod.db" export SECRET_KEY_BASE="$(MIX_ENV=prod mix phx.gen.secret)" export PHX_URL_SCHEME="http" export PHX_HOST="localhost" export PHX_URL_PORT=4000 export PORT=4000
- Boot the server in production mode:
PHX_SERVER=true MIX_ENV=prod mix phx.server
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix