PortfolioBlogSnippets
Save PostView Snippet

Summary

How I Made This Blog

Main Content

Pressed For Words...

I've been building custom WordPress solutions for many years. WordPress is a Database-powered CMS written in PHP. It is used by millions of websites to run blogs, communities, online stores, and other web applications. If you ever tried hosting WordPress yourself, you know the difficulties of running on minimal hardware, aka cheap shared hosting. I tried to combine several low traffic sites to run on a single multi-site network using a shared hosting service. Everything worked at first! However, once a handful of requests came in, the server would slow to a crawl and even crash. Options to scale would (at best) double the cost. I needed another solution to host low traffic, dynamic sites on limited resources.


Server-Side JavaScript? Node.js FTW!


JavaScript was my introduction to programming, so I was excited to learn about Node.js. Node.js is not a CMS like WordPress, but an environment for server-side JavaScript to run in lieu of PHP. Being able to use JavaScript for server-side and client-side functionality could improve my development time & code quality. While blogs powered by node.js are not new, I decided to combine more fundamental libraries to reinvent the wheel. While researching npm packages, I stumbled across Loopback, a highly-extensible, open-source Node.js API framework supported by IBM. Loopback saves time when building out RESTful API interfaces. Setting up and managing database models, connections to databases, and API authentication can be done in minutes using Loopback. Since it is powered by express.js, I tried to make a simple blog application, using Loopback as the backbone. You are looking at the result. This is how I made this blog:


  1. Signed up for a digital ocean account (cloud hosting service)
  2. Created an Ubuntu 18.04 droplet (Virtual Private Server)
  3. Established a remote connection via SSH (Secure Socket Shell)
  4. Mapped a domain name to an IP address
  5. Registered a Free SSL Certificate with letsencrypt (Secure Sockets Layer Encryption)
  6. Installed MongoDB (Database)
  7. Installed Nginx (Web Server & Reverse Proxy)
  8. Installed Loopback (Nodejs application)
  9. Created HTML templates using the W3.css style library
  10. Converted HTML to markojs templates to render dynamic data server-side
  11. Configured Nodejs application reboot on startup using PM2


This project is an ongoing experiment. The goal is to build a general use stack for rapid web application development. In future posts, I will dive into more detail about each step. In the meantime, here is a list of helpful resources: