"Phoenix is modular", so what can I delete?

I have a good idea for a simple project—it’ll just monitor a Twitter account and send socket messages up on new tweets. Some simple JavaScript (working inside an EEx template file so not JSON-only) will put them in the DOM. I’ve read some literature and a good approach would be to use Phoenix, but to remove the stuff that I don’t need.

I’m not the most knowledgeable about Phoenix, so what is the stuff I can delete?

I know I don’t need Ecto, but do I need models, controllers? How much can I delete?

Again, all I want is one page that has some JavaScript and a couple of channel files to send tweet data to the socket that the JavaScript accepts.

Thanks!

3 Likes

You can delete pretty much everything if you wish. If you want to strip down your Plug/controller pipeline, look into config/router.ex and lib/appname/endpoint.ex and get rid of stuff you don’t want to use. Then, open web/web.ex and decide which parts for models or controllers you don’t need.

Having said the above, this will not generally reduce the size of your generated application, unless of course your remove some libs from mix.exs.

Ah, and you can get rid of node / brunch files of course if you don’t find them appealing too.

2 Likes

http://theerlangelist.com/article/phoenix_is_modular is a good post by @sasajuric on the topic.

5 Likes