Skip to content

spaceCabbage/elixir-phoenix-tutorial

Repository files navigation

Elixir & Phoenix Tutorial

Elixir Phoenix LiveView License

Build real-time apps with the language that powers Discord and WhatsApp.

I created this tutorial because I wanted to learn Elixir and build real apps with it. Rather than keep my notes private, I decided to turn them into something that might help others too. This is my learning journey, documented as I go.

Browse the docs on GitHub or clone the repo for an AI-guided walkthrough if you are lazy and want to see how cool this is.


Two Ways to Learn

Option A: Browse the Docs

Read the documentation directly on GitHub:

Start Here: docs/README.md

Option B: AI-Guided Tutorial

Get an interactive, personalized walkthrough with Claude Code:

# 1. Clone the repo
git clone https://github.com/spaceCabbage/elixir-phoenix-tutorial.git
cd elixir-phoenix-tutorial

# 2. Install Claude Code (if you haven't)
# See: https://docs.anthropic.com/claude-code

# 3. Start the guided tutorial
claude
# Then type: begin

The AI will guide you through the curriculum, pause to check understanding, and let you explore the codebase at your own pace.

VSCode Integration

If you're using VSCode with the Claude Code extension:

  1. Open this repo in VSCode
  2. Run the task: Ctrl+Shift+P → "Run Task" → "Start Elixir Tutorial"
  3. Type begin in the Claude panel

Optional keybinding: Add this to your keybindings.json (Ctrl+Shift+P → "Open Keyboard Shortcuts (JSON)"):

{
  "key": "ctrl+alt+t",
  "command": "workbench.action.tasks.runTask",
  "args": "Start Elixir Tutorial"
}

Then press Ctrl+Alt+T to open Claude instantly.


Quick Start

mix deps.get          # Install dependencies
mix ecto.create       # Create database
mix ecto.migrate      # Run migrations
iex -S mix phx.server # Start with interactive shell

Visit http://localhost:4000


What You'll Learn

Section Topics Time
Getting Started Installation, editor setup, IEx 30 min
Erlang Primer BEAM VM, OTP, why Elixir exists 30 min
Elixir Fundamentals Pattern matching, pipes, functions, processes 2-3 hrs
OTP Fundamentals GenServer, Supervisors, fault tolerance 1-2 hrs
Phoenix Framework Request lifecycle, routing, contexts 1-2 hrs
Ecto Database Schemas, changesets, queries 1-2 hrs
LiveView Real-time UI, events, PubSub 1-2 hrs
This Codebase Guided tour, exercises 2-3 hrs
Testing ExUnit, testing patterns 1 hr

Total: 10-15 hours

For a condensed overview, see the Crash Course.


What is Phoenix Good For?

Phoenix excels at real-time, high-concurrency applications:

  • Chat & messaging - WhatsApp-scale connections
  • Live dashboards - Stock tickers, analytics, monitoring
  • Collaborative tools - Google Docs-style real-time editing
  • IoT backends - Millions of connected devices
  • APIs - High-throughput, low-latency services

Notable users: Discord (150M+ users), Bleacher Report (reduced 150 servers to 5), Toyota Connected, Pinterest.


Deployment

Phoenix apps typically deploy to:

  • Fly.io - Official recommendation, run fly launch
  • Gigalixir - Elixir-specific PaaS
  • Docker - Standard containerization
  • Bare metal - Elixir releases with mix release

Resources


License

PolyForm Noncommercial 1.0.0

You can use this for learning and personal projects. For commercial use, reach out.

About

A real-time chat application that teaches Elixir and Phoenix from the ground up.

Resources

License

Stars

Watchers

Forks