About arc42

arc42, the template for documentation of software and system architecture.

Template Version 8.2 EN. (based upon AsciiDoc version), January 2023

Created, maintained and © by Dr. Peter Hruschka, Dr. Gernot Starke and contributors. See https://arc42.org.


Note

This version of the template contains some help and explanations. It is used for familiarization with arc42 and the understanding of the concepts. For documentation of your own system you use better the plain version.

1. Introduction and Goals

Describes the relevant requirements and the driving forces that software architects and development team must consider.

1.1. Requirements Overview

YOVI is a gaming suite developed for Micrati based on "Game Y". The system allows users to play hexagonal board games against the computer and provides an interface for external bots.

Key functional requirements include:

  • Core Gameplay: Implementation of classic Game Y with variable board sizes.

  • AI Strategies: Support for multiple machine strategies and selectable difficulty levels.

  • User Management: Registration and match history tracking (win/loss stats).

  • External Access: A fully documented API for bot interaction using YEN notation.

  • Public Availability: The system must be deployed and accessible via the web.

1.2. Quality Goals

Contents

The top three (max five) quality goals for the architecture whose fulfillment is of highest importance to the major stakeholders. We really mean quality goals for the architecture. Don’t confuse them with project goals. They are not necessarily identical.

Consider this overview of potential topics (based upon the ISO 25010 standard):

Categories of Quality Requirements
Motivation

You should know the quality goals of your most important stakeholders, since they will influence fundamental architectural decisions. Make sure to be very concrete about these qualities, avoid buzzwords. If you as an architect do not know how the quality of your work will be judged…​

Form

A table with quality goals and concrete scenarios, ordered by priorities

The following table presents the top five quality goals for the YOVI architecture, ordered by priority. These goals have been identified based on stakeholder expectations and the ISO 25010 quality model. They represent the most critical quality attributes that will guide architectural decisions throughout the project and serve as the primary criteria for evaluating the success of the system.

Priority Quality Goal Concrete Scenario

1

Performance Efficiency

The Rust engine must respond to move validation and AI suggestions in under 200ms, ensuring a smooth gameplay experience even during peak usage.

2

Compatibility (Interoperability)

The system must allow external bots to connect via a well-documented JSON API (YEN notation), enabling third-party developers to create their own game clients.

3

Functional Suitability

The Rust engine must accurately implement all "Game Y" rules, and the web frontend must cover all user stories including registration, gameplay, and statistics.

4

Maintainability

The architecture must keep Rust logic independent from the TypeScript layer, with clear ADRs and >80% code coverage, allowing evaluators and future developers to understand and modify the system.

5

Transferability

The complete system must be deployable with a single Docker command, ensuring evaluators can easily install and test the application on any modern environment.

1.3. Stakeholders

Contents

Explicit overview of stakeholders of the system, i.e. all person, roles or organizations that

  • should know the architecture

  • have to be convinced of the architecture

  • have to work with the architecture or with code

  • need the documentation of the architecture for their work

  • have to come up with decisions about the system or its development

Motivation

You should know all parties involved in development of the system or affected by the system. Otherwise, you may get nasty surprises later in the development process. These stakeholders determine the extent and the level of detail of your work and its results.

Form

Table with role names, person names, and their expectations with respect to the architecture and its documentation.

This section provides an explicit overview of the stakeholders of the system. Stakeholders include all persons, roles, or organizations that should know the architecture, need to be convinced of it, have to work with the architecture or codebase, require the documentation for their work, or are involved in making decisions about the system and its development. We have identified the following stakeholders related to our project:

Category Stakeholder Impact Influence Key Interests & Expectations

1. Primary Owners

Micrati

Critical

High

Successful delivery of the YOVI suite based on "Game Y".

2. End Users

Human Players

High

Medium

Smooth UX, web-based matches, and accurate statistics.

Bot Developers

Medium

Medium

Robust external API and clear technical documentation.

3. Technical Team

Project Team

Critical

High

Proper implementation of TypeScript and Rust subsystems.

Architects

High

High

Structural integrity, ADR maintenance, and quality attributes.

DevOps/SysAdmin

Medium

Medium

Seamless CI/CD, deployment, and system monitoring.

4. External

Competing Teams

Low

Low

Interoperability and compatibility for optional matches.

5. Academic

Evaluators

Critical

High

Test coverage, documentation quality, and project management.

2. Architecture Constraints

