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

WIChat is a course project for the subject of Software Architecture of the Software Engineering Degree at the University of Oviedo. It is developed by the team composed of this students:

  • Natalia Blanco Agudín

  • David Covián Gómez

  • Darío Cristóbal González

  • Hugo Fernández Rodríguez

  • Marcos Llanos Vega

  • Hugo Prendes Menéndez

This project consists of the design and implementation of a web application consisting of a quiz game, similar to the quiz show “Saber y Ganar”, broadcasted continuously by TVE since 1997 and presented by Jordi Hurtado.

The game will consist of the user having to guess the location of a photo shown by the application, as well as answer questions related to it. However, he will not be alone in this task, since he will have the help of a chat that will give him clues. Behind this chat, an LLM will be hidden, which will be in charge of generating these clues.

The objective of this game will be to expand the users' knowledge and memory, while they have a good time. In the meantime, its main functionalities will be:

  • Question and answer generation

  • Implementation of a IA chat to give clues

  • User registration and their previous results

  • Implementation of users groups

  • Implementation of chat between different users

1.1. Requirements Overview

The main objective of this project is the development of a new web application that allows users to play a quiz game based on a picture of a place, while having a chat that uses a LLM to give them clues.

The application will have the following functionalities:

  • A web frontend that will display the images of the game along with the question and its possible answers, which must be answered in a given time.

  • Questions topic will be choose by users from a list of topics (footballers, painters, scientists, etc.).

  • Game will have a time limit to answer the questions in function of the difficulty level.

  • Both images and answers will be generated from Wikidata data and will be accessible through an API.

  • A chat using an LLM to give hints to users.

  • User registration system to save their previous results, which will be accessible through an API.

  • Users will be able to create new groups or join existing ones.

  • Users will be able to chat with each other.

For more information about the requirements, see next link:

1.2. Quality Goals

The following table describes the project quality goals.

Quality Goal Motivation

Efficiency

The game should run quickly and smoothly, so as not to bore the user with unnecessary waiting.

Usability

The application must be easy to learn and use, because no one will stop to read an instruction manual.

Maintenance

The application must be designed in such a way that parts can be modified in the future without the need to redo the application.

Testability.

Different use cases should be tested to ensure correct operation.

Security

The application should be secure enough so that no one can access a user’s personal information without permission.

1.3. Stakeholders

Role/Name Members & Contact Expectations

Development Team

To improve their hard skills using different technologies, mainly focused on the web. Improve their soft skills such as teamwork skills, communication and time management.

Teachers

  • José Emilio Labra Gayo

  • Diego Martín Fernández

They are in charge of guiding the students and supervising their work, as well as helping them to solve any problems that may arise.

Users

  • Users

They will be in charge of using the application.

2. Architecture Constraints

This document describes the technical, organizational, and convention-based limitations that must be considered during the development of the WIChat project, an interactive web application for questions and answers based on images. The main objective of the project is to create a platform where users can participate in a quiz game based on different themes, guessing places or concepts from images.

A key feature of WIChat is the integration of a long language model (LLM) to provide players with conversational hints. Additionally, questions and answers are generated automatically using data from Wikidata. The following outlines the main constraints and conventions that will guide the development of the application.

2.1. Technical Limitations

Constraint Explanation

GIT & GitHub

The use of GIT will be mandatory for version control, and GitHub will be the platform we use to store the code. This system will allow parallel work by using branches for developing new features or fixing bugs. Additionally, we will use Pull Requests for code review before final integration. GitHub Actions may be used to automate testing deployment.

Docker

Docker will be used to containerize the application in both development and production environments for web deployment, ensuring consistent environment configurations and simplifying application maintenance across different platforms.

MongoDB

MongoDB will be used as the primary database to store user data, questions, and hints. Its flexible schema will allow efficient handling of dynamic content and scalability for future improvements.

React

The frontend will be developed using React to create a dynamic and responsive user interface. This framework will enable a component-based architecture, improving maintainability and reusability.

Node.js

Execution environment using JavaScript for server-side operations, rather than client-side. It provides an event-driven, non-blocking I/O model, making it lightweight and efficient.

Express

Web framework for Node.js designed to simplify the implementation of web applications. It offers a minimal and flexible structure for handling routes, middleware, and API endpoints.

JavaScript

