Preface

Phoenix is built on Elixir — and this book doesn’t teach you Elixir. It teaches you Phoenix, the framework. If Elixir is still new to you, start with the Elixir book first — the language primer written as the prerequisite for this one — and come back when pattern matching, the pipe operator and Mix feel normal.

Learning Phoenix itself is a steep climb, and well worth every step of it. No sugar-coating: the BEAM, OTP, Ecto and LiveView each take real time to internalise — and once they do, you’re shipping real-time applications with fewer moving parts than any mainstream alternative. This book is my attempt to make that ascent less steep: a beginner’s guide to Phoenix, written in the same step-by-step shape I use when I run Phoenix trainings. A bonus track on Ash is included, because in practice the two ship together often enough that it pays to see both.

Shameless plug: if you’d rather have the training itself — personalized, on-site or remote — drop me an email at sw@wintermeyer-consulting.de.

  • Step-by-step. No prior Phoenix knowledge required.

  • Bite-sized "Hello World!" code examples. Crafted for comprehension just by reading the code, with notes added for clarity. No abstract programming theory.

  • Simplicity is key. My goal is to get you productive ASAP.

  • Not a beauty contest. We’re not investing much time in aesthetics. This is not a CSS design book.

Coming from Ruby on Rails? Phoenix is conceptually the Rails of the BEAM. The Rails-specific sibling book is at Learn Ruby on Rails.

Most readers will write Phoenix code alongside an AI coding agent, and this book assumes you are one of them. Everything still works if you type every character yourself. Throughout the book you will find boxes labelled Agentic Coding Tip flagging the Phoenix-specific places where an agent reliably takes a wrong turn (hand-writing files a mix phx.gen.* would produce, missing Ecto preloads, over-permitting in a changeset, rolling its own authentication) together with a concrete CLAUDE.md rule or prompt that keeps the agent honest. The tips assume Claude Code as the concrete tool, but the underlying advice applies to any capable agent.

The sidebar lets you jump to any chapter at any time — nothing is locked, later chapters don’t assume you memorised the earlier ones. That said, the book is written to be read front to back: each chapter sets up the next. If a section doesn’t resonate, skip it — you can circle back later if needed.

Don’t be a stranger

A book like this gets better every time a reader sends me a note.

  • Did a chapter click, or did it leave you more confused than before? Either answer is useful.

  • Found a typo, a broken example, code that no longer works on the current Phoenix or Ash version, a link that 404s?

  • Missing a topic you expected? Or curious about something this book doesn’t cover?

Write me at sw@wintermeyer-consulting.de. Feedback, bug reports, kind words, angry words — all welcome.

If you’d rather go through GitHub, the source lives at wintermeyer/phoenix-book. Issues, feature requests, pull requests — every one of them is appreciated.

— Stefan