Requirements that constrain the freedom of design and implementation.

Constraint Description

Programming Languages

The Web application must be implemented in TypeScript; the logic/strategy module must be in Rust.

Data Exchange

Communication must use JSON messages following the YEN notation standard.

Interface Architecture

The Rust module must be exposed as a basic web service interface (stateless).

Project Management

Mandatory use of GitHub Issues for task tracking and ADRs for documenting architectural decisions.

Infrastructure

The system must be deployed to a public cloud provider using automated CI/CD.

3. Context and Scope

Business Context
Neighbor Description

User

Human player who interacts with the YOVI web application. They can play matches of "Game Y", register in the system, and consult their win/loss statistics and rankings.

Bot / External API

External automated systems that interact with the application through a documented API. They can manage user data and play matches by sending board states in YEN notation.

Rust Module

External module that provides a web service interface. It is responsible for verifying match victories and suggesting the next move using JSON messages.

Database

Persistence system used to store user registration information, match history, and performance metrics.

3.1. Technical Context

Interface Channel Description / Format

User Interface

Web Browser

Allows human players to interact with the game, register, and view statistics.

Bot / External API

External API

Allows automated systems to manage data and play matches using JSON (YEN Notation).

Game Logic Service

Web Service

Internal communication with the Rust Module to verify match victories and request move suggestions using JSON (YEN Notation).

Persistence Layer

Database Connection

System used to store user registration information, match history, and performance metrics.

Technical Details YEN Notation: All game-related data exchange (size, turn, players, and layout) must strictly follow the JSON-based YEN notation.

Coordinate Systems: The system handles the coordinates using both barycentric coordinates (x, y, z) and linear indices.

Deployment: The application is designed to be deployed (through Docker) and publicly accessible via the Web.

4. Solution Strategy

Contents

A short summary and explanation of the fundamental decisions and solution strategies.

4.1. Strategic Decisions

Goal / Problem Decision Rationale

Database Technology

SQL (PostgreSQL)

A relational database ensures data integrity for users and matches. PostgreSQL offers flexibility and robustness for long-term storage.

Backend Architecture

Component-based & Layered

Organized into independent components with layers (entry-points, domain, data-access) to ensure maintainability and separation of concerns.

Game Logic Engine

Rust

High-performance engine to handle Game Y logic. It allows the implementation of complex AI strategies without sacrificing response time.

Frontend Technology

Web Application (React)

The user interface is developed as a web application. The team prioritized Quality of Life (QoL) features such as Hints and Undo button, while discarding complex media features like video chat.

AI Levels

Selectable Difficulty

The system provides multiple difficulty levels. This satisfies the requirement of having more than one machine strategy (e.g., Random vs. Minimax).

User Interaction

Text-based Chat

A lightweight text chat is implemented to enhance social interaction between players without the technical overhead of video/audio streaming.

Security

Hashing & Env Variables

Encryption for passwords and environment variables for secrets to follow security best practices.

Ranking System

Winrate Metric

Focuses on the win/loss ratio to provide a simple but competitive ranking for the leaderboard.

4.2. Organizational & Development Strategy

Decisions regarding team coordination and workflow to ensure project quality:

  • Task Distribution: Work is divided into fixed sub-groups of 2-3 people (Frontend, Backend, Rust/Docs) to ensure code reviews and knowledge sharing.

  • GitHub Workflow:

    • Pull Requests are reviewed by the sub-group (Frontend/Backend) NOT related to the topic itself, ensuring shared understanding of project upgrades among team members.

  • Documentation: Developed collaboratively and consolidated in specific sessions.

5. Building Block View

The building block view shows the static decomposition of the system into building blocks (modules, components, subsystems, classes, interfaces, etc.) as well as their dependencies. In analogy to a house, this is the floor plan.

5.1. Whitebox Overall System

YOVI Level 1 Overview Diagram
Motivation

The YOVI system follows the Separation of Concerns principle. It uses a modern React frontend for user interaction, a Node.js microservice for user data management, and a high-performance Rust engine for game logic. This hybrid architecture ensures scalability and runtime efficiency.

Contained Building Blocks
Name Responsibility

Webapp

React-based frontend. Visualizes the game board, manages user registration, and provides a REST API for bot interactions.

Users Service

Node.js backend managing user profiles, authentication, and game history metrics.

Gamey Engine

Rust-based engine that validates Game Y rules, checks win conditions, and generates AI moves.

