DEV Community

Cover image for Exploring the Perfect Elixir Setup
Jon Lauridsen
Jon Lauridsen

Posted on • Updated on

Exploring the Perfect Elixir Setup

I'd like to explore various ways of working with Elixir projects, diving into the tools, techniques, and processes that offer the most productivity and lowest cognitive loads. There's a lot of tradeoffs one can consider when starting and scaling any project, but today we'll see what choices awaits us in the world of Elixir.

Our goal will be to identify clean, uncluttered development processes and design-patterns, aimed at small team developments either when starting a new project or scaling up a project.


In case you're new to this language (like I am), Elixir is a dynamic, functional programming language from 2011, with a syntax inspired by Ruby. And much like Java builds on its Java Virtual Machine, Elixir builds on the Erlang Abstract Machine (or BEAM for short). The BEAM started in the mid-80s, and is renowned for running critical and highly fault-tolerant distributed systems at scale.

But this isn't a series for deep-diving into the fundamentals of Elixir, all you'll need here is a general understanding of programming, an appetite for experimenting with various tradeoffs, and a curiosity to see how it all fits into the Elixir context. If anyone does want to learn more Elixir fundamentals I can recommend starting with these great resources:

  1. Official Elixir Website and Documentation: The Elixir official website is the best starting point, with comprehensive documentation and getting started guide.
  2. Thinking Elixir podcast is a great podcast to catch the latest news and understand what happens in the community.
  3. The Elixir Forum is an excellent place to ask questions, and engage with the community. It's known for being welcoming to newcomers.

Exploring Elixir?

Now back to the exploring. This will be an open learning journey: I'm new to Elixir, so this is genuinely a dive into the unknown to explore which permutations exist in setting up an Elixir project. We'll start with installing system dependencies, and work towards deploying an app. Your feedback and insights are most welcomed as I'm bound to miss lots of things you take for granted, so please join in the comments so we can explore together.


1. Environment Setup

We need Erlang and Elixir installed, which might sound simple but there are tradeoffs to consider when setting up a development environment such that it can be shared across a team. And because most projects need to persist data we'll also add a PostgreSQL database so our explorations can stay relevant to real-world complexities.

This article explores asdf, Nix, and pkgx to set up a reproducible development environment.

2. Foundations of a Web App

Today we’ll make a simple web app, and try to decipher what nuances and tradeoffs exist between the available solutions. So let’s dive in and see if one stands out as more applicable to our needs than the others. Ideally we’ll end the day with at least one sample app that calls into our database and returns some HTML, but let’s see how that ambition fares.

This article explores Cowboy, Plug, Bandit, and Phoenix, to set up a web app.

3. Development Workflows

🚧 Still working on this, ETA ASAP

Let's dive into the tools and workflows we’ll use for our daily development: We want a super-friendly onboarding experience that easily and quickly gets developers running locally, and simple mechanisms that safely and efficiently lets us make code changes. Lets dive into some solutions to see how it all works out.

This article explores how to write and test shell scripts to set up efficient workflows, and dips into non-shell scripting, and touches on ways to increase Git integration.

Top comments (1)

jonlauridsen profile image
Jon Lauridsen • Edited

I think I have a handle on the upcoming workflows article now, with a first draft that's looking reasonable. I plan to release the article next week. And I need to get this out the door because I'm due a child soon, which will no doubt disrupt the time available for writing these articles! 😊

EDIT: The child arrived. Article release delayed :)