Architecture

May 27, 2021 ยท View on GitHub

Glossary

There are a lot of potentially unfamiliar terminology used in this document so it might be helpful to briefly explain some of them.

Django: Django is a Python web application framework that uses traditional server-side scripting. The framework follows Model-view-controller (MVC) design pattern.

Docker: Docker is a tool for bundling applications into images that contains all the libraries and resources that the application needs including a preferred Linux distribution. Dockerfile contains the instructions on how to create an image. These images can be used to created instances called containers that can be started, stopped and removed.

Docker Compose: Docker Compose is a tool for making the management of multiple Docker containers easier. The configuration is stored in a docker-compose.yml file.

PostgreSQL: PostgreSQL is a relational database management system.

Environment

The full environment is set up using Docker Compose and consists of two Docker containers:

  • Web contains Django web server (nicknamed WebMark)
  • DB contains PostgreSQL database

Web server

The web server has been nicknamed WebMark. Folder /WebMark contains project settings and /WebCLI contains the actual application. Architecturally the web server consists of three parts: templates, views and models.

  • Templates contain HTML documents with occasional inline Javascript. Django templating language is used to generate some of the HTML using the data provided by view layer.
  • Views contain the logic used to populate the templates with correct data that are fetched using models.
  • Models represent the database schema and are used to execute database operations.

Database

The database uses PostgreSQL and the schema is shown in the following diagram. User table has been automatically created by Django and most of the fields are not used. The relevant fields are username and password.

Database schema