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.
1. Introduction and Goals
The functional requirements that the application will include:
-
The system will have at least a web frontend that will display images and responses.
-
A hint system that will allow users to obtain hints with images.
-
User registration.
-
Users will be able to check their statistics (time played, number of games, games won/lost, etc.).
-
The information for questions and answers will be generated automatically from Wikidata.
-
An LLM model will be used for the hint system.
-
Questions must be answered within a specified time limit.
-
Each question will have one correct answer and several incorrect or distracting answers.
1.1. Objetivos de calidad
Quality Objectives | Motivation | Priority |
---|---|---|
Usability |
Provide a good user experience, with a simple and attractive interface |
High |
Maintainability |
Be able to make modifications to the game relatively easily, such as new questions or new game modes |
Medium |
Acceptable Performance |
To ensure a good user experience, we must provide an application with reduced loading times and smooth gameplay. |
High |
1.2. Stakeholders
Role/Name | Contact | Expectations |
---|---|---|
Students |
Yeray Rodríguez Granda, Diego García Gonzalez, Sara Fernández González, Daniel Álvarez Blanco, Carlos Cabrera Moral, Fernando Begega Suarez |
Develop a good application |
Teachers |
Diego Martín Fernandez |
Ensure that we develop a good application and learn the concepts taught in class |
Users |
Anyone using the application |
Have fun playing the application we develop |
WikiData |
Wikimedia Deutschland |
They are interested in us using their services |
RTVE |
RTVE |
They want us to provide a good application based on the game "Saber y Ganar" to attract people to the program |
LLM API Provider |
LLM API Provider |
They are interested in us using their services |
2. Architecture Constraints
-
Frontend Restriction: The system will have at least a web frontend that will display images and answers, as well as a hint system that will allow users to obtain hints about the images.
-
Web Deployment: The web application must be deployed and accessible via the internet.
-
User Registration: Users will be able to register in the system and consult their participation history, including the number of games played, correct/incorrect answers, times, etc.
-
Use of the Wikidata API: The questions' information will be automatically generated from Wikidata data.
-
Use of an LLM: Users will be able to interact with the application for each question to obtain hints. A language model (LLM) will be accessed via an API. A technique must be introduced to generate hints from Wikidata data and mitigate incorrect answers and hallucinations during the conversation.
-
Question Model: Questions must be answered within a set time limit. Each question will have one correct answer and several incorrect or distractor answers. Both the correct and incorrect answers will be generated automatically.
-
Creation and Documentation of a Custom API: The system will allow access to user information through a documented API. The system will also provide access to generated questions through an API.
3. Context and Scope
3.1. Business Context