JavaScript will be the main programming language for both the frontend (React) and backend (Node.js & Express), ensuring a unified development environment and reducing context switching between technologies.

Wikidata

Wikidata will be the primary source for generating images for the questions and hints.

LLMS (Long Language Model)

The system will use an external language model (LLM) to generate interactive hints about the images. However, due to the inherent limitations of LLMs (such as generating incorrect responses or hallucinations), it will be necessary to implement mechanisms to validate and mitigate these issues to ensure the accuracy of the generated hints.

2.2. Organizational Limitations

Constraint Explanation

Team

The project team consists of 6 people, which means that coordination and cooperation between team members is essential.

Time

The team must adhere to the established deadlines for project delivery, ensuring that progress is presented according to the anticipated dates and the decisions documented in the meeting minutes.

Meetings

Weekly meetings will be held during the practical classes, where the tasks completed by each team member during the previous week will be reviewed, and new tasks will be discussed. If there is a need to address questions outside these meetings, team members can ask through the WhatsApp group, or hold meetings via Discord, making sure that the decisions made during those sessions are clearly documented on GitHub.

Issues

The GitHub Issues tool will be used for task management. Each team member will be responsible for completing the tasks specified within the given time frame.

Records

After each meeting, whether during the scheduled practice hours or any extraordinary meetings, meeting minutes will be written to document the decisions made.

2.3. Convention Constraints

Constraint Explanation

Software Design

The code must be modular, maintainable, and understandable. "Clean code" principles will be applied to ensure the project is easy to update and expand.

Documentation

The Arc42 template will be used to create the project documentation. This documentation must be clear, structured, and easy to follow, with a practical approach so that any team member or external person can understand the architecture and key components of the system.

Adaptability

The application must be designed to work across multiple devices and screen sizes, ensuring a consistent experience on both desktop and mobile platforms. Responsive design techniques and best practices will be implemented to optimize usability across different resolutions.

Usability

The system must provide an intuitive and accessible user interface, ensuring a smooth experience for all users.

3. Context and Scope

3.1. Business Context

Business Context Table

Communication Partner Inputs Outputs

Users (Contestants)

Registration data, game responses, hint requests

Game questions, AI-generated hints, game history

System Administrator

Platform management commands

System status reports, user activity logs

Language Model (LLM)

Image and question data

Interactive hints

Wikidata

Data queries

Images and question-related data

Business Diagram

The business context defines how WIChat interacts with its key stakeholders and systems in terms of domain-specific inputs and outputs. This includes:

  • Users (Contestants): Players who interact with the system to answer questions and request hints.

  • System Administrator: Responsible for managing and monitoring the platform.

  • Language Model (LLM): Provides AI-generated hints based on user inputs.

  • Wikidata: Supplies the data and images used to generate questions.

3.2. Technical Context

Technical Context Diagram

Technical context Diagram
Figure 1. Technical context.

Technical Context Table

Communication Partner Channel/Protocol Input/Output

Users (Contestants)

HTTP (Web Browser)

Game interactions, hint requests, and responses

System Administrator

HTTP (Admin Panel)

Platform management commands and logs

Language Model (LLM)

API (REST/GraphQL)

Image/question data and hint generation

Wikidata

API (SPARQL)

Data queries and responses

The technical context describes the channels and protocols used by WIChat to communicate with its external systems and users. Key aspects include:

  • HTTP: Used for communication between users, administrators, and the system.

  • Data Flow: How inputs and outputs are mapped to specific channels for seamless operation.

Mapping Input/Output to Channels

Input/Output Channel/Protocol Communication Partner

Game responses, hint requests

HTTP

Users (Contestants)

Platform management commands

HTTP

System Administrator

Image/question data, hint generation

API

Language Model (LLM)

Data queries and responses

API

Wikidata

This mapping clarifies how specific inputs and outputs are transmitted through the system:

  • Users: Interact via HTTP to send and receive game-related data.

  • Administrators: Use HTTP to manage the platform and access logs.

  • LLM and Wikidata: Communicate via APIs to process data and generate hints or questions.

4. Solution Strategy

4.1. Technology decisions

