Learning Elixir: Project Structure

New article: Elixir Project Structure — From mix new to a Growing Codebase

I’ve published a new article in my Elixir learning series on dev.to exploring project structure — what happens when an Elixir project outgrows a handful of modules pasted into IEx, and how a real Mix project keeps everything navigable as it grows.

What the article covers

  • Spinning up a fresh project with mix new and walking through the anatomy of the default layout
  • File paths mirroring module names, with a before/after of a module that lived in the wrong place
  • Growing lib/ with real modules (a small Todo feature) and watching the tree branch into subdirectories
  • Running the project with mix run and dropping back into IEx with iex -S mix
  • priv/ for runtime assets the code reads at startup
  • test/ for the project’s own tests
  • config/ and config/runtime.exs, and the difference between build-time and runtime configuration
  • Drawing boundaries so a project stays navigable — what’s internal, what’s external, and what other code is allowed to reach

With complete working examples you can copy into a real Mix project, you’ll learn how a project’s directory map and module naming keep a growing codebase readable — a big step toward organizing Elixir code confidently.

:backhand_index_pointing_right: Check it out:

2 Likes