Minimalism in Web Development

As I spend more and more time working with bloated frameworks in web development I am starting to miss the minimalism I saw when I got started. I wish websites didn’t need to load megabytes of data to display simple pages. I believe a lot of websites do not benefit at all from frameworks like React, Vue and Angular. Some have told me that these pages just need to be optimized but as far as I can tell this just spreads the loading of files out over time, you will still end up with a site of several megabytes after navigating pages.

How do we define minimalism?

I believe we need less javascript and css for the web. Things can still look great and be done quickly without a bunch of frameworks. I believe this is what we like to call minimalism in web development. Looking at Wikipedia I found a good definition for minimalism and it’s defined like so:

In software and user interface design, minimalism describes the usage of fewer design elements, flat design, fewer options and features, and tendencially less occupied screen space. 

This definition fits well and I believe it’s good to follow this principle. However, I have seen many minimalist user interfaces that look great but take ages to load and use megabytes of data. If we try to use minimalism in web design shouldn’t we also use minimalism when it comes to the underlying code? I found an article called My Minimalist Approach To Software Engineering where the author touches on this topic. Libraries and frameworks can be good but there is a lot we can do in web development without them. In this article and hopefully future articles I would like to explore what we can do with minimalist web development.

In addition to what I have written here there is an article called A Short Guide To Minimal Web Development which I found while researching this topic. I think it outlines a lot of the things for frontend development which I would like to cover but I also want to apply the principle to backend development. Frameworks and libraries have their uses but they are not needed for most web applications.

The idea, however, is that we can only tell what’s really needed once we can tell what’s really important, and why it’s really important.