For the development of the following project we have decided to use the following technologies. Many of them have been based on the project template provided by the teachers, as we do not yet have sufficient depth of knowledge in these technologies (web development libraries and frameworks, docker…​).

  • JavaScript: Programming language mainly focused on web development on the client side, mainly used to provide interactivity to a web page.

  • React: Open source JavaScript library used to create graphical user interfaces.

  • Node.js: Execution environment using Javascript for server-side, rather than client-side.

  • Express: Web framework for Node.js to simplify the implementation of web applications.

  • MongoDB: NoSQL-like database, which stores data in a JSON-like format and favours application scalability and flexibility when it comes to handling unstructured data.

  • GitHub: Web application used in software development that allows code to be written, stored, organised by version and collaborated on by different members of a team using Git.

  • Docker: Tool that allows you to create, deploy and run applications in containers, testing that the application works in different environments.

  • Google Gemini: One of this AI tools to implement the LLM for the chat service in the game.

4.2. Top-level decomposition of the system

An architecture using services has been chosen for this project, so that each module focuses on a specific task. Some of the modules will be the following:

  • Gateway service: It will manage different services of the application (users, game, chat, etc).

  • User service: It will manage the creation of new users, store their information …​

  • Authentication service: It will manage the authentication of users when they log in.

  • Groups service: It will manage the creation of new groups, the addition of users to them and the chat between users.

  • Wikidata service: It will connect with Wikidata API to get the image and the necessary information for the game.

  • MathGame service: It will manage the mathematical game.

  • Web app: It will contain the game and other functionabilities of the application.

  • LLM service: It will use Google Gemini to generate a chat to help the user with hints to facilitate the game.

  • API service: It will allow access to information stored in data base of the system (questions, users, etc) through an API.

Interaction between services
Figure 2. Interaction between services

4.3. Decisions taken to achieve quality goals

Quality goal Decision made

Usability

To ensure the usability of the application, an intuitive and simple interface will be designed so that the user has no doubts about what action to take at any moment. In addition, a sufficiently legible font with an appropriate size and weight will be used. Finally, the application will be made responsive to facilitate its use on different devices.

Maintainability

In order to facilitate the maintainability and expansion of the application, we will try to follow the good practices for software development acquired in other previous subjects of the degree. An example of this will be some of the SOLID principles previously studied, such as the Single responsibility principle or the Open/closed principle.

4.4. Organizational decisions

Organizational goal Tool chosen Description

Task distribution

GitHub Issues

It will be used to assign each of the tasks into which the project is divided to a member of the team. These tasks will be distributed equally among the different members of the team, trying to adjust to the knowledge and tastes of each one.

Changes approval

Pull requests

Once each task is finished, a pull request will be made so that at least one component of the team other than the developer of the task will review it before merging it to the main branch of the project.

Project timeline

GitHub Projects

This will be used to track the development of the project and be able to see which parts are completed and which are not, as well as which parts are currently being worked on.

Communication

Weekly meetings

Meetings will be held on a weekly basis to see what is the status of the project, what has been done and what remains to be done.

Documentation

AsciiDoc

We have chosen Asciidoc as the primary documentation tool. This decision is largely due to the ease and intuitiveness of deploying documentation using the tools provided by the Asciidoc ecosystem.

5. Building Block View

5.1. Whitebox Overall System

Building Block View
Figure 3. Building Block View.
Motivation

The goal of this system is to offer a question and answer game based on images, where participants can answer questions automatically generated from Wikidata. Additionally, a Large Language Model (LLM) provides hints to participants when requested, enhancing the game experience.

Contained Building Blocks
Name Description

User

Represents the participants of the game (they can answer questions and request hints).

Browser

Interface where the user interacts with the game. It is responsible for sending answers and hint requests.

WIChat

Manages the game logic. It communicates with Wikidata to retrieve data and provides additional information to the LLM when necessary.

Wikidata

Database that provides the data to generate the questions.

LLM (Large Language Model)

Processes users' questions about the images and returns hints to the Browser to help the participants.

Important Interfaces
Name Description

User interface (User ↔ Browser)

The user interacts with the Browser. The Browser is used to send answers and requests hints.

HTTP/REST Inteface (Browser ↔ WIChat)

The browser communicates with de WIChat system using HTTP or REST requests to send answer and retrieve game information

Hints Requests (Browser ↔ LLM)

The browser requests hints from the Large Language Model (LLM) to assist the participants.

Query for Additional Information (LLM ↔ WIChat)

The LLM queries WIChat when additional information is needed to provide hints.

REST Inteface (WIChat ↔ Wikidata)

