mongular/mongular

Mongular Content Delivery System


Keywords
mongodb, Content management system, angularjs, Content Delivery System
License
GPL-3.0+

Documentation

I have abandoned writing this project in PHP and the back end is now written in Go.

Mongular = AngularJs + MongoDB + PHP


What is Mongular

Mongular is a Content Delivery System (Framework?... not really) built to take advantage of all the tools available to speed up the delivery of your content to users, and reduce server load.

Content Delivery System?

Mongular wasn't built to be a Content Management System, even though with enough development it could probably be built to do just that.

Mongular was built to deliver content in an easy, efficient and extendable manner. Where developers take it, is up to them.

How does Mongular make things faster?

  • Your code no longer produces html or uses any sort of templating engine. AngularJS is your template engine, and html is your template.

  • All html assets are cacheable or can be distributed from a CDN or Varnish.

  • Paths for page content are directly addressable to be cacheable using tools such as Varnish.

  • You only bootstrap the tools necessary to produce the content you need.

  • Every page element loads independently, so elements that are more logic intensive will not impact the overall load times.

  • Mongular utilizes MongoDb for what it is best at, reads and arbitrary data storage.

  • Absolutely !!NO!! PHP is executed by your customers, only by AngularJs.

  • Sessions are only established when the user does something that demands it.

  • Every transaction is a microtransaction that is the sum of what is basically required to deliver that small piece of content.

How does it work?

Ever page request is passed to one static index.html. <--Yeah thats cacheable too.

AngularJS will take the information provided from request to bootstrap a page.

It will then recursively build the entire page from the top down. based on the responses from the Mongular API.

That is the AngularJs aspect of the process.

The Mongular API is designed to provide just enough functionality to fulfill requests from AngularJs.

The Mongular API is quite simple but fast.

The Mongular API

The Mongular API only performs three actions before returning a payload to Angular.

  1. PreProcesses

  2. Processing (invoke the 'controller')

  3. PostProcesses

That is it. It is pretty simple.

What it offers

  • Multidomain support - Host many sites and domains from one codebase.

  • Multidomain configuration - Have one default configuration then override specific or all values by domain.

  • Wildcard routing - Create a path that will match anything after its base path, the rest of the path becomes query parameters. All urls are clean.

  • Memcache built in - Store values and entire objects according to domain. (all values are domain specific)

  • Automatic dependency injection - define your dependencies from constructor parameters and recursively load your object. (classes only!)

  • Dynamic loading - dynamically load page elements from user interface or from API responses.

  • Forms - Handled through AngularJs Formly and the Form class in Mongular.

  • Growl style messaging. (will move away from growl eventually)

  • Redirects and Reloads - from API requests.

  • Bootstrap (I am not a front end guy but I heard it is the plat du jour,so it is in there.)

  • Speed

I probably missed some things here.

Philosophy

The philosophy behind Mongular is pretty simple, low server load, and K.I.S.S. (not a band reference).

I am a pretty adept Drupal developer and mediocre server admin, but at some point I realized that all this abstraction and best programming practices and robustness, etc, etc was seriously impeding server load times, and server load in general.

BUT all the above make for great application development.

I enjoy Drupal as a platform. A lot of frameworks are great at application development as well. A lot of them (including Drupal) can be slow at content delivery.

Mongular is not robust

Mongular is content delivery system and that is it. Its only intended pupose is to deliver content to the page.

How can you use Mongular?

  • Mongular can be a front end to your CMS.

  • Mongular can be a front end to your API.

  • If you are just delivering content (blogs, etc) Mongular can just do all of that for you, out of the box.

  • Or any combition of the above. Since every request is independent of all other requests, you can have mutually independent content coming from different sources, easily under the same code base.

Composer

Mongular is heavily reliant on composer and it is how your project should be installed. There is also an expectation of all controllers and processors to also be available through composer.

Problems

  • The core system needs code cleanup, unit tests and documentation.

  • I have not come up with a good way to handle templates with Composer.