Lesson

Introduction

Starting Phoenix Framework for Rails Developers - Lesson 1

You are not signed in! It would mean a lot to me if you signed up through Github
- I would like to see who you are and I might occationally reach out to you with information aboout updates and questions.

Welcome to the course “Starting Phoenix for Rails Devs”. I am going to cover the basic concepts of building a modern web app using Elixir and Phoenix Framework.

The course will also cover some aspects of Phoenix LiveView library.

Phoenix LiveView gives you a new way to build interactive web apps basically without using any Javascript at all. It is truly amazing and I am super excited about it.

What we are building

We are going to build a classic TODO app. I know, it’s boring but it’s also something that is conceptually easy to understand and doesn’t come with complex business logic. We can just focus on the code.

It will consist of lists that have many tasks. And those tasks can be toggled completed.

The interface is interactive and uses Phoenix Channels and Phoenix LiveView.

The app is a multi user system with an authentication system and a way to keep track on which user is currently online with the built in Phoenix Presence.

The course also cover file upload and email sendouts.

For styling I use Tailwind CSS, a CSS framework that uses composable utility classes in the markup, instead of a premade CSS components like Bootstrap.

Who is this course for

As the title says, I am assuming that you already know how to build web apps with Ruby on Rails.

I also assume that you know about common concepts like authentication, file upload and sending emails.

You should also already know how to install and use a package manager like Homebrew, installing and using Node and finally install and to some extent use Postgresql

Goals

The main goal with this course is to make you be able to start with Elixir and Phoenix.

You should be able to start a new project, create forms for entering data, display data, send emails and upload files. Normal everyday web application features.

You should also know how to get started with using the Phoenix LiveView, Phoenix Channels and Phoenix Presence.

Need to know for this course

There are a few thing that you need to know before this course. Most things that I cover in this course are fairly easy to wrap your head around if you already know Ruby on Rails.

However, there are two Elixir specific topics I want to cover first:

The pipe operator

Elixir have a way of piping functions together. And it works so that the value to the left of the pipe operator will be the first argument in the next function.

This allows for a nicer syntax but will take some time to get use to.

Pattern matching

The next thing that is used a lot is pattern matching. This also takes some time to get used to but is often used in case statements, function calls and test assertions.

So scenarios where you care more about the structure of the data than the data itself.

For example, if you look here in get_permissions, I pass in a user, but the only attribute I care about is if the user is an admin or not. All other user data, I can just disregard, or not pattern match against when I call this function.

Lessons