Element |
Description |
User |
Plays the game through his device |
System |
The application that runs the game |
Wikidata |
Gives the info necessary for the questions and answers |
LLM Service |
Chat with the user through the System to give clues |
3.2. Technical Context
<Diagram or Table>
<optionally: Explanation of technical interfaces>
<Mapping Input/Output to Channels>
4. 4. Solution Strategy
4.1. 4.1. Technological Decisions
For the development of the system, technologies have been selected to optimize performance, maintainability, and scalability of the project.
-
Programming Language: TypeScript TypeScript was chosen as the main language for the project. Unlike JavaScript, TypeScript is a statically typed language, which helps with early error detection during programming. Its adoption avoided the need to completely migrate the existing JavaScript code to Java with Spring Boot.
-
Database: MongoDB MongoDB was chosen as the NoSQL database. This database allows handling data in a flexible format and scaling efficiently, facilitating integration with Node.js.
-
Frameworks and Libraries
-
React.js: Used for developing the user interface due to its modularity and ease of building interactive web applications.
-
Node.js: Used as the runtime environment for the backend layer, enabling a full-stack architecture based on JavaScript/TypeScript.
-
-
Version Control: GitHub GitHub was selected for version control. It allows for efficient source code management, continuous integration, and remote collaboration.
-
APIs: Wikidata y Gemini
-
Wikidata: Wikidata will be used to retrieve structured information about any given topic. The system will query Wikidata to gather relevant data, which will then be processed to dynamically generate questions. By using Wikidata as a data source, the system ensures that the information is accurate and up-to-date.
-
Gemini: The Gemini API will be used to create an interactive chat feature that generates hints for a quiz game. This will enhance user engagement by providing intelligent clues based on the context of the questions.
-
4.2. 4.2. Decisions on how to achieve key quality goals
To ensure the system meets high-quality standards, several decisions have been made regarding development, deployment, and maintainability:
-
Performance: The system will use a NoSQL database (MongoDB) to allow fast read and write operations.
-
Maintainability:
-
TypeScript is used to prevent runtime errors and improve code readability.
-
Modularization of the frontend and backend code to facilitate updates and enhancements.
-
-
Scalability: The backend is built on Node.js, allowing it to handle multiple concurrent requests efficiently.
-
Usability and Accessibility:
-
The UI will be designed following accessibility guidelines to ensure an inclusive user experience.
-
The interactive hint system using Gemini AI will improve user engagement and learning.
-
-
Testing and Deployment:
-
Unit and integration tests will be implemented to ensure system reliability.
-
End-to-end (E2E) testing will validate the complete user experience.
-
Continuous Integration/Continuous Deployment (CI/CD) pipelines will automate testing and deployment processes.
-
Performance and load testing will be conducted to ensure stability under high traffic conditions.
-
5. Building Block View
5.1. Level 1: Whitebox Overall System

- Motivation
-
This level shows the interaction of the user with the main system of the application, which in turn makes use of external resources.
- Contained Building Blocks
Name | Responsibility |
---|---|
Whichat |
Is the main system. Handles user interaction and interacts with external resources |
5.2. Level 2: Internal Structure of Level 1 Blocks

This level shows the division between the frontend and the backend, as well as the interface that connects both services.
- Contained Building Blocks
Name | Responsibility |
---|---|
WebApp |
This system will allow the user to interact with the application, i.e. the frontend. |
Gateway |
This block will act as the API of our application, taking care of redirecting requests to the corresponding microservices. |
WichatServices |
This system acts as a backend, being responsible for both managing application services and interacting with external resources. |
5.3. Level 3: Internal Structure of Level 2 Blocks

In this level of descomposition of the system we identify the different views of the webapp and microservices of the WichatServices.
- Contained Building Blocks
-
Webapp
Name | Responsibility |
---|---|
Home |
__ |
Login |
__ |
Signup |
__ |
GameMenu |
__ |
Stats |
__ |
Game |
__ |
WichatService
Name | Responsibility |
---|---|
UserService |
__ |
AuthService |
__ |
StatsService |
__ |
QuestionService |
__ |
ClueService |
__ |
6. Runtime View
6.1. Secuence diagram of application
actor p as "Player" participant g as "Game" participant r as "Repository" p -> g: Start Game p -> g: Choose model and init loop Game Loop g -> r: Requests random question r -->g g -> p: Ask the question ||| ...Player takes some time to answer the question...... ||| p -> g: Answer the question g -> r: Store question's answer r -> r: Calculate score r -> g: Returns final score g -> p: Show final score g -> p: Show ranking end p -> g: Ends game
7. Deployment View
7.1. Infrastructure Level 1