WIChat interacts with Wikidata via REST requests to retrieve data for generating questions.

Response in HTML/JSON (WIChat ↔ Browser)

WIChat sends the processed information to the browser in HTML or JSON format to be presented to the user.

Sending Hints (LLM ↔ Browser)

The LLM sends hints to the browser to be displayed to the user.

5.2. Whitebox Overall System Final

Building Block View Final
Figure 4. Building Block View.
Motivation

The goal of this system (WIChat) is to offer a question and answer game based on images, where participants can answer questions automatically generated from Wikidata. Additionally, a Large Language Model (LLM) provides hints to participants when requested, enhancing the game experience. The system also includes features for user management, group interactions and a math-based mini-game.

Contained Building Blocks
Name Description

User

Represents the participants of the game. They can answer questions of the main game or the math mini-game, request hints, join groups and interacts with other users.

Browser

Interface (frontend) where the user interacts with the game. It sends request to the backend via the Gateway.

GatewayService

Acts as a central single entry point for frontend requests. It routes them to the appropriate backend service.

WikidataService

Handles the core game logic. It retrieves questions and answers from the external Wikidata repository and process them for the game

Wikidata (external)

External semantic knowledge base. The WikidataService queries this to obtain data for generating questions.

LLM (Large Language Model)

Provides hints based on user requests. It may contact the WikidataService to obtaing context or clarigy game-related data before responding

MathGame

A backend service that generate math-based questions and evaluates answer, providing an additional mini-game experience.

AuthService

Handles user authentication, including login and token generation.

UserService

Manages user data, including profile information, friend requests and private messages.

GroupService

Handles group-related functionalities, such as creating groups, adding users to groups, and managing group messages.

APIService

Provides a REST API for external integrations and serves as a bridge between the GatewayService and other services.

Important Interfaces
Name Description

User interface (User ↔ Browser)

The user interacts with the Browser to answer questions(for the main game or math mini-game), request hints, manage their profile and join or create groups.

Frontend (Browser ↔ WebAppService)

The Browser sends all requests (game logic, hints, user info, etc.) to the WebAppService using HTTP/REST.

Frontend to Backend Gateway (WebAppService ↔ GatewayService)

The Gateway routes these request of WebApp to the appropriate backend services.

Game Logic (GatewayService ↔ WikidataService)

Routes game-related request (e.g., get question, submit answer) from the frontend to the WikidataService.

Wikidata Query Interface (WikidataService ↔ Wikidata)

The WikidataService comunicates with the public Wikidata knowledge base to retrieve data for generating questions.

Hints Requests (Gateway ↔ LLMService)

Routes hint request to the LLMService, which enrich response by querying WikidataService

Math Game (GatewayService ↔ MathGame)

Routes math-game specific request (new question, validate answer) to the MathGame service.

Authentication (GatewayService ↔ AuthService)

Handles login and authentication logic via secure requests through the Gateway.

User Management (GatewayService ↔ UserService)

Routes requests for user profiles, friendships, and messages to the UserService.

Group Management (GatewayService ↔ GroupService)

Routes group-related operations (create group, join, chat) to the GroupService.

External API Interface (APIService ↔ External Systems)

Allows external clients to consume parts of the system’s functionality securely.

6. Runtime View

6.1. Sign Up

  • The registration diagram in an application describes the flow that a user follows to create an account. It begins with the entry of data (such as name, email and password), followed by the validation of the information. If the data is correct, it is stored in a database. Finally, the user can log in and access the application. This process ensures security and accuracy in account creation.

Signup Diagram

6.2. Log In

  • The login diagram in an application describes the flow that a user follows to access their account. It begins with the entry of data (such as email and password), followed by the validation of the information. If the data is correct, the user is redirected to the application’s home page. This process ensures security and accuracy in account access.

Login Diagram

6.3. Game play

  • The game play diagram in an application describes the flow that a user follows to play a game. It begins with the selection of a game category (such as multiple types of categories) and level (such as easy, medium and hard). The game begins by displaying a series of questions, where the user must choose between four options. After choosing an option, the user will move on to the next question. During a question, the user can ask questions in an interactive chat. Upon completion of the game, a summary will be displayed and the option to restart will be provided. This process ensures a smooth and engaging gaming experience.

Game Play Diagram

