Production-ready HTMX starter with Ruby on Rails 8, ERB, and PostgreSQL. One-click deploy to Railway.
Minimal Rails app (no Hotwire Stimulus/Turbo in the UI) using HTMX for todos. Production config/database.yml uses DATABASE_URL. config.hosts is relaxed when RAILS_ALLOWED_HOSTS is blank so Railway hostnames work. docker-entrypoint.sh sets SECRET_KEY_BASE with openssl if unset (fine for demos; set explicitly for multi-instance cookie consistency). GET /health checks the DB.
- Railway PostgreSQL
DATABASE_URL=${{Postgres.DATABASE_URL}}- Optional:
SECRET_KEY_BASE(bin/rails secret)
| Layer | Technology | Role |
|---|---|---|
| Frontend | HTMX + Tailwind (CDN) | Partial swaps |
| Templating | ERB | Layout + partials |
| ORM | Active Record | Todo model |
- Add PostgreSQL + web service (Dockerfile)
- Set
DATABASE_URL - Optionally set
SECRET_KEY_BASE - Health check:
GET /health
bundle install
export DATABASE_URL="postgres://user:pass@localhost:5432/htmx_dev"
bin/rails db:migrate
bin/rails s -b 0.0.0.0 -p 8080| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | - | PostgreSQL URL |
SECRET_KEY_BASE |
No | Generated in entrypoint if empty | Rails secret |
PORT |
No | 8080 |
Puma/server port |
This is one of 15 HTMX starter templates covering different backend stacks, all following the same pattern and ready for Railway deployment:
| Stack | Status |
|---|---|
| Bun + Elysia | Coming soon |
| .NET + Razor | Coming soon |
| Elixir + Phoenix | Coming soon |
| Go + Chi | Live |
| Go + Echo | Live |
| Go + Fiber | Live |
| Java + Spring Boot (MySQL) | Live |
| Java + Spring Boot (PostgreSQL) | Live |
| Node + Express | Live |
| Node + Hono | Live |
| PHP + Laravel | Live |
| Python + Django | Live |
| Python + FastAPI | Live |
| Ruby + Rails 8 | This repo |
| Rust + Axum + Askama | Live |
Built by AToolZ for the HTMX community
