I'm about to start a white-label server-side application but I don't want to jump in and start coding. This is something I've not had to do before, at least not from scratch and I'm the one in control this time!
I've worked on many application, good and bad but in most I've always noticed the lack of thought that went behind the application from an architectural point of view which comes back and bites us in the end. This isn't a reflection on anyone, most of the time we are bound by the business making the calls. Anyway...
I've decided to go with Railo, Coldbox and AngularJs using mysql. But this is not the point of discussion it's more of an FYI.
What i'm seeking help on is how to go about designing a site so that i'm able to hold core and custom code (I will refer to this as client code). Yes, I have researched this unfortunately there isn't much talk about how to approach this.
What do I mean by this? I want the basic shell of a site where one set of code files can be use by more than one client, for example, modules that will do registration, company details, login, language setting etc. However, with every client there is always requests for customisations so i want the ability to override the core code with use of the client code.
I have good knowledge of Coldbox basics (i.e one codebase one site) but not enough to achieve my goal.
This is the basic structure of a Coldbox App and this is how i would see the client directory structure.
+ApplicationRoot
|---+ config
|---+ framework
|---+ handlers
|---+ plugins
|---+ layouts
|---+ views
|---+ includes
|---+ interceptors
|---+ model
|---+ modules
|---+ Application.cfc
|---+ index.cfm
If the above is the basic structure of one client's application how will it extend to the core code? Bearing in mind i thinking the core code will hold the modules' dao, service, gateway, bean. Where will these live and will the core code have a similar structure in some other folder?
+ApplicationRoot
|---+ Core code
|-----+ framework
|-----+ plugins
|-----+ interceptors
|-----+ views
|-----+ model
|-----+ modules
---+ Client one
|-----+ as per above client directory structure
---+ Client two
|-----+ as per above client directory structure
Thank you for your time in reading this and I hope you can guide me in the right direction.
What you need is a folder for common ColdBox objects, those that will be shared between clients. You can configure these locations in ColdBox.cfc
.
coldbox = {
// .. settings above
//Extension Points
UDFLibraryFile = "includes/helpers/ApplicationHelper.cfm",
coldboxExtensionsLocation = "",
modulesExternalLocation = ["/common/modules/"],
pluginsExternalLocation = "",
viewsExternalLocation = "",
layoutsExternalLocation = "",
handlersExternalLocation = "",
requestContextDecorator = "",
// .. more settings below
};
Your web root might look like this:
- clientA
- skeleton
- clientB
- skeleton
- clientN
- skeleton
- common
- extensions
- handlers
- layouts
- modules
- plugins
- requestContextDecorator
- views
You can override layouts and views with standard ColdBox conventions as well, but won't that be in your AngularJS code?
As for overriding handler actions, it's possible. My company has a custom process for this, but we've not open sourced it yet.
Hope this helps.