The GoQu stack, a rapid SPA development framework

I recently faced the well known (if you have ever been a web developer) framework-dilemma:

To Drupal or not to Drupal, this is the question.

Every time I have a new solo project involving some content management and few spare-development-hours badly distributed over the week, the Drupal card appears.

Why write about Drupal if the article focuses on SPA (Singe Page Applications)? Because for most projects involving the management of few entities, tables and some dynamic report, a Single Page Application could do the job much better, but Drupal could do that as well.
Unfortunately Drupal development costs are hidden in the details (and the Devil’s similitude start to appear!), therefore the evaluation of alternatives is a common pattern. It usually involves many so-called headless CMS:

  • Ghost, Wordpress, etc (not headless and usually not a viable solution for heavy customization)
  • strapi.io and in general the many Headless CMS (open source and dubiously open-source) listed on JamStack https://jamstack.org/headless-cms/

The headless CMS

Would you trust something living without an head?

If the answer is yes, these are interesting instruments. They let the developer focus on the User Interface, delegating the backend logic to a system which usually provides some basic functionality, like:

  • entity definition (aka fields on a database table)
  • CRUD operations over the defined entities
  • users and authorization management
  • some backend UI, for example to manage the entities

From a codebase complexity, headless CMS are indeed quite similar to the full CMS counterparts. A backend has to be deployed and maintained (i.e. it requires updates, security patches, etc) and there are usually modules to accomplish many common tasks (e.g. sending emails, etc.).

Unfortunately to be fully operational they require two different kind of developers: as the entities and their controller logic must be defined via code (requiring a backend engineer) and the frontend is completely missing (so a frontend engineer is needed too).

At the very bottom, an headless CMS is just a web application stack, not forcing the adopter to any user-interface graphical library, but rather forcing the backend technology (and abstracting the DB, usually via some ORM library).

The cons of such technologies are obvious, starting from a very steep learning curve, very difficult to recycle elsewhere, as these frameworks are really unique: for example expect the code written for strapi.io to work only on strapi.io.
CMS are often hacker targets, as vulnerabilities can be exploited easily, headless CMS suffers as well from frequent CVE discovery, as the fully-headed counterparts.
Many (most) headless CMS survive through commercial hosting, usually providing extra features. This implies a short releases life-cycle. Vendors must survive in the jungle of competitors, so new releases means extra work for the adopters, to stay aligned with the supported versions and to keep the minimal security requirements.

If you can develop, do not go headless.

The web application stacks

Man, you are so MEAN!
Look, a LAMP!

Over the years, considering evolution of web development technologies, many software stacks appeared.
Each stack usually focuses on a programming language; for example knowing PHP, the LAMP stack is the most common choice. Since PHP alone is, nowadays, a too low level option, usually it comes flavoured to Laravel, Symfony and many other PHP web frameworks. Drupal for example, if considered API first, is pretty much a LAMP-Symfony stack.

The GoQu stack

The GoQu stack aims to solve all the big problems of a web application development:

  • security
  • maintainability
  • simplicity
  • portability
  • longevity

Seems too much to be real, although consider a “pizza”.
Simple ingredients, when put together on a certain way, provide one of the most satisfying dishes of the world - you’ll never fail with a pizza, and it will hardly kill you even if it is not so good!

The GoQu stack takes three simple ingredients:

the above to address enterprise ready requirements like:

  • an API backend
  • a modular and responsive frontend adhering to the most recent style guidelines
  • a trusted identity server to delegate authentication and authorization (some of the features which do not pay back if DIY, quite the opposite!)

The fusion between Go and Quasar, is a powerful complete instrument which, like in the famous anime Dragon Ball https://en.wikipedia.org/wiki/Dragon_Ball , will help save the world - several times!

MongoDB for rapid data management

To compete with the agility of a CMS, a NOSQL database can be of huge help.

Coming back to our Pizza recipe, the database is the salsa.

You will want a good tomato sauce, or the result will not be excellent, and MongoDB supports schema changes and code adaptability (change on code logic) by design.

Percona Server for MongoDB

Percona https://www.percona.com/software/mongodb/percona-server-for-mongodb provides an open source fork of MongoDB which is a drop-in replacement.
Among the various advantages, it supports a stemming engine which increases the full-text search capabilities of the database.
Without the ngram algorithm https://docs.percona.com/percona-server-for-mongodb/5.0/ngram-full-text-search.html# MongoDB searching features, in my opinion, would be limited when compared to those of a SQL database.

Components stack

The image highlights the main components involved in a GoQu application.
Highlighted in green are the code elements composing the web application; all the other blocks are libraries and dependencies which are not mandatory but which would support a rapid application development.

gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance – up to 40 times faster. If you need smashing performance, get yourself some Gin. ( https://github.com/gin-gonic/gin )

Among the various minimalist web frameworks available, gin is the most adopted and well known, with more than 65k stars on GitHub it assures a strong codebase and a good backward compatibility across all the new releases.

gin-keycloak

Is a small gin middleware which allows easy Oauth2 authentication and claims verification.
Without sharing any secret nor on the backend, nor on the frontend, the server is able to verify the signature of a client API request.

mgm

A simple yet extremely useful library which increases the source code readability and interoperation with a Mongo database.
It relies on the official MongoDB Go drivers, therefore it does not limit any NoSQL adoption.

sentry

One of the support tools to monitor the application use, performances and issues.

VueJS

An approachable, performant and versatile framework for building web user interfaces. ( https://vuejs.org/ )

Wrapped around the Quasar framework, allows rapid web application development.

Quasar

The enterprise-ready cross-platform VueJs framework ( https://quasar.dev/ )

A library of more than 70 high performance customizable Material Design web components.
Extremely well tested and maintained.
Supports easy porting to various browsers and mobile devices.

Oauth2, delegate authentication and authorization to an external identity server

That’s all folks! ..and yes, the images are AI generated.