How can I better split the code in the _web folder by interface/technology?

Yup there is a way to namespace your logic:

Excerpt:

By default, the LiveView modules will be namespaced by the web module. You can customize the web module namespace by passing the --web flag with a module name, for example:

mix phx.gen.live Accounts User users --web Sales

Which would generate the LiveViews in lib/app_web/live/sales/user_live/, namespaced AppWeb.Sales.UserLive instead of AppWeb.UserLive.


See: Web Namespace


P.S. This kinds of separation is why I asked the following question in the forum, to avoid writing presentation and marketing pages in old school way, can’t we just mark a LiveView as InertView or dead view?!?:

1 Like