Choosing a stack

Lacuna • July 17, 2022

I'm not a fan of these so-called game "engines"; the term is, I feel, misused too often doesn't really reflect the nature of the product. So, I'll start with a language, add a framework for speed and efficiency, then add the remainder of the code components.

PHP

Everybody loves PHP, but let's make sure we use an up-to-date version. As of writing, this is PHP 8.1 and since I have PHP 8.1.7 installed on my development box, this is an ideal starting point. I don't know as yet what mods will be needed, but a plain install of 8.1 should be sufficient for now.

The Framework

I considered a number of options here, but Laravel seems to be the best choice as it comes with a lot of features out of the box that are going to save a lot of time. Yes I probably could have written my own, using any number of Symfony components, but that would have probably ended up very similar to a Laravel framework without the bells and whistles, so I'll just settle for Laravel and save a lot of unnecessary work for myself.

CSS

There's a number of different CSS frameworks these days, some people like the batteries included approach, while I've grown rather fond of Tailwind, which allows for rapid prototyping and equally allows me to create simple reusable components with all the relevant classes defined properly in CSS leaving the HTML nice and clean.

Better yet, by adding in support for SASS, we can make the CSS a little more friendly with a hierarchical flow.

Fonts

Normally, I'd use Google Fonts to provide these, but being privacy conscious, I'm going to host some fonts locally which ensures Google doesn't perform any tracking. Overkill? perhaps, but I know a lot of people who are not keen on Google watching everything they do.

JavaScript

As for JavaScript, this caused me some problems. These days I think I like pretty much vanilla JS, so I'm going to use Alpine.js as it provides a very lightweight system and will hopefully help reduce the complexity when writing components, since I've no doubt there will be a lot of replication in the code.

Databases

MySQL will be ideal as it's well proven, well-rounded, and most people are fairly comfortable with it.

I'm also going to add Redis for caching and later on: session storage.

Node

For the build process, I'm going to need Node.js. I have v16.14.0 installed on my development box and of course you will need Node's package manager: npm. Again I have this installed; version 8.3.1; on my box.

Wrapping up

Finally, I'll be using Docker for development to encapsulate everything into nice clean containers and to make the whole system portable between developers. Production-wise, I'll be using native services rather than Docker at least until the natives cause a problem!