Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Backend Architecture

John Higgins edited this page Jul 15, 2021 · 6 revisions

Overview

The backend of the MathShare application will be fairly simple at its initial stage. It will be a Spring Boot application using a relational database (PostgreSQL) and exposing a REST API for performing actions.

The application will be layered into three tiers: web (Spring REST controllers), Service and domain. The domain logic will be modelled by the domain, the service layer will form an API over it. The domain, instead of exposing multiple getter/setter methods, should only expose the behaviours and state it is willing to share. The web layer will be responsible for exposing a REST API that will interact with the service layer.
Technology Stack

  • Java 10
  • Spring Boot Application - API built using Spring REST MVC
  • Build: Maven (can use Gradle if preferred)
  • ORM: Hibernate - use Spring Data JPA
  • Database versioning: Flyway (can use Liquibase if preferred
  • Spring Boot Admin can be used for easily adding an administrative interface
  • Logback + SLF4j logging
  • A Docker container built for the app using a Dockerfile
  • Sample development environment easy to spin up using Docker Compose

Architecture Diagram

Backend Acrhictecture Overview

Database Schema

Database Schema Diagram

  • Each solution revision and step keeps track of its updated version using the replaced_by field. Solution steps can be marked as deleted, the entire solution cannot be deleted.
  • We can create a new solution revision at each edit, by snapshotting the old version (including all steps). *
  • Alternatively this snapshot can only be created when the user generates the share URL for a solution (we need to know the solution at this point in time)
  • Scratchpads are attached to steps at this point