Hi,
Despite the different discussion related to that same subject:
(Concept of "area" in Phoenix project structure - #4 by thiagomajesk)
(Domain-oriented web folder structure - #2 by tme_317)
I would like to ask again but in a tad different way.
My goal is to have a under lib/mini_spa
a module MiniSPA
that encapsulate mostly everything a view under a single root have.
MiniSPA is basically a live view that have hooks and components and live components on top of small logic bits.
My end game would be:
- if one need to reproduce the view from a project to another they can just copy paste the module folder and only make the minimum modification in
MyAppWeb/router
to get it working.
This means, indeed, that the interaction between MiniSPA and the rest of the project is small and obvious.
When I naively did move it out, the view was not working properly (surprise).
My understanding the that the module MyAppWeb.ex
is essential for a view to work (the use ThePortalWeb, :live_view
in the live modules)
As well as where the file is actually located the location of the module for that what parent module the view belongs to.
(just moving back Mini.SPA
from mini_SPA/
back under MyAppWeb/live
fixed many things)
I understand why Phoenix default to the current organization of modules (if you cannot assume anything of the app intra coupling then you default to the most agnostic one) but in my case there is clear separation between views.
So far I banged my head against the wall (and my AI’ s head too) with little result.
Without going into details can one of you tell me what module/part of the project make assumption about the repo structure? So I know at least where actually look into and where not to look into to understand and change stuff.
You are welcome to tell how much of a bad idea it is too, if you feel like to.
thanks