[ColdBox 3.8.1.00076] Best ColdBox Practices way of creating multiple apps into one app?

[ColdBox 3.8.1.00076]
Best ColdBox Practices way of creating multiple apps into one app?

Example…

What if I wanted to build my app and have a blog, shopping cart, cms, etc.

Would I use a plug in, module or what?

or is there a way to do something like

MainApp

MainApp/BlogApp/

MainApp/ShoppingCartApp/

MainApp/CMSApp/

MainApp/etcApp/

If they login to the MainApp and have access to all of the other apps?

What id the Best ColdBox Practices for this?

Modules!!

I noticed in the version I am using the modules folder is missing… Is that a mistake in the coldbox platform utilities?

Not sure, it might be because it is usually empty it is not being packaged up, Luis or Brad might be able to shed more light on that.

Also to add to the discussion, Modules are the be all and end all, well almost to ColdBox. They can be as simple as adding a feature to a site or even having a complete site inside it. Modules are more common used for creating a plugin architecture that allows for encapsulation on the code and layouts etc. But I have also used Modules, to even make the a sub domain appear like a completely different site, but still able to be accessed from the main site without using the sub domain. Not sure I am explaining that well enough, but lets say your main site has a module that is that much self contained, there is no reason to point the sub domain to that entry point and you can style it and shape it to even look like a completely different site.

Which in your case, if you wanted the fourms / blog / shopping area to even have its own look and feel, then the module can even take care of that, whether used as a sub domain or not.

Andrew pretty much answered the same as I would. Modules are absolutely the way to go here. A module can literally be as simple as a folder with a ModuleConfig.cfc in it, or it can have its own handlers, views, interceptors, etc. All the bits in the module are loaded into the parent app. This makes modules useful for anything from overriding a setting, to sharing bolt-on pieces of code with others, or just breaking apart a monolithic app into bite-sized chunks so your code doesn’t start getting cluttered.

ContentBox CMS is a shining example of that last use in action. It’s a fully-featured blog and CMS and it’s all contained as a collection of modules that can be dropped into any Coldbox app. Since they all run inside the parent app, they can share security, models, interceptors, layouts, etc. A module can also have an entrypoint defined in the ModuleConfig.cfc that is auto-mapped to an SES route. So, create a module called “myBlog” with an entryPoint of “blog” and then just hit:

and you get the default route for your myBlog module. Modules can also be loaded and unloaded at runtime to easily turn features on and off. Watch this webinar on them for a more in-depth explanation.

http://www.coldbox.org/media/cbdw2013#3_1

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Nah, it just wasn’t included in the app template. It’s just a folder, nothing magic about it. Simply create it and you can start dropping modules in it.

Or better yet, use CommandBox to help you install or create modules. Just run this command from the root of your site and you will instantly have a module stubbed out for you. It will create the modules folder for you if it doesn’t exist.

> coldbox create module myModule

Also, installing modules from ForgeBox is a snap with CommandBox (and it will create the folder again as well. This command will install the Coldbox Relax module.

> install relax

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com