7. History View

  • The history diagram in an application describes the flow that a user follows to view their history of gameplays. It begins when user decudes to view their history. The application retrieves the user’s history data from the database and displays it on the screen. This process ensures that the user can easily access their history information.

History Diagram

8. 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.

Our system infrastructure consists of a single virtual machine running Ubuntu 22.04 LTS. This server hosts a Node.js application inside a Docker container and includes a MongoDB database to store application data. The application also interacts with the Wikidata API to generate dynamic content. Additionally, we use a Large Language Model (LLM) that leverages context from the application to provide user hints.

8.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.

07 overview.drawio
Motivation

The choice of this infrastructure is driven by the flexibility of a dockerized microservice architecture. Containerization simplifies deployment and ensures consistency across different environments. Additionally, Docker’s platform-agnostic nature allows the application to run on virtually any machine, making scaling and maintenance more efficient.

Quality and/or Performance Features
  • Scalability: The system can be easily scaled horizontally by adding more service instances, leveraging the container orchestrator for efficient load distribution.

  • Portability: The application can be deployed in any environment that supports Docker containers, enabling seamless migration to different cloud providers if needed.

  • Maintainability: Each container operates independently, allowing for individual updates and maintenance. By replacing containers with new application versions, the system remains up-to-date with minimal disruption.

  • Security: The system is hosted in a secure environment on the Azure cloud platform. Each container runs in isolation, minimizing the impact of potential security breaches and ensuring high availability.

Mapping of Building Blocks to Infrastructure
Component Description

User agent

The client that accesses the system through the web application.

Virtual Machine

The server hosting the system.

Docker

Containerization platform used for deploying and managing the system.

Wikidata API

External service that provides dynamic content for the application.

Large Language Model (LLM)

AI-powered component that analyzes application context to assist users with relevant hints.

9. Cross-cutting Concepts

9.1. Domain Model

08 domainModel.drawio

9.2. User experience

Our application is designed as an engaging quiz game. Players answer questions from a variety of categories, each with multiple choices and only one correct answer. The main challenge is to guess a location based on a displayed photo. To enhance learning and fun, users can request hints from a Large Language Model (LLM) at any time.

9.3. Usability

Usability is a critical factor for any application, as it directly influences how efficiently users can interact with it. To ensure our app’s usability, we will adhere to design standards and conduct testing with a diverse group of users, who will provide feedback on how intuitive the interface feels.

9.4. Security

Since we prioritize the security of user information, it is a key focus for our app.We will encrypt user passwords and limit the amount of data we collect from them. For LLM interactions we ensure that no personally identifiable information is shared with external services.

9.5. Testing

To ensure the app functions correctly, we have chosen to implement unit tests and conduct manual testing. Additionally, we will perform the usability tests mentioned earlier to further enhance the user experience.

9.6. Maintainability

We have committed to following best practices to ensure the app is easy to maintain and update. We aim to simplify future enhancements and ensure we can work efficiently.

10. Architecture Decision Records (ADRs)

10.1. Inherited ADRs

Since we start from an initial project that is already functional and that we will be expanding, many architectural decisions have been inherited from it. These can be consulted in the wiki of the base project.

10.2. ADR 01: Mistral 7B as LLM Service

Date: 2025-02-17

Mistral

10.2.1. Status

10.2.2. Context

The LLM is the main feature added to the system, and is responsible for generating the hints the user will have available during each game in relation to the questions asked. An LLM service is required to provide the necessary functionality, and Mistral 7B, LLM developed by Mistral AI, shows the following aspects to consider as a potential candidate:

  • Efficiency in Size and Performance: Mistral 7B is a relatively smaller model compared to others, but still provides strong performance (and even faster response times) in Natural Language Processing tasks, which makes it more manageable and a perfect choice for our system, given its requirements.

  • Open-Source Model: Mistral 7B is an open-source model, which allows us to access, modify and use it freely, without any licensing issues or commercial restrictions.

  • Not ideal for complex tasks: Its smaller size makes it less capable of capturing long or highly complex contexts as well as larger models, but our system does not require such complexity.

  • Fine-Tuning Required: The model may require fine-tuning for the specific aspects of our application.

10.2.3. Decision

The Mistral 7B LLM Service will be used as the LLM service for the system.

10.2.4. Consequences

Mistral 7B will be implemented in our application as the external LLM hint generator.

10.3. ADR 02: Gitflow vs Trunk-Based Development

