Web and Lib

Hello *. I know the difference between web/ and lib/ in Phoenix, but still I have some doubts about where to put some things :slight_smile:
I have a module whose task is to query and external HTTP server and encode/decode JSON, nothing fancy.
I’ve put it under web/models, but honestly my gut feeling is that it’s not supposed to be there.

The choice to put it under models/ was because at the beginning it was used mostly by controllers directly, but now it’s called from my toniq workers, and it doesn’t feel “natural” anymore.
Should I move it under lib? Where would you put it?

TIA,
ngw

I think you can even move it totally different app :wink: I would probably put in to the lib in Services directory/module if it’s small, and into a new app if it was bigger than small.