Get Started
On this page
Lerma is the FourIA customer dashboard: a Phoenix LiveView application for provisioning tenant applications, tracking health and cost analytics, and managing credit-based billing. It runs on Hetzner VMs behind Cloudflare Access and stores its data in PostgreSQL (Supabase in production).
This guide orients you before you write any code. For a step-by-step path to a running environment, continue to First Steps.
What you need
| Tool | Why |
|---|---|
| Elixir 1.20 / OTP 29 | The Phoenix application runtime. |
| Docker | Runs the local postgres:16-alpine database. |
| PostgreSQL client | Inspecting the local database (optional). |
| Cloudflare account | Only for the full Cloudflare Access login flow. |
| OpenTofu + Ansible | Only when provisioning or deploying infrastructure. |
The repository root provides everything through Nix: run nix develop .#lerma
from the repo root.
How Lerma fits together
- Dashboard — LiveView pages plus a JSON API under
/api. - Data — Ecto schemas backed by PostgreSQL (
Lerma.Repo). - Cloudflare — Access JWT verification for every browser request, and the Cloudflare API for provisioning per-tenant resources.
- Infrastructure — OpenTofu provisions the VM, database, DNS, and Access app; Ansible configures the VM and deploys the container. See Infrastructure as Code in the README.
Where to go next
- First Steps — get the app running locally.
- Deployment — the full OpenTofu + Ansible runbook.
- README — configuration, Cloudflare token permissions, AI Gateway handling, and R2 backup credentials.