This is the current controllers structure in OFN:
If you ignore history, it’s a total mess! If you know that half of the things were stuck in Spree for a long time, it makes sense that this is where we ended up.
But now that we are independent of Spree, there are quite a few things we can improve here
I think we can target a very simple strucuture:
- keep the API side of things as is
- ApplicationController - code shared between frontoffice controllers and backoffice controllers
- BaseController - code for FrontOffice controllers
- Admin::BaseController - code for BackOffice controllers
The steps to get there could be:
- rename Spree::Admin::BaseController to Admin::BaseController
- merge Spree::BaseController with ApplicationController and make sure that doesn’t break the frontoffice controllers that inherit from BaseController
- make Controllers under StoreController inherit from BaseController instead and remove StoreController
- there are quite a few methods in ApplicationController that can be moved to BaseController because they are frontoffice specific…
Would be good to get feedback about this.