Phoenix and LiveView applications are awesome on Fly.io! This is the home for Phoenix-oriented content ranging from Ecto to LiveView and more.
By Mark Ericksen 3 min Read
Taking Control of Map Sort Order in Elixir
If you've recently upgraded to Elixir 1.14.4 and OTP 26, you may have noticed that map keys are no longer showing in a predictable order. Fear not! Understanding why it's happening and taking the time to sort the keys by default can save you some ...
ProblemYou are building an application that interfaces with OpenAI's ChatGPT and want to create a real time interactive experience just like the OpenAI Chat UI. To do this we will need to work with the ChatGPT Streaming API, which is built using...
ProblemAt some point, you or your team ran mix ecto.dump and generated a priv/repo/structure.sql file. Then old migrations files were removed. Things were great and you could handle the local dev and test setup using mix ecto.load. If you were mi...
The Elixir community has a sleeping giant brewing with Nx, and not just for Machine Learning. Nx allows you to describe nearly any numerical operation, which can then be run in an optimized environment for such operations. If you read the Nx READM...
ProblemAt some point, you or your team decided to cut the dead weight of many old migrations and instead run mix ecto.dump and generate a priv/repo/structure.sql file. Now you want to bootstrap a new staging server, dev environment, or just get s...
Building a Drag-and-Drop List With LiveView and SortableJS
In this post, we'll create a List component with draggable and droppable elements functionality. We'll use some components from core_components.ex to design the List component, and then add the necessary logic to implement its behavior. The end re...
ProblemYou just got access to the ChatGPT Plugin beta, and you want to hook up your database of knowledge to the AI GPT4, so it can help you and customers navigate your complex world. You've never done that, and all of their docs are in Python......
File and image uploads in LiveView are already easy and elegant. But what if the user wants to upload an entire directory with more nested directories and files? How should we handle that? Chris McCord walks us through what it takes to make that a...
ProblemWe need to perform a CPU intensive or system level programming task and there are just no good solutions in hex.pm, in this example let's pretend there are no good ways to do image processing with Elixir. As is often the case, there IS a h...
A lot of cool stuff is available in Erlang's OTP Standard Library. Elixir has the ability to directly use everything in OTP and that means we have a number of built-in features available to us. One of those features is the Erlang :zip module. As t...
Crafting Your Own Static Site Generator Using Phoenix
The year is 2023, you have many options for building a Static Website. From the OG Jekyll to literally hundreds of JavaScript based options to people suggesting you should just craft HTML by hand. All of these solutions are correct and good, and y...
In this post, we'll build out a LiveView chatroom app with the help of LiveView's new streams feature. You can follow along in the open source codebase or skip ahead to play around with the finished product. We'll see how streams seamlessly integr...