Date: 2025-02-17

Mistral

10.3.1. Status

Accepted.

10.3.2. Context

We need to establish a way to work as a team using Git, and determine the use to be made of branches. Among all possible approaches, two stand out: Gitflow and Trunk-Based Development.

Gitflow uses branches such as master, develop and feature, being more suitable for large projects and long cycles, with less frequent integration. Trunk-Based Development focuses on integrating changes quickly into a single main branch, promoting continuous delivery and reducing conflicts, making it ideal for agile teams and fast cycles. Gitflow is more structured, while TBD is more agile and simple.

10.3.3. Decision

TBD chosen as our git strategy for the project.

10.3.4. Consequences

The chosen option will be the way to work from now on in the project (TBD).

10.4. ADR 03: Use of Neobrutalism components

Date: 2025-03-03

Neobrutalism Components

10.4.1. Status

Declined.

10.4.2. Context

React components are essentially the building blocks of a React application. They are the visual elements that make up the user interface of the application. Neobrutalism components are a collection of neobrutalism-styled React Tailwind components. They are a mix of regular brutalism in web design and more modern typography, illustration, and animation standards.

As part of our design decisions, we need to decide whether to use Neobrutalism components in our project.

10.4.3. Decision

Decision declined.

10.4.4. Consequences

Neobrutalism components will not be used in our project.

10.5. ADR 04: Gemini 1.5 Flash as LLM Service

Date: 2025-03-10

Gemini

10.5.1. Status

Accepted.

10.5.2. Context

Gemini 1.5 Flash is a variant of Google’s Gemini 1.5 AI model, designed to be lighter and faster. It is a model that has been optimized for speed and efficiency, making it ideal for applications that require quick responses and low latency.

As we’ve encountered some performance issues with Mistral 7B, we need to consider other LLM services that can provide the necessary functionality, and Gemini 1.5 Flash stands as the main candidate.

10.5.3. Decision

Decision accepted.

10.5.4. Consequences

Gemini 1.5 Flash substitutes Mistral 7B as the chosen LLM service for our system.

10.6. ADR 05: DiceBear Avatar Library

Date: 2025-04-20

DiceBear

10.6.1. Status

Accepted.

10.6.2. Context

DiceBear is a JavaScript library that allows you to create unique avatars for your applications in no time. It provides a wide range of customizable avatars, which can be generated on the fly. This library is particularly useful for applications that require user avatars, as it allows for easy integration and customization.

As we wanted our users to be able to create their own avatars, and not use a default one, we needed to find a library that would allow us to do so. DiceBear is a good candidate for this purpose, and will enhance the user experience giving the application a more personalized touch.

10.6.3. Decision

Decision accepted.

10.6.4. Consequences

DiceBear will be used in our project to allow users to create their own avatars.

10.7. ADR 06: App Deployed in ARM Oracle VM

Date: 2025-04-06

Oracle

10.7.1. Status

Accepted.

10.7.2. Context

The application deployment requires a robust, scalable, and cost-effective platform to meet quality standards. Oracle offers the possibility of deploying the application for free in a basic ARM Virtual Machine (VM), which is a good option for our needs.

10.7.3. Decision

Decision accepted.

10.7.4. Consequences

A Oracle ARM VM will be used for the deployment of the application.

10.8. ADR 07: Start from Scratch vs Use Previous Project

Date: 2025-03-10

10.8.1. Status

Accepted.

10.8.2. Context

Although initially we considered the possibility of using a previous project as a base for our development, we finally decided to start from scratch. We believe that starting from scratch will allow us to have a cleaner and more maintainable codebase, and to implement functionalities faster, as we’ll be more familiar with our own code. It will also allow us to define our own architecture and design decisions, without being constrained by the decisions made in the previous project.

However, we will still be able to use the previous project as a reference for some functionalities and design decisions, and we will also be able to use some of the code from the previous project if we find it useful.

In that sense, some ADRs (not all of them) from the previous project will be inherited:

  • JavaScript

  • Microservice Architecture

  • Docker

  • React

  • MongoDB

  • ExpressJS

These can be deeply consulted in the previous project’s wiki.

10.8.3. Decision

Decision accepted.

10.8.4. Consequences

Development will start from scratch, but some ADRs from the previous project will be inherited. The previous project will be used as a reference for some functionalities and design decisions, and some of the code from the previous project might be used if found useful.

