What's all this, then?

Code organization

Organize your code by creating definitions of how to setup your different components that make up your application. These setup definitions are organized by defining modules which can be reused by different applications in different contexts.

Code reusability

We are not talking about sharing code here, we're talking about setting up the parts that make up your application regardless of what framework you want to use. Think of it as presets which construct your models, services, controllers, views - whatever you need to run your application on whatever platform that runs JS, be that for instance node.js or a browser.

Code modularity

It is possible to publish these modules for others to use in their projects. As long as you register the module within your application object you're good to go:

    // Load a module definition
    var Main = require('./module/Basics');

    // Register the dependencies you want to use for your application. This can be
    // as granular as you need it to be. The definitions from the Main module will now
    // be available as resources by getting them via app.get(...)
    app.registerModules([Main]);

Easy setup

Just require the bogey components and you can use your code base in every context you wish. This thing will work in React, Angular, Ember... you name it. After setup it's just a single object waiting for you to pull your dependencies from.

// Initialize resources... These may be extended as you see fit.
var loader = new Loader();
var container = new Container(loader);
var router = new Router({
    basePath: '/app'
});

var config = {};

// Initialize the application object
var app = new Application(config, container, router);

// Load a module definition
var Main = require('./module/Basics');

// This will be called on bogey.start after the object has been initialized.
// This could very well be part of a custom Application object if you'd want to be so bold.
app.start = function () {
  // Setup routes and stuff.
};

// Register the dependencies you want to use for your application. This can be
// as granular as you need it to be.
app.registerModules([Main]);

// Start the app
bogey.start(app).then(function (app) {
  // After the application has been initialized we get the actual application object which
  // basically is a dependency container.
    app.get('basics.helloworld').then((helloworld) => {
        // This signals the router to start listening for route events. This should only
        // be invoked AFTER you're absolutely ready for action.
        app.router.start();
    });
}).done();

Lean structure

This thing is quite basic and should work reliably for most of its use cases.

What's with the name?

Don't ask.