rafaelrojasvi.github.io  git:( main )  ✗

Case study

LedgerBank API

University-grade Phoenix API: JWT auth, PostgreSQL ledger, Oban jobs, Docker/CI

A structured answer to “what breaks when money and concurrency meet?” Phoenix handles HTTP; PostgreSQL enforces data rules; Oban carries work that must survive restarts.

Academic / portfolio
Elixir Phoenix PostgreSQL Oban JWT Docker CI/CD

Problem

Ledger-like systems fail when balances are implicit or updates race. The brief was to model accounts and movements clearly, authenticate callers, and run async jobs without losing work.

Architecture

Phoenix contexts keep domain boundaries explicit (clean architecture style). PostgreSQL transactions guard balance changes. Oban workers process retries and scheduled tasks with supervision-friendly failure modes.

JWT authentication encodes roles; endpoints declare which operations are allowed per principal.

Why Elixir

BEAM gives cheap concurrency and supervision—useful when HTTP requests and background settlement overlap. The goal was readable, testable domain code rather than clever macros.

Reliability patterns

  • Database transactions as the source of truth for balance invariants.
  • Oban for durable jobs; failures retry with backoff instead of silent drops.
  • Dockerized app + CI pipeline so “works locally” matches what the pipeline builds.

What I learned

Money domains reward boring tests: double-spend attempts, concurrent transfers, partial job failure.

Elixir shines when you lean on OTP patterns instead of hiding side effects in controllers.