small medium large xlarge

Programming Phoenix 1.4: Productive |> Reliable |> Fast


Cover image for Programming Phoenix 1.4

Programming Phoenix 1.4

Productive |> Reliable |> Fast


Don’t accept the compromise between fast and beautiful: you can have it all. Phoenix creator Chris McCord, Elixir creator José Valim, and award-winning author Bruce Tate walk you through building an application that’s fast and reliable. At every step, you’ll learn from the Phoenix creators not just what to do, but why. Packed with insider insights and completely updated for Phoenix 1.4, this definitive guide will be your constant companion in your journey from Phoenix novice to expert, as you build the next generation of web applications.

Choose Your Format(s)

  • $24.95 In Stock
    • Beta: What do I get?

  • Ebooks are DRM free.

  • Ebook delivery options.

  • The Paper Book will ship on 2019-09-25 (roughly).

About this Title

Pages: 325 (est)
Published: 2019-09-25
Release: B9.0 (2019-07-24)
ISBN: 978-1-68050-226-8

Phoenix is the long-awaited web framework based on Elixir, the highly concurrent language that combines a beautiful syntax with rich metaprogramming. The best way to learn Phoenix is to code, and you’ll get to attack some interesting problems. Start working with controllers, views, and templates within the first few pages. Build an in-memory context, and then back it with an Ecto database layer, complete with changesets and constraints that keep readers informed and your database integrity intact. Craft your own interactive application based on the channels API for the real-time applications that this ecosystem made famous. Write your own authentication plugs, and use the OTP layer for supervised services. Organize code with modular umbrella projects.

This edition is fully updated for Phoenix 1.4, with a new section on using Channel Presence to find out who’s connected, even on a distributed application. Use the new generators and the new ExUnit features to organize tests and make Ecto tests concurrent.

This is a book by developers and for developers, and we know how to help you ramp up quickly. Any book can tell you what to do. When you’ve finished this one, you’ll also know why to do it.

What You Need

To work through this book, you will need a computer capable of running Erlang 18 or higher, Elixir 1.5 or higher, and Phoenix 1.4 or higher. A rudimentary knowledge of Elixir is also highly recommended.

Contents & Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

  • Preface
  • Introduction
  • Building with Functional MVC
    • The Lay of the Land
      • Simple Functions
      • Installing Your Development Environment
      • Creating a Throwaway Project
      • Building a Feature excerpt
      • Going Deeper: The Request Pipeline
      • Wrapping Up
    • Controllers
      • The Controller
      • Building a Controller
      • Coding Views
      • Using Helpers
      • Showing a User
      • Wrapping Up
    • Ecto and Changesets
      • Understanding Ecto
      • Defining the User Schema and Migration
      • Using the Repository to Add Data
      • Building Forms
      • Creating Resources
      • Wrapping Up
    • Authenticating Users
      • Preparing for Authentication
      • In-context Relationships
      • Managing Registration Changesets
      • Creating Users
      • The Anatomy of a Plug excerpt
      • Writing an Authentication Plug
      • Implementing Login and Logout
      • Presenting User Account Links
      • Wrapping Up
    • Generators and Relationships
      • Using Generators
      • Building Relationships
      • Managing Related Data
      • Wrapping Up
    • Ecto Queries and Constraints excerpt
      • Adding Categories
      • Diving Deeper into Ecto Queries
      • Constraints
      • Wrapping Up
    • Testing MVC
      • Understanding ExUnit
      • Using Mix to Run Phoenix Tests
      • Integration Tests
      • Unit-Testing Plugs
      • Testing Views and Templates
      • Splitting Side Effects in Model Tests
      • Wrapping Up
  • Writing Interactive and Maintainable Applications
    • Watching Videos
      • Watching Videos
      • Adding JavaScript
      • Creating Slugs
      • Wrapping Up
    • Using Channels
      • The Channel
      • Phoenix Clients with ES6
      • Preparing Our Server for the Channel
      • Creating the Channel
      • Sending and Receiving Events
      • Socket Authentication
      • Persisting Annotations
      • Handling Disconnects
      • Wrapping Up
    • OTP
      • Managing State with Processes
      • Building GenServers for OTP
      • Supervision Strategies
      • Designing an Information System with OTP
      • Building the Wolfram Info System
      • Wrapping Up
    • Observer and Umbrellas
      • Introspecting with Observer
      • Using Umbrellas
      • Wrapping Up
    • Testing Channels and OTP
      • Testing the Information System
      • Isolating Wolfram
      • Adding Tests to Channels
      • Authenticating a Test Socket
      • Communicating with a Test Channel
      • Wrapping Up
    • What’s Next?
      • Other Interesting Features
      • What’s Coming Next
      • Good Luck


This is the team that drove the implementation of Elixir and Phoenix. Chris McCord, the creator of Phoenix, professionally trains new developers for the rising framework and works with teams adapting it. Bruce Tate, the author of many award-winning books and creator of the Seven Languages in Seven Weeks series, is the founder of Groxio, which is already running Phoenix in production. José Valim, the creator of Elixir and member of the Phoenix core team, is the co-founder and director of research and development at Plataformatec.