10.9. ADR 08: Use of Material UI component library

Date: 2025-03-10

Material UI

10.9.1. Status

Accepted.

10.9.2. Context

Material UI (MUI) is a popular React component library that implements Google’s Material Design guidelines. It provides a set of pre-built, customizable UI components—like buttons, forms, and layouts—that help developers build consistent, responsive, and visually appealing user interfaces quickly and efficiently.

As we wanted to use a component library that would allow us to create a clean and appealing user interface, we considered several options. MUI stood out as a strong candidate due to its popularity, ease of use, and extensive documentation.

10.9.3. Decision

Decision accepted.

10.9.4. Consequences

Material UI will be used in our project as the main component library for the user interface.

11. Quality Requirements

  • Functionality: The system shall provide an acceptable quiz game experience, with various question types, time limit and a scoring system. The hint-provider LLM should be perfectly integrated into the game.

  • Usability: The system shall be easy to use, accesible and intuitive. The user interface shall be responsive and provide feedback to the user.

  • Performance & Reliability: The game should load quickly, with minimal waiting times and a stable performance.

  • Content: The system shall provide a large variety of questions, with different difficulty levels and categories.

  • Security: The system shall be secure, with no data leaks or vulnerabilities, and all data should be encrypted.

  • User Experience: The system shall provide a fun and engaging experience, with a visually appealing design and animations.

  • Compatibility: The system shall be compatible with all modern web browsers.

  • Testing: The game shall be widely tested to ensure quality and reliability. A bug-free experience is expected.

  • Localization & Internationalization: The system shall be available in multiple languages, with the ability to switch between them.

  • Scalability: The system should be able to handle a large number of users and questions, with minimal impact on performance.

  • Maintainability: The system should be easy to maintain and update, with clear and well-documented code.

  • Extensibility: The system should be easily extensible, with the ability to add new features and content.

11.1. Quality Tree

Quality Requirements

11.2. Quality Scenarios

Quality Requirement Scenario System Response Priority

Functionality

The user starts a new game

The system will provide a question, set a time limit and initialize the scoring system.

High

Usability

A new user opens the game for the first time

The system will be easy to understand at first sight, and prepared to answer any questions the user might have about its use. It will also be able for people with various disabilities to use it.

High

Performance

A user answers a question

The system will provide instant feedback (right or wrong) and move to the next question without any delay.

High

Security

A user logs in

All data is safely stored and encrypted, with no vulnerabilities.

High

Testing

A user plays the game

No bugs will be encountered during the game.

High

Compatibility

A user opens the game in a web browser

The game will work properly independently of the browser used.

High

Content

A user starts a game

Different categories and difficulty levels will be available.

Medium

Scalability

A large number of users play the game

The system will be able to handle the load without any performance issues.

Medium

Maintainability

A developer needs to update the system

The code will be well-documented and easy to understand.

Medium

Extensibility

A developer wants to add a new feature

The system architecture will allow for easy extension.

Medium

Localization & Internationalization

A user changes the language

The system will switch to the selected language.

Low

12. Risks and Technical Debts

The "Technical Risks and Debts" section outlines potential challenges and issues that may emerge during the project’s development and maintenance. These risks and debts must be carefully assessed and addressed to ensure the project’s successful completion and long-term sustainability. The subsections below detail both internal and external technical risks, along with the technical debts to consider.

12.1. Technical risks

A technical risk is defined as a potential event that could jeopardize the project’s successful completion, cause delays, increase costs, or even result in failure if not effectively managed. The subsections below outline the internal and external technical risks identified for the project.

Description Priority Considerations

Lack of experience with the base project and its technologies

9

Since none of the team members have prior experience with the technologies used in this project, there will be a steep learning curve. This will require extensive research and testing, which could slow down progress. However, leveraging documentation and online resources will help mitigate this risk.

First time working as a large team on a software project

8

The team has experience in GitHub but has not collaborated in such a large group before. This could lead to difficulties in task distribution, communication, and version control conflicts. Establishing clear workflows and communication channels will be essential to mitigate these issues.

Integration of a Large Language Model (LLM) chat system

7

Adding an AI-driven chat system for user hints introduces complexities such as model selection, API integration, and performance optimization. Ensuring precision in the chat responses will require careful planning.

Managing dependencies and service configurations

6

