About

This is a very simple 3 tier application written on nodejs, i,e.

———- ————- ———–

frontend <–> backend api <–> database

———- ————- ———–

Info

A live working url is hosted at: https://thisthing.works

img

Everything is pushed to gitlab as:

repo url Remarks
api https://gitlab.com/node-3tier-application/api backend api that talks to db
web https://gitlab.com/node-3tier-application/web frontend app that talks to api
infra https://gitlab.com/node-3tier-application/infra defines all gcp resources as code (IAC: terraform)

Infrastructure resources is defined at infra

img

Deployment:

Instrumentation

img

Technologies Used

items remarks
GKE free (300$ credits) and more mature than EKS
terraform easier to build cluster from code, test it and nuke it later
Makefile easier to prepare and streamline the demo
cloudsql avoid dealing with persistent state onk8s cluster and other HA configuration
gitlab-ci easy and straight forward ci/cd also free for demo
CloudBuild to build the container images
stackdriver log the error on application
Google CDN caching the static resources
prometheus with grafana to instrument/graph metrics
loki just for tryout, its simple straight forward logging solution

Directory Structure

The directory structure application is:

img