PostgreSQL

Relational database for persistent storage of user profiles and match statistics.

Important Interfaces
  • YEN Notation: Standard JSON format carrying board states between the Webapp and Gamey Engine.

  • REST API (Internal): Endpoints enabling communication between the Webapp and Users Service.

5.1.1. Webapp (Black Box)

Purpose/Responsibility

Providing the user interface and system access for human players and external bots.

Interface(s)

Web GUI (HTML/CSS/TS), External Bot REST API (JSON).

Directory/File Location

/webapp

Fulfilled Requirements

Web frontend, Bot interaction API, User registration.

5.1.2. Users Service (Black Box)

Purpose/Responsibility

Managing user information and game metrics through database communication.

Interface(s)

Internal REST API (Node.js/Express over Port 3000).

Directory/File Location

/users

Fulfilled Requirements

Registration system, Match history, Win/Loss statistics.

5.1.3. Gamey Engine (Black Box)

Purpose/Responsibility

Execution of Game Y rules and providing AI strategies at multiple difficulty levels.

Interface(s)

YEN Service Interface (JSON/HTTP over Port 4000).

Quality Characteristics

High calculation speed (Rust), Memory safety, and high concurrency.

Directory/File Location

/gamey

Fulfilled Requirements

Rule validation, Next move suggestions, Multiple AI strategies.


5.2. 5.2 Level 2

5.2.1. 5.2.1 White Box Gamey Engine

Since the Gamey Engine handles the core logic of Game Y, its internal structure is detailed to show the decoupling of rules and strategies.

Gamey Engine White Box Diagram

Contained Building Blocks (Black Boxes):

Name Responsibility

Web Interface

The REST controller that receives YEN-encoded requests from the Webapp.

Core Logic

The engine’s core that validates Game Y rules and determines game outcomes.

Strategy Registry

Manages various AI difficulty levels and provides next-move suggestions.

YEN Parser

Translates between JSON-based YEN notation and internal Rust data structures.

5.2.2. 5.2.2 White Box Webapp

The Webapp is the primary interface for users. Its internal architecture separates visual components from communication logic.

Webapp White Box Diagram

Contained Building Blocks (Black Boxes):

Name Responsibility

UI Components

React views including the Game Board, Register Form, and Statistics dashboard.

State Management

Centralized client-side store maintaining the current game state and user session.

API Client

Orchestrates asynchronous HTTP communication with Users Service and Gamey Engine.

Important Interfaces
  • External Bot API: A direct endpoint in the API Client that allows bot actors to interact with the system without using the GUI.

  • Service Connectors: Outbound connections from the API Client to external microservices (Users/Gamey).

6. Runtime View

6.1. Full game

This diagram represents a full game, from when the user logs to when the user ends the game

Playing the game

6.2. Asking for a hint

This diagram represents the user asking for a hint

Asking for Hint

7. Deployment View

Content

The deployment view describes:

  1. technical infrastructure used to execute your system, with infrastructure elements like geographical locations, environments, computers, processors, channels and net topologies as well as other infrastructure elements and

  2. mapping of (software) building blocks to that infrastructure elements.

Often systems are executed in different environments, e.g. development environment, test environment, production environment. In such cases you should document all relevant environments.

Especially document a deployment view if your software is executed as distributed system with more than one computer, processor, server or container or when you design and construct your own hardware processors and chips.

From a software perspective it is sufficient to capture only those elements of an infrastructure that are needed to show a deployment of your building blocks. Hardware architects can go beyond that and describe an infrastructure to any level of detail they need to capture.

Motivation

Software does not run without hardware. This underlying infrastructure can and will influence a system and/or some cross-cutting concepts. Therefore, there is a need to know the infrastructure.

Form

Maybe a highest level deployment diagram is already contained in section 3.2. as technical context with your own infrastructure as ONE black box. In this section one can zoom into this black box using additional deployment diagrams:

  • UML offers deployment diagrams to express that view. Use it, probably with nested diagrams, when your infrastructure is more complex.

  • When your (hardware) stakeholders prefer other kinds of diagrams rather than a deployment diagram, let them use any kind that is able to show nodes and channels of the infrastructure.

Further Information

See Deployment View in the arc42 documentation.

7.1. Infrastructure Level 1

Describe (usually in a combination of diagrams, tables, and text):

  • distribution of a system to multiple locations, environments, computers, processors, .., as well as physical connections between them

  • important justifications or motivations for this deployment structure

  • quality and/or performance features of this infrastructure

  • mapping of software artifacts to elements of this infrastructure

For multiple environments or alternative deployments please copy and adapt this section of arc42 for all relevant environments.

Infrastructure Level 1 Overview
Motivation

The system is designed as a distributed web application. A central server hosts all the application logic and data (backend, game engine, database), while users access the game via standard web browsers. This centralized structure ensures data consistency and simplifies updates.

Quality and/or Performance Features
  • Scalability: The server uses Docker, allowing easy scaling of resources if the number of players increases.

  • Accessibility: Users do not need to install any specific software; a web browser is sufficient.

  • Availability: The server is accessible 24/7 via the internet.

Mapping of Building Blocks to Infrastructure
  • Client Device: Runs the Frontend Application (React) inside the browser.

  • External Bot Device: Runs custom bot scripts developed by third parties.

  • YOVI Server: Runs the Backend (Users Service), Game Engine (Rust), and Database.

7.2. Infrastructure Level 2

Here you can include the internal structure of (some) infrastructure elements from level 1.

Please copy the structure from level 1 for each selected element.

7.2.1. Docker Host (Server)

Docker Host Detail

This diagram illustrates the internal structure of the Server. The entire system is containerized using Docker, which ensures consistency across development and production environments.

  • Docker Host: The physical or virtual server running the Docker Engine.

  • WebApp Container: Hosts the React frontend application. It acts as the entry point for users and external bots. It forwards API requests to the backend services.

  • Users Service Container: A Node.js/Express application that handles user authentication and history management. It is not directly accessible from the outside; it only accepts requests from the WebApp.

  • GameY Service Container: The core game engine written in Rust. It processes game logic and validates moves. Like the Users Service, it is internal and accessed via the WebApp.

  • Database Container: A PostgreSQL instance used for persistent storage of user data and game history. It is strictly isolated and only accessible by the Users Service via TCP port 5432.

7.2.2. Client Device

User Device Detail

This diagram illustrates the client-side deployment.

  • Client Device: Represents the physical hardware (PC or Mobile) used by the player.

  • Web Browser: The execution environment (e.g., Chrome, Firefox) that renders the application.

  • YOVI Web Client: The React/TypeScript application artifact downloaded from the server and executed within the browser.

7.2.3. External Bot Device

External Bot Device Detail

This diagram illustrates the deployment of an external bot that interacts with the YOVI system. Unlike human players, bots do not use a web browser; instead, they run as standalone scripts or applications.

  • External Bot Device: Represents any machine (local computer or server) hosting a third-party bot.

  • Bot Runtime: The environment required to execute the bot logic (e.g., Python Interpreter, Java Virtual Machine, or Node.js Runtime).

  • Bot Application: The actual code developed by third parties (or the development team for testing). It communicates with the YOVI System exclusively via the HTTP/REST API (JSON) provided by the Web Application.

8. Cross-cutting Concepts

Content

This section describes overall, principal regulations and solution ideas that are relevant in multiple parts (= cross-cutting) of your system. Such concepts are often related to multiple building blocks. They can include many different topics, such as

  • models, especially domain models

  • architecture or design patterns

  • rules for using specific technology

  • principal, often technical decisions of an overarching (= cross-cutting) nature

  • implementation rules

Motivation

Concepts form the basis for conceptual integrity (consistency, homogeneity) of the architecture. Thus, they are an important contribution to achieve inner qualities of your system.

Some of these concepts cannot be assigned to individual building blocks, e.g. security or safety.

Form

The form can be varied:

  • concept papers with any kind of structure

  • cross-cutting model excerpts or scenarios using notations of the architecture views

  • sample implementations, especially for technical concepts

  • reference to typical usage of standard frameworks (e.g. using Hibernate for object/relational mapping)

Structure

A potential (but not mandatory) structure for this section could be:

  • Domain concepts

  • User Experience concepts (UX)

  • Safety and security concepts

  • Architecture and design patterns

  • "Under-the-hood"

  • development concepts

  • operational concepts

Note: it might be difficult to assign individual concepts to one specific topic on this list.

Possible topics for crosscutting concepts
Further Information

See Concepts in the arc42 documentation.

8.1. <Concept 1>

<explanation>

8.2. <Concept 2>

<explanation>

…​

8.3. <Concept n>

<explanation>

9. Architecture Decisions

