F FourIA GitHub ↗

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

ToolWhy
Elixir 1.20 / OTP 29The Phoenix application runtime.
DockerRuns the local postgres:16-alpine database.
PostgreSQL clientInspecting the local database (optional).
Cloudflare accountOnly for the full Cloudflare Access login flow.
OpenTofu + AnsibleOnly 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.