The project relies on multiple external services and dependencies, which may introduce compatibility issues. Keeping dependencies up-to-date and using containerization tools can help manage these risks.

Unequal distribution of workload

5

If tasks are not evenly distributed among team members, it may lead to burnout or bottlenecks. Regular meetings and tracking progress using project management tools will be necessary to balance workload effectively.

12.1.1. External

Description Priority Considerations

Dependency on third-party AI API services

8

The integration of an LLM chat system relies on external AI APIs, which could be subject to service limitations, or outages. Exploring fallback options or alternative providers is advisable.

Wikidata API failure

3

Even though an API failure is possible, it’s a low-impact event because we have the questions stored in the database, and the game would still function.

Cloud service downtime

6

The project may rely on cloud-based infrastructure, and any downtime could affect system availability. Using monitoring tools and backup strategies can help mitigate this risk.

12.2. Technical debts

Description Priority Considerations

Microservices deployment limitations

8

Despite the project’s adoption of a microservices architecture, the current deployment setup lacks proper load balancing and auto-scaling capabilities. This creates a significant bottleneck when handling increased user traffic, particularly during peak usage times. Performance degradation becomes noticeable even with moderate user loads, making the application unsuitable for production environments without these enhancements. Implementation of container orchestration with Kubernetes or advanced Docker Swarm configurations would be necessary to fully leverage the microservices architecture’s scalability benefits.

Code reuse issues and structural patterns duplication

7

Significant code duplication exists across microservices in the form of identical utility functions (validateRequiredFields, MongoDB connection setup) implemented independently in each service. This undermines the modularity benefits of the microservices architecture and creates maintenance challenges when common functionality needs to be updated. Additionally, error handling patterns are inconsistent across services, with varying approaches to validation and error responses. Similar test setup code is also duplicated across test files, with each service reimplementing MongoDB memory server configuration. A systematic refactoring effort to extract common utilities into shared libraries, standardize error handling patterns, and create reusable test fixtures would significantly reduce maintenance complexity and improve code quality.

Wikidata API performance limitations

6

The Wikidata service experiences performance issues, particularly with slow response times when fetching questions. This affects the game experience as users may experience delays while waiting for questions to load. Performance optimizations, caching mechanisms, and potentially preloading questions are required to improve user experience.

LLM service scalability constraints

8

The current LLM service implementation can only handle approximately 3 simultaneous connections and has token limitations due to using a personal-use API key. This severely restricts the scalability of the application in a production environment with multiple users. A production-ready API key with higher rate limits or implementing a queuing system would be necessary to scale the application.

Limited internationalization

5

The question system currently only supports English or Spanish, limiting the accessibility for the people which can speak neither languages.

Lack of robust error handling

6

Many API endpoints have basic error handling that returns generic error messages rather than providing specific information to help diagnose issues. This makes troubleshooting more difficult, especially in production environments. More comprehensive error handling with appropriate logging would improve system reliability and maintenance.

Environment variable management

4

The project relies on numerous environment variables for configuration with inconsistent handling across services. This creates potential for configuration errors and complicates deployment. A standardized approach to environment variable management and validation would improve system reliability.

13. 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

ChattySw

Software development company in charge of updating WIChat, including LLM-generated hints integration.

RTVE

Radio Television Española.

Saber y Ganar

A Spanish TV quiz show that serves as the inspiration for this project, known for its intellectual challenges and diverse question formats.

HappySw

Company that developed WIChat last year.

WIChat

Name of the application

LLM

Large Language Model based on AI

Wikidata

A structured data repository used by the application via an API to generate game questions.

Frontend

The user-facing part of the application, responsible for the interface and user interactions

Backend

he server-side part of an application

API

A set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.

React

A JavaScript library for building user interfaces, used for the application’s frontend development.

MongoDB

A NoSQL database used for the application data storage.

Node.js

A JavaScript runtime environment used for the application’s backend development.

Git

Version control system used during the development of the application.

Github pages

Allows hosting static web pages from a repository used to deploy documentation.

Arc42

A template for documenting software architecture.

Express

A minimal and flexible Node.js web application framework for building APIs and web apps.

Microservice

An application is composed of multiple independent components, each of which can be developed, deployed, and scaled separately..

NoSQL

Non-relational databases that store data in a non-tabular format, rather than in rule-based, relational tables like relational databases do.