An example app built with Phoenix, Ash Framework, InertiaJs, Svelte 5, and TypeScript based on phx_inertia_react_ts_tw.
I had a hard time getting InertiaJs working with Phoenix and Ash, so I created this repo to serve as a starting point for any projects I might do in the future.
Before starting development, ensure you have the following tools installed:
Mise - Runtime version manager
# Install mise (macOS)
brew install mise
# Install mise (Linux)
curl https://mise.run | sh
Docker & Docker Compose - For database and services
# macOS
brew install --cask docker
# Linux (Ubuntu/Debian)
sudo apt-get update && sudo apt-get install docker.io docker-compose-plugin
direnv - Environment variable management
This project uses mise to manage tool versions. After installing mise:
# Install all required tools (Elixir, Erlang, Node.js, etc.)
mise install
The project uses PostgreSQL. You can run it via Docker Compose:
# Start PostgreSQL in the background
docker compose up -d postgres
Clone the repository:
git clone <repository-url> my-saas-app
cd my-saas-app
Set up environment variables:
# Copy the example environment file
cp .env.example .env
# Allow direnv to manage environment variables
direnv allow
Install dependencies and setup the project:
# Install all tools via mise
mise install
# Setup database, install dependencies, build assets
docker compose up
mix setup
Start the app:
mix phx.server
Visit your application: Open http://localhost:4000 in your browser
mix quality # Run all quality checks (format, credo, compile, lint)
mix quality.fix # Auto-fix formatting and linting issues
mix credo # Run Credo code quality analysis
mix credo --strict # Strict mode with all checks
cd frontend && npm run lint # Lint frontend code
cd frontend && npm run check # Run svelte-check for type errors
mise exec -- lefthook run pre-commit # Run git hooks manually
This project uses Lefthook for automated code quality checks on commit.
Pre-commit hooks automatically:
mix format)Hooks install automatically during mix setup. To skip hooks in emergencies:
LEFTHOOK=0 git commit -m "Emergency commit"
Search the codebase for the following words and rename them. Also rename folders.
template_app
TemplateApp
TemplateAppWeb
template_app_web
_template_app_key
.envfrontend/src/App.csspriv/static/images/mix test && cd frontend && npm testmix formatmix credo --strict quality checks$state, $derived, $effect, $props)