Programming Phoenix 1.4: Productive > Reliable > Fast

Programming Phoenix 1.4: Productive > Reliable > Fast

Programming Phoenix 1.4: Productive > Reliable > Fast

Programming Phoenix 1.4: Productive > Reliable > Fast

eBook

$29.99  $39.99 Save 25% Current price is $29.99, Original price is $39.99. You Save 25%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Don't accept the compromise between fast and beautiful: you can have it all. Phoenix creator Chris McCord, Elixir creator Jose 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.

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 chapter 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.


Product Details

ISBN-13: 9781680507331
Publisher: Pragmatic Bookshelf
Publication date: 10/02/2019
Sold by: Barnes & Noble
Format: eBook
Pages: 358
File size: 5 MB

About the Author

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 CTO for icanmakeitbetter.com, which is already running Phoenix in production.


Jose Valim, the creator of Elixir and member of the Phoenix core team, is the co-founder and director of research and development at Plataformatec.

Table of Contents

Acknowledgments ix

Preface xiii

1 Introducing Phoenix 1

Productive 2

Concurrent 4

Beautiful Code 8

Interactive 10

Reliable 13

Part I Building with Functional MVC

2 The Lay of the Land 17

Simple Functions 17

Installing Your Development Environment 20

Creating a Throwaway Project 22

Building a Feature 23

Going Deeper: The Request Pipeline 30

Wrapping Up 38

3 Controllers 41

Understanding Controllers 41

Building a Controller 49

Coding Views 50

Using Helpers 52

Showing a User 54

Wrapping Up 58

4 Ecto and Changesets 59

Understanding Ecto 59

Defining the User Schema and Migration 60

Using the Repository to Add Data 63

Building Forms 66

Creating Resources 70

Wrapping Up 75

5 Authenticating Users 77

Preparing for Authentication 77

Managing Registration Changesets 79

Creating Users 82

The Anatomy of a Plug 85

Writing an Authentication Plug 88

Implementing Login and Logout 93

Presenting User Account Links 97

Wrapping Up 100

6 Generators and Relationships 101

Using Generators 101

Building Relationships 110

Managing Related Data 113

In-context Relationships 117

Wrapping Up 122

7 Ecto Queries and Constraints 123

Seeding and Associating Categories 123

Diving Deeper into Ecto Queries 130

Constraints 136

Wrapping Up 143

8 Testing MVC 145

Understanding ExUnit 146

Testing Contexts 150

Using Ecto Sandbox for Test Isolation and Concurrency 157

Integration Tests 158

Unit-Testing Plugs 167

Testing Views and Templates 172

Wrapping Up 174

Part II Writing Interactive and Maintainable Applications

9 Watching Videos 177

Watching Videos 177

Adding JavaScript 181

Creating Slugs 186

Wrapping Up 192

10 Using Channels 193

The Channel 194

Phoenix Clients with ES6 195

Preparing Our Server for the Channel 198

Creating the Channel 200

Sending and Receiving Events 202

Socket Authentication 207

Persisting Annotations 210

Handling Disconnects 217

Tracking Presence on a Channel 220

Wrapping Up 226

11 Observer and Umbrellas 229

Introspecting Applications with Observer 230

Using Umbrellas 233

Extracting Rumbl and RumblWeb 236

Wrapping Up 241

12 OTP 243

Managing State with Processes 243

Building GenServers for OTP 247

Designing an Information System with OTP 257

Building the Wolfram Info System 265

Integrating OTP Services with Channels 274

Wrapping Up 277

13 Testing Channels and OTP 279

Testing the Information System 280

Isolating Wolfram 285

Adding Tests to Channels 289

Authenticating a Test Socket 290

Communicating with a Test Channel 291

Wrapping Up 296

14 What's Next? 297

Other Interesting Features 298

Phoenix LiveView 302

Phoenix PubSub 2.0 313

Phoenix and Telemetry Integration 314

Good Luck! 316

Index 317

From the B&N Reads Blog

Customer Reviews