Software Architecture of the Electronic Logbook

Faza Aryoga
Electronic Logbook
Published in
5 min readJun 7, 2021
Photo by Kelly Sikkema on Unsplash

When designing any product it is important that we pay attention to foundation; basics of the product such as how it is structured and how it made. This knowledge helps us better manage and run product later. In software development the foundation of the product is its architecture. Much how like how it is with buildings, a software’s architecture represents its quality, a haphazardly designed software architecture will make it hard to build, upgrade, and maintain.

What is Software Architecture?

There is no one definition of software architecture but what it does do, however, is describe its major components, their structure, and how they interact, things that you would consider the important stuff of a software.

There are many ways a software can be designed each with their own intricacies but can generally be grouped into patterns. One such pattern is the layered pattern.

Layered Architectural Pattern

In the layered architectural pattern, the tasks of a program are decomposed into subtasks of which each are handled a different levels of abstraction. Each layer in the program provides services to the one above it. There are commonly 4 layers found in software with layered pattern:

  • Presentation Layer
  • Application Layer
  • Business Logic Layer
  • Data Access Layer

Now each software that uses layered pattern may have different layers but they would generally do the same work. The UI is presented in the presentation layer, inputs and output are handled in the application layer which are then sent to be processed in the business logic layer and then data stored or taken from the data access layer which is mostly in the form of database.

Software Architecture of Electronic Logbook

To provide you an example, I will present the design and architecture of a project I am currently working on. It is called Electronic Logbook, a web based application made for the Faculty of Medicine of University of Indonesia (FKUI), as is common with web apps it was designed with a layered pattern.

It is built with TypeScript, a programming language with similar to JavaScript. It has three layers, the frontend layer, the backend layer, and the database layer.

Frontend Layer

The frontend layer of the application is built with ReactJS framework. It handles the visual parts of the application. The frontend presents the UI with the pages component and all of what the elements in the pages does are handled in the middleware. Any further actions required are first handled in the actions component which are then handed to the APIs component to be sent to the backend layer.

Backend Layer

The backend layer of the application is built with NestJS framework. Before processed by the controllers, requests from the frontend are first handled by the middleware which includes authentication, data validation, etc. The services then interacts with the database and manipulates the data according to the request from the controllers where the will then be sent up the hierarchy and presented to the user. We use PostgreSQL for the database so we don’t need to implement anything for the database.

Finally the layers are then “contained” with Docker separately, which helps during deployment. Though simple, this architecture makes the application easily tested, maintained, and upgraded because the “roles” are separated. Let us touch upon Docker for a bit.

What is Docker?

www.docker.com

Docker is platform as a service product that use OS-level virtualization packages called containers. Containers differ from virtual machines in that they don’t require their own OS in virtualization because each container share the same OS. This makes Docker very lightweight (requiring only MBs not GBs like VMs), more resource efficient, and faster to deploy.

https://geekflare.com/docker-vs-virtual-machine/

Some Docker terms:

1. DockerFile

A docker is a simple text file containing instructions on how to build the Docker container and automates it.

2. Docker images

Docker images contain all the application source code, tools, libraries, and dependencies required to run the container. You can create your own docker image but you can also pull them from common repositories. Multiple Docker images can be created from one base image.

3. Docker containers

Docker containers are live instances of Docker images that users can interact with, and admins can adjust their settings and conditions using docker commands.

4. Docker Hub

Docker Hub is the public repository of Docker images. It contains docker images from commercial software vendors, open-source projects, and individual developers.

5. Docker Daemon

Docker Daemon is a service running on your operating system. This service creates and manages your images using using commands from the client. This acts as the control center for your Docker implementation.

6. Docker registry

Docker registry is a scalable open source storage and distribution for docker images. This allows you to keep track of image versions in repositories, this is accomplished with git.

--

--