Contents

Important, expensive, large scale or risky architecture decisions including rationales. With "decisions" we mean selecting one alternative based on given criteria.

Please use your judgement to decide whether an architectural decision should be documented here in this central section or whether you better document it locally (e.g. within the white box template of one building block).

Avoid redundancy. Refer to section 4, where you already captured the most important decisions of your architecture.

Motivation

Stakeholders of your system should be able to comprehend and retrace your decisions.

Form

Various options:

  • ADR (Documenting Architecture Decisions) for every important decision

  • List or table, ordered by importance and consequences or:

  • more detailed in form of separate sections per decision

Further Information

See Architecture Decisions in the arc42 documentation. There you will find links and examples about ADR.

10. Quality Requirements

Content

This section contains all quality requirements as quality tree with scenarios. The most important ones have already been described in section 1.2. (quality goals)

Here you can also capture quality requirements with lesser priority, which will not create high risks when they are not fully achieved.

Motivation

Since quality requirements will have a lot of influence on architectural decisions you should know for every stakeholder what is really important to them, concrete and measurable.

Further Information

See Quality Requirements in the arc42 documentation.

10.1. Quality Tree

Content

The quality tree (as defined in ATAM – Architecture Tradeoff Analysis Method) with quality/evaluation scenarios as leafs.

Motivation

The tree structure with priorities provides an overview for a sometimes large number of quality requirements.

Form

The quality tree is a high-level overview of the quality goals and requirements:

  • tree-like refinement of the term "quality". Use "quality" or "usefulness" as a root

  • a mind map with quality categories as main branches

In any case the tree should include links to the scenarios of the following section.

10.2. Quality Scenarios

Contents

Concretization of (sometimes vague or implicit) quality requirements using (quality) scenarios.

These scenarios describe what should happen when a stimulus arrives at the system.

For architects, two kinds of scenarios are important:

  • Usage scenarios (also called application scenarios or use case scenarios) describe the system’s runtime reaction to a certain stimulus. This also includes scenarios that describe the system’s efficiency or performance. Example: The system reacts to a user’s request within one second.

  • Change scenarios describe a modification of the system or of its immediate environment. Example: Additional functionality is implemented or requirements for a quality attribute change.

Motivation

Scenarios make quality requirements concrete and allow to more easily measure or decide whether they are fulfilled.

Especially when you want to assess your architecture using methods like ATAM you need to describe your quality goals (from section 1.2) more precisely down to a level of scenarios that can be discussed and evaluated.

Form

Tabular or free form text.

11. Risks and Technical Debt

11.1. Risk Mitigation Table

Risk Proactive Measure Contingent Measure

Team Attrition

Maintain clean code and updated documentation so any member can take over.

Redistribute tasks among remaining members; focus on MVP features.

Uneven Learning Curves

Conduct internal "Pair Programming" sessions for difficult modules (Rust).

Reassign tasks based on individual strengths and simplify complexity.

Rust Learning Curve

Develop small Proof-of-Concepts (POCs) for YEN parsing and AI logic early.

Use simpler AI strategies (e.g., Random Move) if logic becomes a bottleneck.

Integration Failures

Define a shared JSON Schema for YEN validation between TS and Rust.

Hold emergency integration meetings to align data formats and parsers.

Final Exam Pressure

Set internal deadlines 2 weeks before the official delivery date.

Shift focus to critical bug fixes and mandatory documentation only.

Deployment Failures

Configure and test CI/CD pipelines (GitHub Actions) in the first month.

Perform manual deployments to alternative providers (e.g., Fly.io or Render).

11.2. Technical Debt

  • AI Complexity: Initial AI versions will use basic heuristics; advanced algorithms are considered debt for later sprints.

  • Test Coverage: Reaching 80% automated coverage is a pending goal while focusing on core features.

  • YEN Robustness: Deep validation for malformed JSON from external bots is yet to be fully implemented.

12. Glossary

Contents

The most important domain and technical terms that your stakeholders use when discussing the system.

You can also see the glossary as source for translations if you work in multi-language teams.

Motivation

You should clearly define your terms, so that all stakeholders

  • have an identical understanding of these terms

  • do not use synonyms and homonyms

Form

A table with columns <Term> and <Definition>.

Potentially more columns in case you need translations.

Further Information

See Glossary in the arc42 documentation.

Term Definition

<Term-1>

<definition-1>

<Term-2>

<definition-2>