A free introduction to Elixir, OTP, Ecto, and Phoenix
Today, DailyDrip is releasing five weeks of free content to introduce people to the Elixir programming language and prepare them for building web applications using Ecto and Phoenix. We produced 25 short-form episodes (around five minutes each) that will take you from “what is this Elixir thing?” to “Cool, I know how to build a basic Phoenix-based webapp” rapidly. From there, we’re building a production-capable app in the ongoing premium content.
If you just want to see the content, you can skip ahead, otherwise stick around and we’ll look at why we are investing so much time in the Elixir ecosystem.
A bit of history
I started ElixirSips four years ago because I ran into concurrency and fault tolerance issues on a few projects. Through research I concluded that the solution to these problems was the Actor Model, and that led me to Erlang and Elixir. 18 months ago Adam joined me and ElixirSips became DailyDrip. Our goal is to help you be a better developer; to that end, we produce daily short-form videos on Elixir, Elm, and so much more.
Firestorm — an open source Phoenix-based forum
Late last year we noticed a lack of substantial example projects using Elixir and Phoenix. At the same time, we weren’t happy with the options that were available for plugging comments into DailyDrip. So we started the Firestorm Forum project on Kickstarter, with the idea that we would provide content about its development. The Kickstarter was successful!
As part of the Kickstarter, we created free content to introduce Elixir to more people. That’s the content we’re announcing at the end of this post. We are also continuing to build out the Firestorm Forum in the DailyDrip Elixir topic. We are building this project the way we have empirically learned that production applications should be built, using best practices like Continuous Integration, Continuous Deployment, and a solid test suite.
We’ve built an alpha release of Firestorm while dogfooding it within the community. We’re in the process of revamping Firestorm for Phoenix 1.3. We expect to reach 1.0 in early July.
Following the development of this project will present real-world solutions to problems that anyone building production Elixir applications might encounter. We hope this helps both individuals and teams embrace all of the awesome that is Elixir and its community. The detailed development log also makes it easy for people to contribute to Firestorm itself, of course!
The free content and time we spent on the project wouldn’t have been possible without the support of everyone that contributed to our Kickstarter. We are incredibly grateful, and hopeful that this project can be proof that it’s possible to build high quality open source software for the world — while also producing high quality educational material. If you’re interested in the success of the Firestorm Forum, or find the free content valuable and want to see more of this sort of thing in the world, we would be honored if you’d sign up for a personal or team account at DailyDrip.
Startups are hard!
The hard truth is that we are losing money while providing you with all this content. We’re trying to help make the world better for developers. We’ve got some great content that will help you learn not only Elixir and Phoenix, but Elm, React Native, Swift3, Ember, and lots more. People tell us they love our content, but in order to keep producing it — and projects like Firestorm — we need more paying subscribers.
We’d love to help you or your team of developers stay up to date on the latest and greatest in the software world. Additionally, if you have a hard problem that needs senior developers on it, we’re available to help.
We’d like to feed our families and focus on making great content and open source software, help us do that by subscribing here. That said, without further ado, here’s our free content!
Episodes
Week 1: Beginning Elixir
In the first week you’ll learn the basics of the Elixir programming language syntax and its tools, and you’ll learn how to send messages between processes. We wrap up with a self-directed exercise to build a standalone process of your own.
- [001.1] Introduction to Elixir — Introduction to the language, and installation of Erlang and Elixir
- [001.2] Basic Elixir Syntax and Concepts — Learning the basics of the language, as well as how to run scripts.
- [001.3] Mix and Modules — Using the mix tool and defining modules, functions, and structs
- [001.4] Processes and Messaging — Processes are the unit of concurrency. We’ll spawn some processes and let them have a conversation.
- [001.5] Elixir Weekly Drip #1 and Exercise: String Upcaser “Microservice” — Further links for reading, and a gratuitous exercise to build a process that responds with the upcased version of any strings it is sent.
Week 2: Intermediate Elixir
In week two you’ll learn how to write tests using ExUnit, some more facets of the language itself, and how to manage state.
- [002.1] Intermediate Elixir Prep — Preparing to learn about managing state and testing.
- [002.2] Processes With State, and Agent — Managing state with processes and messaging, then seeing the Agent module from the Standard Library for a simpler way to do the same thing.
- [002.3] `for` Comprehensions — Handling enumerables and collections with power and grace.
- [002.4] Testing with ExUnit — An in-depth look at ExUnit, Test-Driven Development, and doctests.
- [002.5] Elixir Weekly Drip #2 and Exercise: Reverse Polish Notation Calculator — Links on documentation, with, control structures, Enumerables, and an exercise to build a Reverse Polish Notation Calculator.
Week 3: OTP
In the third week you’ll learn about OTP. This is part of the standard library that exists to help you model concurrent processes well. It also provides supervision trees, which are the building blocks that make it possible to build fault tolerant applications with Elixir.
- [003.1] Preparing to Learn about OTP — A solution to the Reverse Polish Notation Calculator exercise, and preparatory readings for learning about OTP.
- [003.2] GenServer and Supervisor — Building Generic Servers and Supervision Trees
- [003.3] Supervising Tasks and Agents — Using Supervisors to handle nuance within your Tasks and Agents.
- [003.4] GenStateMachine — Modeling a door with a numeric lock, to explore building Finite State Machines.
- [003.5] Elixir Weekly Drip #3 and Exercise: Supervised RPN Calculator and Tape Printer — Interesting links and an exercise to build an RPN Calculator with GenServer, with a Tape Printer.
Week 4: Ecto
In week four, we introduce Ecto, which helps you interact with your database. We’ll start building a data model for a forum and we’ll end up with a few non-trivial queries.
- [004.1] Preparing to Learn About Ecto — A solution to last week’s exercise and some readings to prepare us to learn about Ecto.
- [004.2] Ecto Basics — Getting started with Ecto by creating a basic schema and querying it.
- [004.3] Ecto Validation with Changesets — Ensuring your data meets your requirements, flexibly.
- [004.4] Ecto Associations and More Queries — Exploring how to model associated data in Ecto and further details on queries.
- [004.5] Elixir Weekly Drip #4 and Exercise: More Queries — Some Ecto-related links and an exercise to write more detailed queries
Week 5: Phoenix
In the fifth and final week of free content you’ll learn about Phoenix, and we’ll start building the Firestorm Forum from scratch. Firestorm is an open source Phoenix-based forum engine that aims to provide a large, real-world Phoenix codebase for people to learn from.
- [005.1] Preparing to Learn About Phoenix — Solving an Ecto exercise and preparing to learn about Phoenix.
- [005.2] Getting Started with Phoenix — Creating a new app and generating some resources.
- [005.3] Phoenix and the Frontend — HTML, CSS, and JavaScript are actual things.
- [005.4] Nested Resources in Phoenix — Categories have Threads, and our URLs should reflect that.
- [005.5] Elixir Weekly Drip #5 and Exercise: Fix Tests — Fixing the tests after last episode, and some Phoenix-related links.
Week 6: Starting Firestorm
Week six is where the premium content begins, and we’ll keep going from here. This week we switch from Brunch to Webpack2, implement OAuth authentication, look into Ecto.Multi, see how can use Changesets to handle some transactions more intelligently, and work with views and layouts.
- [006.1] Webpack2 with Phoenix — Replacing Brunch with Webpack in a Phoenix app
- [006.2] Authentication via OAuth — Using Ueberauth to authenticate users against OAuth providers.
- [006.3] Adding Posts to Threads with Database Transactions — Handling database transactions in style, with Ecto.Multi.
- [006.4] Using Ecto Associations in Phoenix — Being smarter about modifying and inserting associated data.
- [006.5] Phoenix Views, Templates, and Layouts — Making Firestorm look a bit more like it should.
Thanks so much for checking it out, and please share this post with anyone you think might be interested in Elixir.
Hacker Noon is how hackers start their afternoons. We’re a part of the @AMI family. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.
If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!