Upgrade Releases with Distillery
Check out this article on building and deploying hot upgrade releases for your Elixir application using Distillery.
Developing a learn Elixir workshop
Working on my second offering of a Elixir workshop for code and supply in Pittsburgh. https://www.meetup.com/Pittsburgh-Code-Supply/events/235623301/
Preloading Nested Associations with Ecto
https://robots.thoughtbot.com/preloading-nested-associations-with-ecto
A look at preloading nested associations in Ecto.
Passwordless Authentication in Phoenix
There are tons of different approaches to user authentication. Passwordless or “magic link” authentication is very user friendly, relatively easy to implement, and sufficiently secure for most apps. This article is a step by step guide for implementing passwordless authentication in Phoenix.
Using Ecto.Multi to Group Database Operations
One of the cool things to come out of Ecto 2.0 is the module Ecto.Multi. It is designed to be a way to group database calls into a single transaction so that the group fails if one fails. In other words, it’s all or nothing. This takes care of the problem we see above. There are no multiple levels of nesting and the API is actually really nice to work with. Let’s take a look!
http://geoffreylessel.com/2017/using-ecto-multi-to-group-database-operations/
Genetic Algorithms with Elixir
Lately, I’ve been experimenting with genetic algorithms and ways to merge them with Neural Networks. The goal is to have Elixir based systems that can problem solve on their own. The post illustrates how GA’s can be used to solve problems. I show an example using a small project known as SPELLER.
Twitter OAuth Authentication with Elixir and Phoenix
There are a few good examples showing how to use OAuth authentication in Phoenix and Elixir, but I wanted a solution which used a small amount of dependencies, and had the ability to make authenticated requests on behalf of a user.
Read more at http://headynation.com/twitter-oauth-elixir-phoenix/
Integration Testing Phoenix With Wallaby
Let’s write an integration test for Phoenix using Wallaby:
https://hashrocket.com/blog/posts/integration-testing-phoenix-with-wallaby
Protect Your Data with PostgreSQL Constraints
Ecto embraces database constraints as the correct way to guarantee consistency in your database. (I helped with that code.) But do you know how to use them?
I’ve recently updated Protect Your Data with PostgreSQL Constraints to show the power and flexibility of features like exclusion constraints.
Molasses - A feature toggling library for Elixir!
A feature toggle library for Elixir using redis or SQL (using Ecto) as a backing service. It allows you to roll out features to a percentage of users or alternatively groups of users.
Building a CQRS/ES web application in Elixir using Phoenix
Case study describing how I built a web application following a Command Query Responsibility Segregation and event sourcing (CQRS/ES) pattern in Elixir.
Maxwell: One HTTP Client to Rule Them All
Maxwell is a Elixir HTTP client which allow developers to customize its behavior with middleware. If you’re familiar with Faraday or Plug, then you’ll love it.
https://medium.com/@zhongwencool/maxwell-one-http-client-to-rule-them-all-dc0ccd9f2f7b#.sh3pdu97n
Deploying Elixir Applications with Distillery
Dive into this high level overview of the process of deploying an Elixir application with Distillery.
Deploying Phoenix on Ubuntu with Gatling
How To for an automated Phoenix deployment on Digital Ocean
There aren’t many detailed posts on how to deploy Phoenix apps to production, yet. This article is a step by step description of what I did to ship my first Phoenix app. I hope it will be a handy resource if you are searching for an easy way to achieve an automated deployment to a single server and leverage hot upgrades.
https://dennisreimann.de/articles/phoenix-deployment-gatling-ubuntu-digital-ocean.html
Tips for Getting Started with Elixir & IEx
https://www.promptworks.com/blog/getting-started-with-elixir-and-iex
A few tips for getting started with Elixir and IEx. This is for people who have been looking for an easy way to get started or who aren’t that comfortable with IEX yet.
Discriminated unions (algebraic data types) in Elixir
Elixir already has product-type, tuples, which allow to aggregate several values in to one. But it lacks a sum-type, which allows to create a structure with a fixed set of values and guards all of them are handled. DiscUnion solves this.
With it, you can create a structure with a finite set of values, and have compile-time warnings if you try to use a wrong value or miss handling one case:
shape.ex:
defmodule Shape do
use DiscUnion
defunion Point
| Circle in float()
| Rectangle in any * any
end
solver.ex:
defmofule Solver do
use Shape
def calc_area(shape) do
Shape.calc shape do
Point in _ -> 0.0
Circle in r -> :math.pi * r * r
Rectangle in w, h -> w*h
end
end
end
If there would be a typo in Rectangle
in solver.ex or this line would be
missed completely, app would not compile and UndefinedUnionCaseError
or
MissingUnionCaseError
would be raised.
For more complete example see tennis kata example (which also creates a structure that does not allow creating invalid state of the game - thanks to using ADTs).
Measuring and visualizing GenStage/Flow with Gnuplot
http://teamon.eu/2016/measuring-visualizing-genstage-flow-with-gnuplot/
Follow-up to last post about tuning GenStage/Flow, now describing how to measure and visualize pipeline progress.
Elixir Phoenix App deployed into a Load Balanced DigitalOcean setup
I documented a high-availability configuration I did for a Phoenix app over DigitalOcean and I just published about it step-by-step. I am looking forward to learn more tips and tricks, so if you’re a seasoned Elixir developer with more experience, let me know how I can improve this setup in the comments sections of the post.
'New' Phoenix React Redux Starter Kit
I’m working on a ‘new’ phoenix starter kit, using react and redux for the front end. I use a fractal approche for the organisation of the react code.
I created 5 branches (4 branches + master). master is the base. The other branches contain : ecto, user support, multi language support, and user + multi language support.
You can have more detail about it here : https://github.com/rsilvestre/phoenix-react-redux-starter-kit