What is the relationship between Phoenix module names and file structure of a project?

Don’t worry You are not the only one to have this question.

TLDR; There is no relation between filename, directory and module name. You should adopt your own convention. In the end, module names are just atoms, as You can see with i command…

iex> i Code.Formatter
Term
  Code.Formatter
Data type
  Atom
Module bytecode
  /Users/sqrt/.asdf/installs/elixir/1.7.3-otp-21/bin/../lib/elixir/ebin/Elixir.Code.Formatter.beam
Source
  /home/ubuntu/bob/tmp/412672862f47582cfc8e244ce57c682a/elixir/lib/elixir/lib/code/formatter.ex
Version
  [226900569409235149567530218176092212642]
Compile options
  []
Description
  Call Code.Formatter.module_info() to access metadata.
Raw representation
  :"Elixir.Code.Formatter"
Reference modules
  Module, Atom
Implemented protocols
  IEx.Info, Inspect, String.Chars, List.Chars

But of course naming is hard.

2 Likes