How this site came about

This incarnation of zump.net is built using Bolt. Why and how did this happen?

This is one of those "notes to myself" pages which I hope may be useful to others.

My job includes looking after a small and increasingly old website. It must be about 9 years since first built; and through steady maintenance and addition of latest technologies, it keeps pace with most competitors and it doesn't look too dated.

All of it is hand-coded with various new bits piled on here and there and with an occasional code review and tidy. Over the years I've added code libraries like phpMailer, jQuery, and a database querying class as I realised various things had already been done countless times so I needn't do them again.

Recently I admitted to myself that I can't much longer put off a proper system of user accounts so that customers will be able to make orders without filling in all their address details every time; and so that we can keep a better track of their interests and show relevant stock. It was obvious by now that this is one of those things which has been done before and I should be able to find such a system and integrate it.

Less immediate obvious was that any such system must be integrated at quite a low level and would affect everything on the site. I would need to rewrite everything. Or find a ready made framework to base the site on — finally I was beginning to understand what this "framework" thing meant.

I found Laravel pretty quickly. It is full featured, well maintained and built on top of many smaller components which are similarly well respected. It's installed using Composer which I'd heard of and now discovered is a system for building PHP applications from blocks of already-written code, automatically working out which parts depend on other parts much like various maintenance systems for Linux operating systems with which I'm already familiar.  With the help of Composer, I delved into Laravel and soon started to hurt my brain with routing and templates. During many sidetracks to check on what something meant, I came upon other similar framework efforts, also available through Composer and using many of the same components.

Laravel turned out to be massively complex and started to remind me of Drupal which I'd never quite understood at a previous job. Although it is never necessary to learn all about something to use the parts one needs, it is much easier to start with something smaller and build up. So instead I turned to Slim framework.

Slim works in just the same way as Laravel but is stripped down to the bare minimum. It still uses routing to channel requests through twig templates, but there are fewer distractions for a beginner.

After a little poking around in Slim, I then found Bolt.

Bolt is a Content Management System which is based on Silex. Silex is another minimalist framework similar to Slim but based on Symfony, a larger framework split into a collection of reusable web application components.

As a CMS, Bolt works very much like Wordpress with a similar admin interface to add and edit content. Content types are set up relatively simply by describing them in a YAML config file from which relevant database tables are created and the display is handled by related Twig template files. One of the main attractions for me is that file uploading and handling is integrated as well as a full-featured rich text editor, CKE. And of course, secure user management … oh yes, that's what I was looking for!

On the way, I also discovered "PHP Components" which seems to be a collection of popular web application parts which can all be installed with Composer. They are also grouped together in the same way on GitHub. This shows there must be a lot of agreement between a lot of major developers about what is important.

The front end is styled using SASS (something else I've long postponed learning about) and based on Foundation, another framework, this time for styling only. It's astounding how many files and sub-applications are involved in this, but it's not quite as complex as Bootstrap and with most of the features as far as I can see. Lots more to learn here about things like nodejs and bower. I have absolutely no idea what the latter is!

The last few paragraphs here have certainly piled on the concepts, components, crazy names and cool acronyms. I should maybe try to expand on some of those and definitely add some links to further details. But for me, the main aim was to outline the journey and document which parts depend on which and why they seem to be a good idea.

« previous – Work Well With Others   —   Photo Test – next »