My Account Log in

3 options

Phoenix web development : create rich web applications using functional programming techniques with Phoenix and Elixir / Brandon Richey.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central Academic Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Richey, Brandon J., author.
Language:
English
Subjects (All):
Web site development.
Elixir (Computer program language).
Web applications--Programming.
Web applications.
Physical Description:
1 online resource (406 pages)
Edition:
First edition
Place of Publication:
Birmingham : Packt, 2018.
System Details:
text file
Summary:
Learn to build a high-performance functional prototype of a voting web application from scratch using Elixir and Phoenix About This Book Build a strong foundation in Functional-Programming techniques while learning to build compelling web applications Understand the Elixir Concurrency and parallelization model to build high-performing blazingly fast applications Learn to test, debug and deploy your web applications using Phoenix framework Who This Book Is For This book is for people with a basic knowledge of Elixir, who want to start building web applications. Prior experience with web technologies is assumed. What You Will Learn Learn Phoenix Framework fundamentals and v1.3's new application structure Build real-time applications with channels and presence Utilize GenServers and other OTP fundamentals to keep an application stable Track users as they sign in and out of chat with Phoenix's built-in presence functionality Write your own database interaction code that is safe, bug-free, and easy to work with Explore testing and debugging methodologies to understand a real software development lifecycle for a Phoenix application Deploy and run your Phoenix application in production In Detail Phoenix is a modern web development framework that is used to build API's and web applications. It is built on Elixir and runs on Erlang VM which makes it much faster than other options. With Elixir and Phoenix, you build your application the right way, ready to scale and ready for the increasing demands of real-time web applications. This book covers the basics of the Phoenix web framework, showing you how to build a community voting application, and is divided into three parts. In the first part, you will be introduced to Phoenix and Elixir and understand the core terminologies that are used to describe them. You will also learn to build controller pages, store and retrieve data, add users to your app pages and protect your database. In the second section you will be able to reinforce your knowledge of architecting real time applications in phoenix and not only debug these applications but also diagnose issues in them. In the third and final section you will have the complete understanding of deploying and running the phoenix application and should be comfortable to make your first application release By the end of this book, you'll have a strong grasp of all of the core fundamentals of the Phoenix framework, and will have built a full production-ready web ...
Contents:
Cover
Title Page
Copyright and Credits
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: A Brief Introduction to Elixir and Phoenix
Introducing IEx and Elixir
What is IEx?
Variables in Elixir
Immutability in Elixir
Understanding the different types in Elixir
Getting more information with the i helper
Getting more information with the h helper
Using IEx and helpers to understand types
Your objects have no power here
Introduction to Phoenix
Installing Phoenix 1.3
Creating a new Phoenix project
Running the Phoenix Mix Task
Running the Phoenix server for the first time
Phoenix's default application structure
Configuration files
Assets files
Private files
Tests
Other directories
The most important directory: lib
A note about how data flows in Phoenix
Summary
Chapter 2: Building Controllers, Views, and Templates
Understanding the flow of Phoenix connections
Creating our Social Voting project
Creating a poll controller
Understanding the controller's structure
Building the poll controller
Understanding templates
Passing data to our templates
Writing controller tests
Understanding the code behind tests
Writing the poll controller test
Chapter 3: Storing and Retrieving Vote Data with Ecto Pages
Understanding the role of schemas
Creating a new migration
Creating the Polls table migration
Creating our Options table migration
Creating our Poll schema
Testing our Poll schema
Creating our Option schema
Understanding the gotchas of associations
Understanding the role of contexts
Creating a Votes context
Grabbing a list of data
Understanding Ecto query writing
Hooking up the context to our controller
Creating a new poll
Creating the new action in the controller.
Creating our create function
Writing our unit tests
Chapter 4: Introducing User Accounts and Sessions
Adding user accounts
Designing our user schema
Creating our user schema
Creating our accounts context
Writing our user unit tests
Creating a user signup page
Creating the routes
Creating the controller code (with tests)
Setting up the password functionality
Installing Comeonin
Adding Comeonin to the user schema file
Updating our tests
Updating the UI to include password fields
Creating a user login page
Building our create session function
Writing session controller tests
Chapter 5: Validations, Errors, and Tying Loose Ends
Connecting polls to users
Creating the migration
Modifying the schemas
Fixing broken poll tests
Sending a user ID through the controller
Retrieving data from sessions
Writing our Poll Controller's tests
Restricting access via sessions
Working with validations and errors
Making usernames unique
Writing custom validations
Displaying validation errors in our forms
Chapter 6: Live Voting with Phoenix
Building channels and topics in Phoenix
Understanding sockets
Understanding channels
Working with ES2015 syntax
Imports and exports
let and const
Fat-arrow functions
Variable and argument destructuring
Sending and receiving messages with channels
Conditionally loading our socket
Sending messages on the socket
Allowing users to vote on polls
Making voting real-time
Building our dummy functionality
Changing our dummy code to push to the server
Writing our server channel code for live voting
Refactoring our channels away from the index
Moving the channel functionality to show
Starting our channel tests
Summary.
Chapter 7: Improving Our Application and Adding Features
Designing and implementing our new features
Implementing file uploads in Phoenix
Working with uploads in Phoenix
Adding file uploads to our new poll UI
Hooking up the uploads to our database
Writing the migration file
Modifying the schema and the context code
Completing the votes context for the image uploads
Implementing voting restrictions
Creating the vote record migration
Creating the vote record schema
Hooking up restrictions
Fixing the broken tests
Chapter 8: Adding Chat to Your Phoenix Application
Adding chat to a Phoenix application
Working with the chat schema
Building the chat schema
Designing our message functionality
Implementing message functions in our context
Fixing navigation in our application
Creating the chat UI
Building the UI Itself
Creating our chat channel
Sending chat messages
Hooking up the new JavaScript code to Phoenix
Refactoring for poll chats
Fixing up our tests
Returning to a passing test suite
Chapter 9: Using Presence and ETS in Phoenix
Utilizing Presence and ETS to make our app more robust
What is Presence?
Updating our chat UI
Elixir implementation
JavaScript implementation
Using ETS
Why use ETS?
Experimenting with ETS in an IEx window
Creating our Presence ETS table and GenServer
Setting up the GenServer
Creating the public interface for the GenServer
Implementing the cast and call logic
Hooking up the GenServer to our application
Storing Presence data in ETS
Retrieving Presence data in ETS
Chapter 10: Working with Elixir's Concurrency Model
Introduction to Elixir's concurrency model
The difference between concurrency and parallelism
In process 1.
Run process 1
In process 1
In process 2
Run process 1 and process 2 at the same time
Talking about OTP/understanding the model
Working with an example
Diving deeper into the concurrency model
The model - what is a process?
The model - what if our process crashes?
The model - what is a task?
The model - what is an agent?
The model - what is a supervisor?
The model - what is an application?
Using GenServers
Chapter 11: Implementing OAuth in Our Application
Solidifying the new user experience
Shoring up our tests
Building a good development seeds file
Hooking up our polls index
Adding Ueberauth support
Adding OAuth login support for Twitter with Ueberauth
Setting up our application with Twitter
Configuring the Twitter login process in Phoenix
Modifying the users schema
Implementing the Twitter login in Phoenix
Adding OAuth login support for Google with Ueberauth
Configuring Google to allow OAuth
Configuring Ueberauth in Google
Implementing Google OAuth for Ueberauth and Phoenix
Chapter 12: Building an API and Deploying
Building our API
Building an API in Code
Expanding Our API Request
Authenticating Against our API
Allowing a user to navigate to their profile page
Introducing API keys to the database
Validating API Keys
Dealing with Error Handling in APIs
Implementing an API Resource Show
Adding an Error Handler for 404s for JSON
Deploying Phoenix applications to production
Initial requirements for deployment into production
Alternative Deployment Strategies
Other Books You May Enjoy
Index.
Notes:
Description based on print version record.
OCLC:
1035519178

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account