- Motivation
-
While developing and testing the app it will be run on the developer’s localhost enviroment (Using docker for standarization). However, in the production stage we aim for the aplication to be running on a Azure Server.
- Quality and/or Performance Features
-
We haven’t tested the app’s performance
- Mapping of Building Blocks to Infrastructure
Element | Description |
---|---|
Azure Server |
Where the application will be deployed. |
Docker Engine |
Daemon inside the azure server which will run our docker containers |
WebApp |
It is the frontend of our application. |
MicroServices |
They create the backend of the application, they manage every aspect of the application. |
WikiData |
It is an external service which will provide the necessary data for the application to work properly. |
LLM |
It is an external service that will provide the clues to the user by conversation |
8. 8. Cross-cutting Concepts
8.1. 8.1. Domain Model
-
Users: Represents the players, including data such as name, email, game statistics and answer history.
-
Questions and Answers: Model that includes the image, statement, answer options (correct and incorrect), and the source (Wikidata).
-
Hints: Data dynamically generated from a language model (LLM).
-
Game Sessions: Records the users' sessions, including given answers, times, and results.
8.2. 8.2. User Experience concepts (UX)
The user interacts with the application through a user interface. In this interface, the user must either register or log in. Once the user has been identified, they can start a quiz or check their participation history.
Regarding the quiz, the user will see a question on the screen along with a series of possible answers. When one of these answers is selected, the user will receive feedback based on whether the chosen answer is correct or not. Additionally, there will be a chat in the bottom left corner that will interact with the user to provide a series of hints.
9. Architecture Decisions
10. Quality Requirements
10.1. Quality Tree
Quality |
Description |
Scenario |
Usability |
The application must be easy to learn to use by design. |
__ |
Performance |
The application should have a waiting time of no more than 5 seconds between actions. |
__ |
Persistence |
The system should prevent any possible lose of user information. |
__ |
Integrity |
The system should grant confidentiality to the user’s data. |
__ |
10.2. Quality Scenarios
11. Risks and Technical Debts
11.1. Risks
Risk | Relevance | Considerations |
---|---|---|
Limited knowledge of certain tools or languages |
High |
A solution could be to use the tools and languages that are most well-known to the team members. Also, each member should try to learn those aspects they know less about. |
Limited expertise in emerging technologies |
High |
Ignorance of emerging technologies relevant to the project might result in missed opportunities for innovation and efficiency. |
The team has not worked together before |
Low |
A suggestion could be to mantain a good communication and inform about any aspect that could affect others. |
Delivery time |
Medium |
Being many members can difficult the communication. However, if the previous suggestions are followed there should not be any problem. |
Connection failure |
Medium |
It is possible that some of the parts of the project that may require a connection to a server are not available, and due to time it may cause problems. |
Documentation |
Low |
Since the documentation is carried out at the same time as the project, it can generate delays. |
11.2. Technical debts
Technical Debt | Relevance | Considerations |
---|---|---|
Not implementing automated tests from the beginning |
High |
It is not a recommended practice and can avoid problems in the future. |
12. Glossary
Term | Definition |
---|---|
LLM (Large Language Model) |
Large Language Model based on artificial intelligence and deep learning. It is used to process and generate text with contextual understanding, such as OpenAI’s GPT, Google Bard, and others. |
Microservices Architecture |
A software architecture style in which an application is divided into small independent services that communicate with each other through APIs. Each microservice focuses on a specific functionality and can be developed, deployed, and scaled independently. |
Docker |
A containerization platform that allows packaging applications and their dependencies into portable containers. It facilitates consistent execution across different environments without worrying about compatibility issues. |
JavaScript |
An interpreted programming language primarily used for web development. It enables the creation of interactive and dynamic pages, functioning both in the browser and on the server through environments like Node.js. |
React |
A JavaScript library developed by Meta (Facebook) for building interactive and efficient user interfaces. It utilizes a component-based model and a Virtual DOM to improve performance in web applications. |
Node.js |
A server-side JavaScript runtime environment built on Google Chrome’s V8 engine. It allows building scalable and high-performance applications using an asynchronous, event-driven programming model. |
Backend |
The part of an application that handles business logic, databases, authentication, and communication with the frontend. It is typically developed using technologies such as Node.js, Python, or Java. |
Frontend |
The visual interface of an application with which users interact. It is built using HTML, CSS, and JavaScript, along with frameworks like React, Angular, or Vue.js. |
Express.js |
A minimalist web framework for Node.js that simplifies the creation of applications and APIs. It provides tools for handling routing, middleware, and HTTP requests efficiently. |
Term |
… |