I can’t seem to find any explanation of the directory structure created by:
$ mix phx.new hello
I’ve looked through both Programming Phoenix > 1.4 and Phoenix in Action (v6), as well as the phoenixframework website. At the present time, I’m interested in knowing what the priv dir is for, but I’d also like at least a cursory explanation of what each of the other directories is for.
For Phoenix 1.3 and 1.4 you want mix phx.new hello. mix phoenix.new gives you the old structure.
The priv directory is a folder that holds static assets, migrations, and other files that aren’t compiled as part of running your program but need to be shipped with it anyway.
Okay. That was a typo on my part (I’ve never used phoenix.new).
The priv directory is a folder that holds static assets, migrations, and other files that aren’t compiled as part of running your program but need to be shipped with it anyway.
How did you learn that? The directories must be explained somewhere in the docs, right?
Arghh. I read about the erlang Application directory structure in the erlang docs last week, and I misremembered it being in Programming Phoenix, and I was flustered that I couldn’t find it.
priv dir is where you do seed and migration which is the last two chapters of part i of the Programming Phoenix > 1.4 book. You have to seed categories.
lib library is where most of your serverside code are at. there is lib/hello and lib/hello_web. hello is where you model (which is broken down to context and schema) are at. controller, views and templates are in hello_web.
dep is where your package lives if you use any or just the default phoenix ones.
config is where you config stuff either phoenix or packages you’ve install.
asset is your web asset lives.
tests is where your test live which you do in the book too.