↓ Skip to main content

Phoenix

A printing press inside a glass bowl, turning falling coloured shapes into a stack of report pages while its flywheel spins.

Render PDFs in Elixir with the Typst NIF

· 6 mins

A Phoenix app renders its report PDFs inside the BEAM with the typst package's NIF. Why not headless Chrome or the Typst CLI, the checks a NIF has to pass, and a benchmark against the CLI.

A risograph print of three different doors opening onto one room, a luggage tag on a string passing through each

Make the Phoenix scope the first argument

· 3 mins

Pass Phoenix 1.8's Scope first to almost every public context function, and the context becomes one authorization layer for your LiveViews, controllers, APIs and MCP server.

A cutaway of walled rooms, each with one doorway, and a rubber stamp coming down on a cable that tries to go through a wall instead.

Enforce Phoenix contexts with boundary

· 5 mins

Phoenix contexts are a convention until something checks them. boundary makes a call from the web layer into a context's internals fail the build, even on an app that already breaks the rules.

A risograph print of a robot hand plugging a cable into one socket, with a second, tagged socket beside it left empty

MCP before REST when the caller is an agent

· 5 mins

We wanted AI agents to work with our app. I built an MCP server with OAuth first, and REST only when a script that doesn't speak MCP needed the app too.

Which id belongs in the URI

· 3 mins

A record with its own primary key and an id from the upstream system that sent it. The upstream id usually belongs in the URI, when it passes three tests.