Web Development Basics: Security

In the previous article we discussed how requests through the Internet are protected using HTTPS. This is made possible through the use of TLS Certificates. In this article we will discuss what these certificates are, the different types, and how anyone can use them for their own web application.

TLS certificates

To establish a secure communication between a browser and the server, the first step is to do what is called a TLS handshake. In this process, the public key of the server is used to generate the key that is used for symmetric encryption. This public key is shared using a TLS certificate. read more

Web Development Basics: Transit

In the previous article we discussed how a user sends a request to a server by using URLs in a browser. Now we will explore what happens to that request once it leaves the user’s computer, how it travels through the Internet, and how it is protected.

Internet

Together with advances in transportation, the Internet made the world a much smaller place. As long as there is an Internet connection, your content or product can be accessed and purchased by anyone, anywhere.

Technically, the Internet is a network of networks communicating via TCP/IP. Networks located within a country are then connected to other countries through the use of submarine cables. These cables, laid deep in the ocean, carry Terabytes of information per second. read more

Web Development Basics: User

As software developers making web applications, most of the time we are engrossed in our own code. Designing features, thinking of the best ways to build it, and fixing bugs are what we do most of the time. We often treat our application as a black box, a standalone unit that accepts requests and spits out JSON or HTML. However, this is a shortsighted way of doing web development.

In this series we will explore the realm beyond the application that we are building. We will think of this as the journey of a web request starting from the user’s Web Browser (User), as it traverses through the Internet (Transit), and finally when it reaches the backend (Server). read more

How to deploy your frontend application using AWS Amplify

How to deploy your frontend application using AWS Amplify

In recent years, it became easier and simpler to deploy and publish your application in the internet. Previously, you will need to purchase your own virtual machine, install libraries and then configure to deploy your application. This requires money, time, and expertise if you decide to do it yourself. Today there are lots of free (or cheap) services that will build and deploy your application in a click of a button or a code update. read more

How to run a Rails 6 application using Docker Compose

How to run a Rails 6 application using Docker Compose

In the previous article we learned how to create a Rails 6 Docker image and run it locally. While useful for demonstration purposes, it is not enough for a real-world web application. In addition to our main application code, there are other services that we also need, like a database, a queue system, storage and so on.

Docker Compose provides a way for us to describe how our entire application works using declarative code. Declarative code means that we specify the final state of our application, rather than specifying what steps are needed to create our application. This results in a simpler, more intuitive configuration.

docker-compose.yml

Just like we used a Dockerfile to instruct Docker on how to create our custom image, we use a docker-compose.yml file when using Compose.

First, let’s take a look at a sample Compose file for a Rails 6 application:

version: '3'

services:
app:
build: .
ports:
- 3000:3000
volumes:
- .:/usr/src/app
- gem_cache:/bundler_gems
env_file:
- .env/development
environment:
- WEBPACKER_DEV_SERVER_HOST=webpack_dev_server

db:
image: postgres
env_file:
- .env/development
volumes:
- db_data:/var/lib/postgresql/data

webpack_dev_server:
build: .
command: ./bin/webpack-dev-server
ports:
- 3035:3035
volumes:
- .:/usr/src/app
- gem_cache:/bundler_gems
env_file:
- .env/development
environment:
- WEBPACKER_DEV_SERVER_HOST=0.0.0.0

redis:
image: redis

volumes:
db_data:
gem_cache: read more