
Learn how to seek help for Elixir and Phoenix by sharing your code on GitHub, using the course's official Elixir code repo, and browsing sections to debug.
Install elixir by following the official install page for Windows, OSX, or Unix, and use Homebrew on OSX with brew update and brew install elixir for a painless setup.
Set up Elixir and run elixir from the command line, then start a hands-on project to build deck operations and compare functional programming with object-oriented approaches, including testing and documentation.
Generate a new Elixir project using the mix tool, explore the generated files, and set up the cards project to manage dependencies, tests, and documentation.
define a cards module and a hello function in elixir, then run it in iex with mix to see implicit return and call the cards.hello function.
Define a create deck method in the cards module to generate a list of playing cards, test it in the Elixir shell, and recompile to reload changes.
Explore the core differences between object-oriented and functional programming in Elixir, emphasizing modules over classes, design patterns, and data transformation without instance variables.
Explore functional programming by implementing a shuffle function for a deck of cards, handling arity and compile errors, and returning a new shuffled list of strings.
Learn how Elixir's Enum module shuffles data with the built-in Enum.shuffle, understand arity and function calls, and explore list operations in the standard library.
Explore immutability in Elixir as shuffle returns a new deck rather than modifying the original. Learn how Enum powers list operations in a functional programming style.
Implement a contains method in the cards module to check if a card exists in a deck using Enum.member, returning a boolean, and noting the question-mark convention in Elixir.
Expand the create deck method by using list comprehensions to generate every card combination from ace through five across spades, clubs, hearts, and diamonds.
Explore Elixir comprehensions, including mapping over values and suits and using string interpolation to generate cards like ace of spades, while debugging nested loops to flatten results.
Explore solving nested arrays in Elixir by flattening lists to a single deck of card strings, or generate all suit and value combinations with a double comprehension.
Explore immutability in Elixir by returning a new deck when dealing a hand from a card deck, using Enum.split to separate hand and rest, and distinguish lists from tuples.
Learn pattern matching as Elixir's replacement for variable assignment, using left-side patterns to extract a hand and the rest of the deck from a deal's tuple.
Explore how Elixir relates to Erlang, with Elixir code transpiled for the beam, pattern matching, and saving and loading decks via the standard library.
Implement a save method in Elixir that writes a deck to the file system by converting it to an Erlang term binary and using file.write.
Advance pattern matching in Elixir by loading a deck from disk using file.read, extracting the binary from {status, binary}, and converting it with Erlang's binary_to_term to a string list.
Explore how pattern matching powers case statements in Elixir by matching on file read results, using atoms ok and error, and handling unused variables with underscores.
Learn how the pipe operator chains create deck, shuffle, and deal into a single create_hand function, demonstrating a reusable pattern from the cards module in Elixir.
Refactor with the pipe operator in Elixir to chain deck creation, shuffle, and deal into one call, highlighting consistent first arguments and the role of pattern matching.
Package the cards module for public use by documenting its functions, including create deck, shuffle, and contains. Install the x doc package and generate method summaries with x doc.
Document a project with x doc by adding module and function documentation. Generate HTML docs with ex_doc that mirror Elixir's official style and provide clear, navigable details.
Learn how to document a function, including a return description for a deck of playing cards, and enhance the deal function with hand size details and practical code examples.
Discover how Elixir treats testing as a first-class citizen, write and run tests out of the box with mix test, and interpret success and failure feedback for the Cards module.
Learn to write unit tests and doctests in Elixir, run mix test, and harness module and function docs with examples to validate code while documenting usage.
Write doctests by embedding Rdoc tests for the contains function, format them precisely with triple quotes and indentation, and validate results using mix test.
Explore doctests and case tests in Elixir with practical examples like creating a deck of 20 cards and shuffling it. Learn how assertions and refutations guide reliable mix test validation.
Explore maps and keyword lists in Elixir, learn key access with dot notation and pattern matching, and uncover how to create, read, and update map values.
Learn how Elixir updates maps by creating a new map, not mutating the original; use map.put for updates or pipe syntax to add keys, noting errors when keys are missing.
Learn how keyword lists blend lists and tuples, support duplicate keys, and power Ecto database queries in Elixir and Phoenix.
Build a new identicon generator in Elixir using mix new, focusing on syntax; create a 5x5, 250-by-250 grid with 50-by-50 squares, mirrored along the center axis.
Generate a deterministic identicon from a string input, a 300 by 300 image of 25 squares mirrored at the center, so a string yields a consistent identicon saved to disk.
Turn a string into a reproducible identicon by hashing with md5 and mapping the hash to colors and grid squares. Develop the pipeline as small, composable functions in Elixir.
Learn to hash an input string with md5, then wire a pipeline of functions that progressively transform it into an identicon image using the pipe operator.
Hash the input with MD5 via the crypto hash library, convert the bytes to a number list with binary.bin_to_list, and use the result to deterministically drive an identicon.
Hash an input string to a 16-number sequence, derive an RGB color from the first three numbers, then fill a mirrored grid where even numbers color cells.
Define an Elixir struct to hold app data, creating Identicon.Image with a hex field defaulting to nil. Store hashing results in the struct to represent color grid and rgb values.
Demonstrate using a struct for Identicon image, pattern matching to pull the first three hex values as rgb, and ignore the rest with an underscore tail in pick color.
Add a color field to the image struct and convert the hex list to an rgb tuple using pattern matching, returning a new struct to keep data immutable.
Convert a hex list into a 5x5 identicon grid by chunking and mirroring rows, coloring even squares and leaving odd ones white.
Build a Mirror Row helper in Elixir to mirror each hex row in the grid, using pattern matching for the first two elements and ++ to join.
Map over each row produced by enums, applying the Miro function via a function reference using ampersand, and collect transformed rows into a new list in Elixir.
We flatten a nested grid with List.flatten, then pair each value with its index using Enum.with_index to prepare a single, index-aware list for image generation in the identicon.
Filter the identicon grid with enum.filter, using pattern matching to keep only even squares and prepare the image for generation.
Create a blank image with Erlang Graphical Draw (EGD) and draw 50x50 rectangles by mapping grid indices to top-left and bottom-right points using the remainder and div operations.
Implement a pixel map in Elixir by iterating over a grid, mapping each tuple to top-left and bottom-right coordinates using Enum.map and pattern matching, for Identicon rendering.
draws an identicon by creating a 250x250 canvas, iterating over the pixel map to draw filled rectangles with a color fill, rendering to a PNG, and saving to disk.
Explore Phoenix installation: set up Elixir and Erlang prerequisites, generate a new Phoenix project, and configure Node.js and Postgres, preparing you to build with Phoenix in this bootcamp.
install postgres on OSX with homebrew, run brew update, start postgres service, and initialize the data directory at /usr/local/var/postgres for Phoenix development.
Explore how Phoenix serves as a web server to deliver HTML, JSON, and websockets, interacts with a Postgres-backed database, and handles incoming requests through a clear, discrete function pipeline.
Generate a Phoenix project with mix phoenix.new discuss, install dependencies, and explore forum where users sign in via GitHub OAuth, create topics, comment, and editors can edit or delete topics.
Set up a Phoenix project, configure Postgres, run mix ecto create, start the Phoenix server, and explore live reload with template edits updating the browser in real time.
Discover server side templating in Phoenix, delivering distinct HTML pages via http requests, and contrast it with single page apps that render content in the browser.
Learn how Phoenix templates use a shared layout to provide a common header across pages, and how to integrate Materialize CSS for modern styling.
Explore Phoenix's MVC model by comparing model, view, and controller to muffin making, showing how data becomes HTML and how the flow is orchestrated.
Explore how the Phoenix router directs HTTP requests to the page controller, and how controllers render templates to deliver HTML via views in an MVC structure.
Discover how views and templates work together in Phoenix, and how boot up magic links page views to templates through render, with emphasis on naming conventions.
Explore the Phoenix model layer and how it defines data with a topics table in Postgres, including migrations, topic title strings, and initializing an empty database.
Explore how Phoenix and Postgres work together by defining a topics table with a string title via a migration file, generated with mix ecto.gen.migration, and applied.
Plan and implement a topic creation workflow in Phoenix: add a new route, controller, and view with a form to create topics, and map submissions to a Postgres-backed model.
Explore how to map http requests to Phoenix controllers using restful conventions, define routes like get /topics/new, and implement a topic controller with new, index, and delete actions.
Set up a new topic controller for the /topics/new route, run the Phoenix server, and learn to read the development error page and stack trace for debugging.
Understand code reuse in Phoenix with Elixir by using import, alias, and use, comparing object-oriented inheritance to functional module patterns, and applying real examples that copy or reference functions.
Explains how Phoenix shares code using use, import, and alias in Elixir modules, and how use discuss.web, :controller exposes functions for sharing code across controllers, models, and views.
Explore how the conn struct represents incoming requests in Phoenix, and why controller actions must accept two arguments (conn and params) to trace the request through the pipeline.
Explore building a phoenix form using the conn and params to display a topic form. Place validation logic in the topic model to require a title.
Define a topic model that maps to the topics table in Postgres and validates data with a change set. Define a schema with a title field in Phoenix using Ecto.
Explain how a Phoenix schema links a topic model to Postgres and uses a changeset with cast and validate_required to enforce a title.
Explore how change sets transform data into valid database records in Elixir and Phoenix, clarifying the difference between the change set function and the change set object, with practical demonstrations.
Generate and validate changesets to cast form data in Phoenix, enforcing a required title with the Validate Required validator. Connect the change set to an HTML form to show validation.
Build a new topic form in Phoenix by creating a topic view, template folder, and new.html.eex, render with a changeset, and use Phoenix form helpers to post to create action.
Explore Phoenix template syntax by mixing Elixir code with HTML in a form for creating topics, using form_for with change_set and topic path routing to drive conditional rendering.
Learn to handle form submissions in Phoenix by defining a post /topics route to the topic controller create action, and use pattern matching to access topic data from params.
Review how pattern matching and the topic_path helper drive a Phoenix form submission to the topic create function, and examine mix Phoenix routes to reveal get and post endpoints.
Learn how to create a new topic by building a change set, validating params, and inserting with the repo into Postgres, handling success and failure flows with appropriate messages.
Learn to handle failed form submissions by validating title input, redirecting back to the new topic form, and rendering the failed change set with clear error messages.
Submit a post request to the back end (not ajax) using a change set for the form, then style the error message in app.css with red color.
Break restful conventions safely by routing the root to the topic index in a Phoenix app. Then list all topics from the database using the repo module.
Fetch all topics from the database using the repo module and render them on the root page, demonstrating how repo.all retrieves records and how to query with Ecto.
Fetch all topics with repo.all, pass the list to an index template, and render a topic list in eex using a for comprehension to create li elements.
Learn how to redirect after creating a topic to the index route and show a one-time flash message confirming success using put_flash and topic path in Phoenix.
Add a floating action button on the topics list using material design and Phoenix path helpers to generate an anchor tag that navigates to the new topic form.
Explore implementing edit and update routes in Phoenix, using a wildcard id, topic path helpers, and a new edit form that mirrors the create workflow to manage topics.
Develop the edit form for an existing topic by fetching it with Repo.get, building a change set, and rendering a form_for that posts to the update route.
Define the update route and edit form for topics, wiring a change set to prepopulate the title input and show validation errors, then route put requests to the update action.
Define and test an update handler for topics, fetch the topic id from the URL, build a change set from form params, and update with repo.update.
Learn to wire the edit topic flow by passing the topic to the edit template in errors, and add topic edit links on the index using the topic path.
Enable topic deletion by wiring a delete request to the topic controller with Phoenix’s resources helper. Explore restful routing and route helpers, including namespacing vs forward slash.
Develop a delete handler in Phoenix by fetching the topic with repo.get_bang, deleting it with repo.delete, and handling bang versus non-bang errors with redirects and flash messages.
Demonstrates completing the topic controller by adding a delete link that issues a delete request to the topic path, with Phoenix creating a form and CSRF protection.
Elixir and Phoenix are two of the hottest technologies of 2017.
Functional Programming? You will learn it. Phoenix with OAuth? Its here. Postgres for data storage? Of course! Websockets too!
This course will get you up and running with Elixir and Phoenix quickly, and teach you the core knowledge you need to deeply understand and build amazingly fast web applications.
We'll start by mastering the fundamentals of functional programming with Elixir, including functions, modules, and the fantastic 'pipe' operator. You'll learn how FP differs from classic object oriented programming with a variety of different practical examples. Once you have a solid understanding of Elixir, we'll discuss how to build amazingly fast applications with the Phoenix Framework with an in-depth app. Source code is provided for each lecture, so you will always stay up-to-date with the course pacing.
If you are new to Elixir, or if you've been working to learn it but sometimes feel like you still don't quite 'get it', this is the Elixir course for you! To learn Elixir and Phoenix you have to understand them.
I've built the course that I would have wanted to take when I was learning Elixir and Phoenix. A course that explains the concepts and how they're implemented in the best order for you to learn and deeply understand them.