Jens Oliver Meiert (https://meiert.com/en/blog/minimal-web-development/)

When do we need a backend?

You may need a backend to a web application when you have dynamic content. Now, there is no simple definition for dynamic content. Basically, if you have any form of user authentication or storage shared between users you will need a backend. A lot of things such as blogs, games, live chats and more may have dynamic content but do not need any backend to perform their function if authentication is not needed. Most sites will fall into the first category of authentication but there are some sites out there which need a backend but do not require authentication. These types of sites may exists to provide simple functions like uploading and sharing files or tracking and storing user behaviour.

Many sites like blogs or even news sites will do fine with basic HTML files with no extra code. However, for convenience some people do like to use a backend such as WordPress. WordPress lets you easily create new posts and pages. This does however come with the added cost of complexity and performance. HTML files tend to load quickly and there is very little that can go wrong. Once you add a backend with authentication there may be hundreds of checks that execute on every page load. You also have to maintain a backend, keep it updated and ensure that malicious users don’t gain access to it.

When making a new site you should always begin by asking if you really need a backend.

When is a backend framework needed?

A backend framework is never really needed. But a framework can help speed things up and provide a ready made structure. It’s similar to building a house, you build everything from scratch or use prefabricated houses where all the pieces are already made.

A framework therefore helps standardise things so that it is easier for multiple developers to work on the same project. However, there should always be some consideration as to if a framework is really needed. If you’re building a landing page you don’t need frameworks. You could probably use a simple PHP file for this instead of a full framework like Laravel. Using a framework will add overhead and complexity to the application, especially if it’s small. In the end you are trading development speed for flexibility, stability, performance and security.

When is a frontend framework needed?

Frontend frameworks like React, Angular and Vue have become very popular in the last years. I think these frameworks are needed even less than backend frameworks. Most websites do not need any javascript at all to provide their core functionality. The backend can generate html pages with any needed data and this can be styled with a bit of css.

One argument I have heard is that these frameworks allow you to load a page once and then only make requests for the data that you need. This is referred to as a single page application and I can see how it provides benefits for large applications with lots of data. However, most websites do not load large sets of data in this way and can provide pages that are small in size and load quickly. Many single page applications load so many different libraries that they often reach over a megabyte in size which is huge.

You end up trading a slow initial load for many smaller pages that load quickly. It’s also tends to become impossible to keep track of all the libraries that these frontend applications use. There have been several recent incidents where a small package had a bug or security issue which affected millions of applications. Frontend frameworks should be avoided unless they provide substantial benefits. Frontend frameworks might allow you to get something produced more quickly but once again you trade development speed for flexibility, stability, performance and security.

Conclusion

As I gain more and more experience in web development I am starting to miss the simplicity and speed of the old days. I think we need to find a way back to the simple application. I am personally starting to simplify the websites I run.

As I write this I am using WordPress to manage my posts. However, I am working on a new backend called Beubo. With Beubo I want to simplify the backend to something very basic and rethink how the backend should work. I want to write guides that teach minimalism in web development from the very start. Too many web developers start with frameworks and never learn the simplicity of vanilla CSS, JS and HTML.

I think there is more and more push for simplicity and minimalism in web development. This is as companies become more and more liable for the security of their applications. For a long time there were no real consequences of running insecure web applications. Focus has shifted towards development speed. However, with the rise of GDPR and similar laws we will see more companies looking to simplify. To reduce the amount of libraries and frameworks that are used in order to keep applications more secure and stable.

I would love to hear what you guys think about minimalism in web development. Please leave your comment below.

How Switching Domain Registrars Saved Me $300+/Year

When registering a domain it’s typically easy to find domain registrars with good deals, perhaps just $1 to get any domain name you want. That’s a trick to reel you in in the hopes that you will keep that domain for many years without switching registrar. The renewal fees and any additional offerings such as hosting and email is where most domain registrars earn the most money. Today, however, I want to simply take a look at renewal fees and how much extra we spend on renewals. If you are a company or someone like me with 100+ domains these renewal fees can get very expensive. Here I will show how much you can actually save on renewal fees by switching domain registrars and how I went about figuring this out.

Continue reading “How Switching Domain Registrars Saved Me $300+/Year”

Customer Feedback via SMS using Go and Slack

Using an SMS Gateway called 46elks and some Go we can automate a customer feedback process which is usually done manually by calling a customer. This was an idea I had when I worked at a large sales company in Sweden a few years ago and my task was to find things that could be automated to save money and speed things up. To keep track of feedback and manually handle negative comments I also piped the messages to Slack which we will be doing in this guide as a bonus at the end. The following is a how to guide describing how you can create this yourself. You can find the full source code on Github.

SMS Gateway

The first thing we need to is find a SMS Gateway for sending our text messages to our customers. I met 46elks at HackForSweden this year and it seems to perform really well when I used them for this guide. However, you could go with any SMS Gateway and some of the more popular options are Twilio, Amazon or ClockworkSMS. Most gateways will provide similar APIs so it shouldn’t be too hard to replace my 46elks implementation with another provider.

Sending texts and receiving customer feedback

Continue reading “Customer Feedback via SMS using Go and Slack”

How To Run A Go Web Server On AWS

Amazon Web Services (AWS) offers free tier web servers where you can run simple go programs for API backends or websites. In this guide we will make a simple web server using a go program. This guide can also be used as a reference to set up AWS instances for larger go services.

To begin you will need to set up a new instance on AWS. To do this simply login to your AWS account and click on Services at the top of the screen and then on EC2. EC2 should be the first option under the Compute category.

Click on Instances on the left hand side and then in the top left there should be a large button called Launch Instance which will start a creation wizard. I typically search for Ubuntu and pick 18.04 as shown in the screenshot below.

Continue reading “How To Run A Go Web Server On AWS”

How to use Pi-hole to block all ads on your local network

Recently I decided to set up a Pi-hole installation on my local network. Initially I was going to use a Raspberry Pi 3 B+ but the company I work for was replacing all the PCs and I was able to get my hands on one of them.

Pi-hole is a simple tool which can be configured to handle the DNS of all the devices on a network. It can be installed on a linux environment and is also available as a docker image. Basically it will check any DNS queries against various blacklists and block queries that match ad networks or tracking domains. The end result is that you get a browsing experience without advertisements and user tracking. Pi-hole is configurable and you can whitelist domains or even devices on the network if you would like. The admin interface shown in the image of this post shows the dashboard which gives a nice overview of queries that go through Pi-hole.

Continue reading “How to use Pi-hole to block all ads on your local network”

How to Install Go 1.12 on Ubuntu 18

This guide is also available as a video from Youtube.

Begin by running the following command to add the golang backports ppa:

sudo add-apt-repository ppa:longsleep/golang-backports

If you get an error such as “add-apt-repository command not found” then you need to run the following command to install add-apt-repository:

Continue reading “How to Install Go 1.12 on Ubuntu 18”

Create a Public Slack Community with Go

I recently stumbled across a tweet by Melvin Davis on Twitter where he mentioned a simple tool that he had created using Go that instantly sends a Slack invite when an email is entered. This allows us to make a public slack community that anyone can join.

Check-out the auto invite sender to join #slack written in #Golang https://t.co/fwcurIsZ3w This tool is extremely helpful when you maintain an community slack channel— Melvin Davis (@melvinodsa) January 2, 2019

Continue reading “Create a Public Slack Community with Go”

Developing Slack Bots with Go: Part 1

In my previous post I wrote a guide on how to post a simple Slack message using a bot with PHP. Now we will do the same thing but instead with Go. I have also decided to send a json request instead of a form-url encoded request like we did with PHP. There are some differences, let’s take a look.

Continue reading “Developing Slack Bots with Go: Part 1”

Developing Slack Bots with PHP: Part 1

I have done a lot of work with slack bots in the past both professionally and in my spare time. In the past I build a plugin for WHMCS called WHMCS Slack which was originally a paid addon but is now open source and available for free on Github. This post is a first part in a series of posts i would like to write about both Go and PHP and how we can use these programming languages to create useful bots for Slack.

Continue reading “Developing Slack Bots with PHP: Part 1”

Add a custom bot integration to Slack

It’s possible to create bots for your Slack channels and workspaces via custom integrations. First you will need to create a bot for your Slack workspace. To do this you need permissions to add a custom configuration. Simply go to your workspace url and add admin at the end as shown in the picture

Continue reading “Add a custom bot integration to Slack”