Capstone Projects
Escript storing todos in a JSON file; add/list/done/delete commands.
Project 1 — CLI Todo manager (beginner)
Escript storing todos in a JSON file; add/list/done/delete commands. *Concepts: structs, Enum, File, JSON, OptionParser, ExUnit.*
Project 2 — Text adventure game (beginner/intermediate)
Rooms, items, inventory, parser for commands. *Concepts: maps, pattern matching, recursion for the game loop, IO.gets.*
Project 3 — Bank account system with OTP (intermediate)
Each account is a GenServer under a DynamicSupervisor, looked up via Registry; transfers are atomic; audit log in ETS. *Concepts: GenServer, Registry, DynamicSupervisor, ETS, error tuples.*
defmodule Bank.Account do
use GenServer, restart: :transient
def start_link(id), do: GenServer.start_link(__MODULE__, id, name: via(id))
def deposit(id, amt) when amt > 0, do: GenServer.call(via(id), {:deposit, amt})
def withdraw(id, amt) when amt > 0, do: GenServer.call(via(id), {:withdraw, amt})
def balance(id), do: GenServer.call(via(id), :balance)
defp via(id), do: {:via, Registry, {Bank.Registry, id}}
@impl true
def init(id), do: {:ok, %{id: id, balance: 0}}
@impl true
def handle_call({:deposit, a}, _f, s), do: {:reply, {:ok, s.balance + a}, %{s | balance: s.balance + a}}
def handle_call({:withdraw, a}, _f, %{balance: b} = s) when a > b, do: {:reply, {:error, :insufficient_funds}, s}
def handle_call({:withdraw, a}, _f, s), do: {:reply, {:ok, s.balance - a}, %{s | balance: s.balance - a}}
def handle_call(:balance, _f, s), do: {:reply, s.balance, s}
endProject 4 — Distributed key-value store (advanced)
Consistent hashing across nodes, replication factor 2, node join/leave handling with libcluster. *Concepts: distribution, :erpc, monitors, :pg, ETS, fault tolerance.*
Project 5 — Web crawler (advanced)
Concurrent crawler with rate limiting per domain, Task.async_stream or Broadway, Floki for parsing, results in Postgres. *Concepts: concurrency control, back-pressure, Ecto, Req.*
Project 6 — Real-time chat with Phoenix LiveView (advanced)
Rooms, presence ("who's online"), message history in Postgres, typing indicators, uploads. *Concepts: Phoenix, LiveView, PubSub, Presence, Ecto, phx.gen.auth.*
Project 7 — JSON API with background jobs (advanced)
REST + GraphQL API, Oban for emails and reports, telemetry metrics, release + Docker deploy. *Concepts: Phoenix API, Absinthe, Oban, Telemetry, releases.*
Project 8 — Your own DSL (expert)
A state-machine DSL: state :idle do on :start, to: :running end generating functions and validating transitions at compile time. *Concepts: macros, module attributes, __before_compile__, compile-time errors.*
Project 9 — IoT dashboard (expert)
Nerves device reading a sensor, streaming to a Phoenix LiveView dashboard; ML anomaly detection with Nx. *Concepts: Nerves, Phoenix Channels, Nx, end-to-end Elixir.*