![Programming Phoenix 1.4: Productive > Reliable > Fast](http://vs-images.bn-web.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
Programming Phoenix 1.4: Productive > Reliable > Fast
325![Programming Phoenix 1.4: Productive > Reliable > Fast](http://vs-images.bn-web.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
Programming Phoenix 1.4: Productive > Reliable > Fast
325Paperback
-
PICK UP IN STORECheck Availability at Nearby Stores
Available within 2 business hours
Related collections and offers
Overview
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.3, Elixir 1.3, and Ecto 2.1, 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.3 or higher, Phoenix 1.3 or higher, and Ecto 2.1 or higher. A rudimentary knowledge of Elixir is also highly recommended.
Product Details
ISBN-13: | 9781680502268 |
---|---|
Publisher: | Pragmatic Bookshelf |
Publication date: | 10/22/2019 |
Pages: | 325 |
Product dimensions: | 7.50(w) x 9.25(h) x (d) |
About the Author
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