This Website

This website was created by me, using:

The frontend is Angular 2, and the backend is a CRUD Rails application to service the app and easily update the website content. Both are hosted on an Amazon EC2 instance (the backend on a different subdomain), so then I could ditch the somewhat expensive GoDaddy file hosting.

trevphil_be

The Rails application is JSON API-only (it does not have templates or HTML) and works with Active Model Serializers and basic token authentication. It was deployed via Capistrano 3 and uses nginx connected to a Puma socket on the server-side, plus PostgreSQL. Probably in the future I'll start using Docker and Kubernetes, especially if the traffic grows a lot.

trevphil_fe

The Angular application relies heavily on flexbox layout, Material Design (which is awesome by the way), and the Angular CLI. Techniques used include:

  • Modular design
  • HTTP interception (to insert auth tokens on API calls)
  • Reactive forms
  • Pipes (specifically, adding CSS classes to the dynamically insert content retrieved from the backend)

Having a backend and a frontend allows me to run my own CMS. I originally maintained the content of posts in HTML using Quill editor, but once I discovered the miracles of markdown, it was an easy switch. These days all of the posts have their content in markdown and are rendered in HTML by Angular.