<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ecto on Buro notes</title><link>https://notes.burelli.xyz/tags/ecto/</link><description>Recent content in Ecto on Buro notes</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 25 Oct 2026 03:36:31 +0100</lastBuildDate><atom:link href="https://notes.burelli.xyz/tags/ecto/index.xml" rel="self" type="application/rss+xml"/><item><title>How I set up an Elixir project</title><link>https://notes.burelli.xyz/posts/engineering/elixir/project-setup/</link><pubDate>Sun, 25 Oct 2026 03:26:27 +0100</pubDate><guid>https://notes.burelli.xyz/posts/engineering/elixir/project-setup/</guid><description>&lt;h1 id="how-i-set-up-an-elixir-project"&gt;How I set up an Elixir project&lt;/h1&gt;&#10;&lt;p&gt;A short checklist for every new Elixir project: the libraries I use and the rules I apply.&lt;/p&gt;&#10;&lt;h2 id="libraries"&gt;Libraries&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/ecto/Ecto.html" target="_blank" rel="noopener noreferrer"&gt;Ecto&lt;/a&gt;&lt;/strong&gt;: database (PostgreSQL).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/phoenix/overview.html" target="_blank" rel="noopener noreferrer"&gt;Phoenix&lt;/a&gt;&lt;/strong&gt;: web layer and APIs.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/phoenix_live_view/welcome.html" target="_blank" rel="noopener noreferrer"&gt;LiveView&lt;/a&gt;&lt;/strong&gt;: the UI, when possible.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://daisyui.com/components/" target="_blank" rel="noopener noreferrer"&gt;daisyUI&lt;/a&gt;&lt;/strong&gt;: UI components on top of Tailwind, when I build the frontend.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/req/readme.html" target="_blank" rel="noopener noreferrer"&gt;Req&lt;/a&gt; + &lt;a href="https://hexdocs.pm/finch/Finch.html" target="_blank" rel="noopener noreferrer"&gt;Finch&lt;/a&gt;&lt;/strong&gt;: HTTP requests. Easy to test: &lt;code&gt;Req.Test&lt;/code&gt; mocks the responses.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/swoosh/Swoosh.html" target="_blank" rel="noopener noreferrer"&gt;Swoosh&lt;/a&gt;&lt;/strong&gt;: emails, with HTML templates rendered by Phoenix. Easy to test with its test adapter.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/guardian/readme.html" target="_blank" rel="noopener noreferrer"&gt;Guardian&lt;/a&gt;&lt;/strong&gt;: authentication.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/open_api_spex/readme.html" target="_blank" rel="noopener noreferrer"&gt;OpenApiSpex&lt;/a&gt;&lt;/strong&gt;: OpenAPI spec of the APIs, request validation, Swagger UI.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://hexdocs.pm/oban/Oban.html" target="_blank" rel="noopener noreferrer"&gt;Oban&lt;/a&gt;&lt;/strong&gt;: background jobs.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://prom-ex.hexdocs.pm/readme.html" target="_blank" rel="noopener noreferrer"&gt;PromEx&lt;/a&gt;&lt;/strong&gt;: Prometheus metrics.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="rules"&gt;Rules&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Folders by feature&lt;/strong&gt;: &lt;a href="https://notes.burelli.xyz/posts/engineering/code-design-and-architecture/organize-by-feature/"&gt;Organize code by feature, not by type&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Errors&lt;/strong&gt;: one &lt;code&gt;Error&lt;/code&gt; struct, caught only where you can handle them: &lt;a href="https://notes.burelli.xyz/posts/engineering/code-design-and-architecture/errors/"&gt;Errors: model them once, catch them once&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Docker&lt;/strong&gt;: always containerized.&#10;&lt;ul&gt;&#10;&lt;li&gt;A Mix release in a multi-stage image (&lt;code&gt;mix phx.gen.release --docker&lt;/code&gt;).&lt;/li&gt;&#10;&lt;li&gt;A health route (e.g. &lt;code&gt;GET /health&lt;/code&gt;) for the container health check.&lt;/li&gt;&#10;&lt;li&gt;Built and labeled in CI following &lt;a href="https://notes.burelli.xyz/posts/engineering/docker-containers/#build-phase"&gt;Docker containers management&lt;/a&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item></channel></rss>