Murphy’s setup guide for a new Phoenix (1.5) project

What follows is an extremely concise list of steps I’m keeping around for reference when setting up a new Elixir / Phoenix project with Tailwind, Alpine, and user auth. NOTE: Pretending the name of the app is “love_notes” Generate it mix phx.new love\_notes –live Use UUIDs in config/config.exs Setup Tailwind from https://pragmaticstudio.com/tutorials/adding-tailwind-css-to-phoenix Install Postcss In assets/postcss.config.js Webpack In your config: Tailwind Config Modify the config to add purge directories, set up the jit, enable dark Read more…

Elixir and the Wall of Tests

Here’s an experience I tend to have over and over: Generate a new Elixir / Phoenix project Use the super cool Phoenix generators to make a new model Change the model substantially Realize that the tests generated with the model are now super broken When I get into this situation running mix text produces a huge number of errors. For some reason, I always want to scroll to the top of the error list and Read more…

UUIDs for User IDs

Integers By Default 🔢 Phoenix’s generators save a ton of time writing boilerplate code. Pow is an Elixir package and Phoenix extension that offers a great way to get user authentication up and running in very little time. But by default Phoenix’s generators use auto-incrementing integers for user IDs. What’s Wrong with Integer IDs 🤔? I’ve been bitten nastily by integer IDs multiple times in my career. One time a backup failure caused the counter Read more…

On Pagination and Sort Order

The Bug 🐞 We’ve been testing the next generation of our sync engine at Day One prior to public release, and we found a funny bug. We have an endpoint for fetching a big list of entries that have changed since the last fetch. This endpoint is also how a new phone with no content would pull down all entries from a journal. But when we did try to sync all of our journal contents Read more…