A standard Phoenix application with these directories:
lib ├── shop ├── shop_web
We need to interact with the LinkedIn API to upload and download images and text postings. For that we want to create a new module which gets called from the controllers. Let’s assume we call this file
linked_in.ex. An example function would be
What we discuss in our team is the best location for that file. Should we put it in the
/lib/shop/linked_in.ex or should we create a new directory and put it in
/lib/social_media/linked_in.ex? Or should we even put it under the
/lib/shop_web directory because we are using it only from the controllers?
I am aware of the fact that it doesn’t matter technically where we put this file. I would like to understand what is the best practices approach for this. Where would a normal Phoenix/Elixir programmer search for it? Thank you!