ðĶDirectory structure
If you had run the getting started instructions from the previous page, you would see the following directory structure for your project:
_build
: contains the compilation artifactsassets
: stores front-end assets like JavaScript and CSS; static assets like files go topriv/static
config
: common directory used to store project configurations (more information about order of config reading below)deps
: contains all Mix dependencies listed undermix.exs
underdeps/0
lib
: umbrella project for main application source code wherelib/practical_elixir_demo
holds the back-end logic (model) whilelib/practical_elixir_demo_web
holds the front-end logic (view and controller)priv
: all resources that are necessary in production but not a part of source code like database scripts, static resources, etc.test
: contains unit tests for application, similar structure aslib
The specific structure of each folder in lib/
will be discussed when we actually modify those files.
The file that end with *.db-*
are the SQLite3 files that maintain the database.
Config order
There are several configuration files that are used in Phoenix (or any Mix project for that matter) and in their read order:
config.exs
: base configurations declared for the project, these are read during compile timedev.exs
/prod.exs
/test.exs
: environment specific configurations that run only when the project is run in a given environment (during compile time as well)runtime.exs
: configurations that are run during runtime
runtime.exs
are the preferred method for loading environment variables from environment files like .env
while config.exs
are preferred for environment variables that may not be secrets and are readily accessible during compile time.
For more information about configuration files in Elixir, please refer to the official Elixir documentation for the Config
module.
Last updated