/ 3 min read
Full-Stack Web App on AWS for a cabinet of medics
Last Updated:
In spring 2020 my mum told me about difficulties she was having with reaching out to a web developer who was responsible for the website of her business. That developer was using the Joomla CMS and service subscriptions inside Joomla that were not worth paying for. The web dev also wouldn’t update the site’s information anymore. I offered my mum to rewrite the website and migrate it to a tech stack I was familiar with. She agreed and I got my hands onto my first real side project.
The frontend
The project basically consists of a website that introduces her three business locations and their services. There is also a booking component integrated in order to offer clients the possibility to schedule visits online. This component raises the complexity of the project by adding a backend to the website.
The website is a Single Page Application (SPA) written in React. The code is on GitHub which is where the AWS CodePipeline (CI/CD) pulls new releases from. I serve the SPA via a public AWS S3 bucket which functions as a static asset server.
A little nuisance with website hosting in AWS
Unfortunately, there is an unfair scam with website hosting in AWS. With AWS S3 one can only serve a website over HTTP. If HTTPS is needed, an additional service has to be paid for in AWS Cloudfront. AWS Cloudfront is a Content Delivery Network (CDN) that consists of static asset servers (which can serve HTTPS) all over the world. With AWS Cloudfront a website is shared with that network in addition to the original data center the website was deployed to. In my case, without AWS Cloudfront all website calls would only go through the AWS data center in Frankfurt because the website is hosted there.
The further away (physically) a client call is from the data center a website is hosted at, the greater the latency. In my case a website call from Offenbach is faster than one from Kiel, given their respective distances from/to Frankfurt. Here comes a CDN into play, if there was a server within the CDN at, say, halfway between Frankfurt and Kiel, the corresponding latency would have been halved. But there is none, and for this reason AWS Cloudfront is not worth the purchase for the scope of the website. Websites with international traffic do benefit from AWS Cloudfront though. However, all my client calls come from the region where the business is located at. All website calls would only go through Frankfurt one way or another. In other words, in AWS one might be forced to pay for AWS Cloudfront without even using its network just to be able to serve HTTPS.
The backend
Let’s say a client visits the website and wants to book a consultation online. Making a booking technically means that a REST call leaves the browser to a backend that processes that request. The booking processing backend is a Spring Boot application hosted on AWS Elastic Beanstalk (EBS). AWS EBS is a backend service that provides a container runtime with automated scalability. A backend app is hosted in an environment that monitors the traffic and automatically scales the container instances. The environment also comes with a load balancer upfront that routes the traffic to the instances.
Moreover, the backend integrates three additional external systems. The booking data is persisted in AWS Dynamo as well as sent to a Google Calendar which is consulted by the nurses for organisational purposes. Mails for booking confirmations and cancellations are being delivered by integrating the Strato mail server.