- 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
On
/lib
: it's not reallyusher run hot
that's the issue, it's the phoenix hot reloader which excludes/lib
precisely so you can have a folder to put long-lived code. Also, I thought we'd agreed to get rid of thepre-library
folder and move those contents into either/lib
or/web/shared
depending on their nature.On
/test
: we don't need to compromise anymore! 🎉On
/web
: might want to add definitions of what we think should be in each folder. i.e. controllers get data from adapters, pass it on to views which template and return.