Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Phoenix Web Development

You're reading from   Phoenix Web Development Create rich web applications using functional programming techniques with Phoenix and Elixir

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781787284197
Length 406 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Brandon Richey Brandon Richey
Author Profile Icon Brandon Richey
Brandon Richey
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. A Brief Introduction to Elixir and Phoenix FREE CHAPTER 2. Building Controllers, Views, and Templates 3. Storing and Retrieving Vote Data with Ecto Pages 4. Introducing User Accounts and Sessions 5. Validations, Errors, and Tying Loose Ends 6. Live Voting with Phoenix 7. Improving Our Application and Adding Features 8. Adding Chat to Your Phoenix Application 9. Using Presence and ETS in Phoenix 10. Working with Elixir's Concurrency Model 11. Implementing OAuth in Our Application 12. Building an API and Deploying 13. Other Books You May Enjoy

A Brief Introduction to Elixir and Phoenix

In this book, we'll walk through the process of building a functional prototype of a social web application that will rely on real-time data updates. If you've ever used any sort of live voting application out there (such as Straw Poll or Twitter Polls), then you're probably pretty comfortable with the idea already. If not, I'll summarize our application so that you know what you're going to be building throughout this book.

Our application will allow users to register for new accounts on our site. From there, they will have the option to create new polls for other users (either while logged in or anonymously) to vote on. We want to make sure that the votes for the polls are recorded and broadcast out to anyone watching the polls in real-time, so we'll take advantage of Phoenix's built-in channel support to provide this.

In addition, our application will allow users to create chat rooms that will be displayed alongside the poll. After they've voted, users will be allowed to chat and discuss the results live as the votes come in. Users will also be allowed to post images, which will be processed, and uploaded to S3.

Users who create polls will be able to decide who is allowed to vote on their polls; for example, either only logged-in users or any user. Users will be able to modify their polls until they go live.

Users who own the polls should be able to participate in real-time discussions with the people voting on and viewing their polls, including anonymous users. Being able to communicate with each other takes advantage of some of the more advanced real-time concepts that are powering Elixir behind-the-scenes and running separately from the main web portion of our Phoenix application. These concepts demonstrate how we can build larger and more performance-intensive applications!

Now, before we really dive into developing this application, we'll need to make sure we understand some of the tools that are going to help us build this application. The assumption is that you're coming into this with an existing understanding of Elixir, but if not, we will briefly cover some core Elixir concepts while also learning about a tool that will be critical for building a great application in Elixir: the IEx shell and the debugger!

To recap, in this chapter we will cover the following topics:

  • Basic Elixir concepts
  • The interactive Elixir shell, IEx
  • Installing Phoenix
  • Creating a new Phoenix project with Mix tasks
  • An introduction to the Phoenix project structure
You have been reading a chapter from
Phoenix Web Development
Published in: Apr 2018
Publisher: Packt
ISBN-13: 9781787284197
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image