- api
- config
- lib
- priv
- web
- routes
- surnames
- controllers
- views
- adapters
- tree
- controllers
- views
- adapters
- members
- controllers
- views
- adapters
- fmp
- controllers
- views
- adapters
- layout
- templates
- views
- surnames
- shared
- parsers
- json
- parsers
- plugs
- channels
- routes
This folder should be used for static shared code that doesn't change often, mostly because phoenix hot reloader excludes /lib
precisely so you can have a folder to put long-lived code.
/lib
structure- we are getting rid of
/src
and what is in/domain
will be moved to/web/shared
. /environment
will be moved to/web/shared
but ideally we want to remove it all togetherpre-library
will be removed, and what is inside it will just go up one level (i.e./lib
)
- we are getting rid of
We'd have the test files next to the actual files we are testing so that there is less navigation.
This is where the most change is suggested.
-
We would like to have all code for a specific "domain" to be in it's own folder, we have called that
/routes
. That way, whenever we have to change something related to surnames all we need to do is open/surnames
folder.
Each route should then subsequently have the following structure:- /controllers
- controllers get data from adapters, pass it on to views which template and return.
- /views
- these will be mainly json views which will take in data and template it.
- /adapters
- adapters will gather the data and return it.
This would make sure we all follow the same pattern.
- /controllers
-
We then would have
/shared
where we would have "helpers" likejson
parsers.
/queries
/service_wrappers
/templates
/adapters
Also we'd talked about the
/shared
structure for say the JSON library to be a bit more like/web/shared/parsers/json.ex
rather than a folder for each helper module. At least that's how I understood it.