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 goal of this application is to develop an application which functionality is similar to the “Saber Y Ganar” Spanish program on TV. Users will have to choose an answer in several questions proposed extracted from WikiData, these questions will be automatically generated by its API.
Furthermore, for the development of this application the use of GitHub is required to have a repository with all members of the development team using several tools provided by this service. In addition to that the application will have to save the entrance of different users on a database, allowing them to make different tracking and having previous results of that specific user.
Also, it must be said that during each question an IA assistant should be helping the user in case of need. This would require us, the development team, to use different LLM that is still to be decided which one will be use.
Our overall goal is to generate user satisfaction while playing this game, trying out different modes and using certain aids that, when used correctly, will be key to achieving a good number of points and placing yourself in a good position in the rankings.
1.1. Requirements Overview
1.1.1. Functional Requirements
Related to the WebApp Service:
-
The game must allow users to play a game with several rounds and each of them having 4 possible answers with only one correct. Also, several modes can be choosen in order to make the game different each time.
-
The application must save the correct answers and tracking them in a good way to the data base for having correct stadistics that then can be check by the user, in its home page.
-
The system for hints must work properly in order to not use them in all rounds. Only when the cost can be payed correctly.
Related to the LLM Service:
-
The game must have a chat that needs to have a conversation with the user when it is required, giving clues but without saying the correct answer under any circumstance.
Related to the Question Service:
-
This service must provide different possible questions and save them in the database, then randomly one will be choosen.
Related to the Gateway Service:
-
The game should have the endpoints in this service, making all the application working around it.
Related to the User/Auth Service:
-
This two services are under the same directory. They will be in charge of adding users to the aplication and then allow them to enter with their credetials. Moreover, this service (userservice) must be also in charge of saving the stadistics of the user.
1.1.2. Non-Functional Requirements
Related to the LLM Service:
-
The given chat must not give large answers without any reliable information.
Related to the QuestionService:
-
The time to response from the moment when a question is required to when it is printed on the screen must not be huge.
1.2. Quality Goals
Goal | Description |
---|---|
Testability |
Our application is going to gave more than 85% of code coverage so the tests are going to be strong. |
Usability |
Our application is going to be very intuitive, allowing new users to navigate through it quickly. People from all ages will be checked that are capable of playing. |
Portability |
Our application will allow its deployment of different devices at different times, without having a huge penalization on response times. |
Security & Privacy |
Our application will only allow the users themselves to see its own results, without considering some rankings that will involve all users. Also for entering into the application you must be authorized, you cannot jump through the url between different windows. |
Performance |
Our application will be loading tests to confirm that runs correctly under “heavy conditions” in which there is much traffic of users. For example, for 10 users our application is going to answer in the same way, related with response times, than if there is only one user. |
1.3. Stakeholders
Role/Name | Contact | Expectations |
---|---|---|
RTVE |
- High-quality, functional quiz platform |
|
ChattySw |
- Clear requirements and deadlines |
|
Professors |
Pablo González: gonzalezgpablo@uniovi.es |
- Regular progress reports |
Development team |
Víctor Llana Pérez - uo294629@uniovi.es |
- Clear requirements and deadlines |
Wikidata (Data Provider) |
- Accurate and reliable data used for question generation |
|
Empathy |
- Increased user engagement through their LLM |
|
Users |
- |
- Easy registration and login |
2. Architecture Constraints
TECHNICAL CONSTRAINTS
Constraint | Explanation |
---|---|
Name |
The application must be called WIChat. |
Game description |
The game will consist of showing a picture and the users guessing what it is about. |
Obtaining the hints |
Some hints for the game must be obtained from an external Large Language Model (LLM) through an API. |
Source of information |
Information about the questions and answers must be directly obtained from Wikidata. So should be the disctractors and the images. |
Access to information |
The system will give access to the information about the generated questions and users through an API. |
Deployment |
The application must be accessible through a web interface. |
Tracking the work |
The development of the application must be on a given public repository in GitHub. |
ORGANIZATIONAL CONSTRAINTS
Constraint | Explanation |
---|---|
Developers |
The application must be developed by a team of approximately 4 members. |
Developing time |
The application must be developed by May. Also, it has to follow some deliveries throughout the semester. |
Organization of the work |
Several meetings will be held by the group members to discuss further things to do. |
Project management |
Git will be used to manage and document the project and advances. |
3. Context and Scope
3.1. Introduction
WiChat is a game designed for an online experiment done by RTVE, with the typical TV quiz contest format. To implement this application, we need to call several external APIs. Wikidata is the one in charge of giving us the information we require for the questions and the answers, and also the images the user is going to see, which are the main part of the application. We also use an LLM for generating some hints for the user (in form of wildcards) and a database for storing the user log-in information.
3.2. Business Context

Communication Partners | Input | Output |
---|---|---|
User |
The user sees the web application in real time and makes decisions accordingly. |
Performs actions on the application such as answering a question, using a wildcard or asking a question to a chatbot. |
WebApp |
Receives user inputs and data from backend services. |
Updates the interface to show to the user. |
Gateway Service |
Takes actions from users received from the web application. |
Sends the requests to the corresponding endpoints. |
Question Service |
Receives a query about a theme or category. |
Returns a page corresponding to the given query. |
LLM Service |
Gets relevant information about the question the user has to answer. |
Interacts or answers the user in several ways, depending on the used wildcard. |
3.3. Technical Context

Communication Partners | Explanation |
---|---|
WebApp |
The user can play the game using Internet, via HTTP. |
Gateway Service |
Manages the requests and redirects them to the respective APIs. |
Database |
MongoDB database for storing users information and the required information about the answers and distractors of the question, each of them with an image. |
Question Service |
Data is obtained throught SPARQL queries and stored in the database due to this service. Furthermore, each round of the game, the four options (and the image of the correct one) are requested to this service, which takes them randomly from the database according with the selected topic/s. |
LLMService |
Gives relevant hints about the question the user has to answer. |
4. Solution Strategy
The application is built on the MERN stack, a full-stack combination of source-available technologies used for building web-based applications on a simpler and more agile manner. It consists of:
Name | Explanation |
---|---|
MongoDB |
NoSQL database which uses JSON-like documents with optional schemas. We choose it over relational databases to make use of its scalability and flexibility to store large amounts of data. |
Express.js |
Backend framework for Node.js. It will simplify the process of building APIs. |
React.js |
Front-end JavaScript library. Despite the loading overhead, it will help us build a modern and fast UIs for the application. |
Node.js |
Open-source cross-platform JavaScript Runtime environment which will be used to build the backend of the application. It is widely used and has an enormous amount of available libraries, wich makes it one of the best approaches for most web applications. |
4.1. Decompositon of the system
The main architectural pattern to be used in the application is to divide different responsibilities in their own respective microservice, creating a logical separation between modules. This will help to coordinate the team and reduce conflicts while working on different microservices of the application, easing development. For the authentication microservice, we will be combining statelessess, a token-based model and API Gateway orchestration for a robust and scalable authentication system. Other microservices, such as the game microservice, or LLM microservice and WikiData querying microservice, will be based on either a MVC pattern or a Client-server or Controller-Responder model. As for design patterns, we will use template method to manage the behavior of the questions in different gamemodes and possibly the factory pattern to create the different questions.
4.2. Achieving quality goals
Goal | Steps to achieve it |
---|---|
Testability |
We will aim for a high test coverage of the code for the application, using the adequate tools to achieve this. |
Usability |
We will perform usability tests, like using dummy users and testers, and we will extend the application to be accesible. |
Portability |
We will test the application in different environments, and use up-to-date frameworks and tools to ensure maximum compability. |
Security |
We will follow best security practices, and use checklists to ensure there aren’t major security flaws in our application. |
4.3. Other organizational decisions
Since we will be building a microserviced application, we will be using a microservice-oriented gitflow for version control. It will be a single repository (monorepo) where there is a folder for each service. We will also follow GitHub Flow for a straightforward development strategy.
We will also follow SCRUM with 1-week sprints for the development cycle. Since we are heavily constricted by time, this will be our best alternative.
With respect to testing, we will use Jest for unitary testing, which helps us improving our productivity by executing tests automatically and in a fast way. It also includes very clear reports of the tests and, in case they fail, the reason why this happens. The tools it provides for mocking modules or functions are really great, which allow us to test just the parts of the application we want for each test in an efficient way. Furthermore, it is compatible with several frameworks, such as React and Node.js (the ones we are using), which makes it perfect for testing our application.
5. Building Block View
5.1. Whitebox Overall System

- Motivation
-
The purpose of this diagram is to represent the system in the most general way possible, outlining the main application from the external components that are also in use.
- Contained Building Blocks
Name | Responsibility |
---|---|
WIChat |
Central web Application, acts as the primary interface for the user and acts as mediator between external data sources and services. |
Wikidata |
Repository of factual, well-organized, and machine-readable data that can be queried and leveraged to support the system’s functionality. |
LLM |
Will generate appropiate hints in response to user queries, will also process data from Wikidata to generate said hints. |
- Important interfaces
-
-
User ↔ WIChat: Direct interaction through UI.
-
WIChat ↔ Wikidata: Structured data retrieval for factual information and images.
-
WIChat ↔ LLM: Natural language understanding and response generation.
-
5.2. Level 2

Name | Responsibility |
---|---|
Frontend |
Manages user interaction and presentation. |
Backend |
Handles logic, coordination, and communication between the frontend, database, and external services. |
Database Layer |
Provides secure and efficient storage and retrieval of data for the application. |
5.3. Level 3

Name | Responsibility |
---|---|
Authentication Service |
Handles user authentication, login and signup. |
User Service |
Retrieves the data of the users as well as their stadistics to generate the ranking. |
Game Service |
Manages game state and logic. Uses more concrete services like LLM and Question to divide responsibilities. |
LLM Service |
Provides chat functionality, sending requests to an LLM, receiving and processing responses to show hints to the user. |
Question Service |
Creates and provides questions using data obtained from Wikidata. |
Gateway Service |
Manages the interaction between the frontend and the backend. Handles the requests, assigning them to the corresponding backend endpoint. |
We have decided that the communication between the backend (Question service) and Wikidata takes place when the application starts, storing all the necessary information in the database for using it later. We do this communication so early in the application because this approach helps up optimizing the performance. This way, when a user arrives to the actual game, all the information is already stored and ready to be used, because it has been obtained and stored in the back while the user was navigating through the screens that appear previous to the game (login, topic selection, mode selection…).
6. Runtime View
6.1. Sign up
The user wants to create a new account and register it for the future. Data must be valid and not collide with some account that already exists.

6.2. Log in
The user wants to log in with an account that has already been created.

6.3. Playing a game
Selecting the game mode and playing it.

6.4. LLMChat during a game
The application has a chatbot which can give hints during a round in the game, under no circumstances will it say the correct option. This is the procedure that follows when is invoked:

6.5. Show statistics
Seeing the statistics of the round, and general at each category.

7. Deployment View
7.1. Infrastructure

- Motivation
-
The diagram above represents the initial version of our architecture, outlining the separation between its components. Our design follows a client-server model, where the server communicates with Wikidata to retrieve questions. This clear distinction between the frontend (client) and backend (server) ensures modularity, allowing different implementations to remain interchangeable as long as they adhere to the common API.
We utilize a server hosted on Oracle, providing an isolated and pre-configured environment optimized for running our services. Hosting on Oracle helps reduce infrastructure costs and enhances flexibility.
We use Docker because it helps package our application and its dependencies into a standardized unit, ensuring it runs consistently across different environments, regardless of the machine’s setup. Instead of using a monolithic architecture, we’ve chosen a microservices approach with Docker containers. This allows each service to be isolated, with its own resources, preventing conflicts and improving scalability and resilience. Each service has its own Docker image, which gives us flexibility in development and deployment. Our project includes services like the web application, gateway, user authentication, and MongoDB server. This Docker-based setup makes deployment, management, and resource use more efficient, while boosting flexibility and scalability.
- Quality and/or Performance Features
-
Our Docker-based microservices architecture enhances both quality and performance by ensuring each service runs independently in its own container, optimizing resource allocation and preventing conflicts. This setup improves scalability, allowing services to scale as needed without affecting others. Additionally, it streamlines deployment and maintenance, reducing downtime and ensuring a consistent, high-performing system across different environments.
- Mapping of Building Blocks to Infrastructure
-
The web app, gateway, and services run within Docker containers, all hosted on a server. The server manages these containers and communicates with Wikidata to retrieve questions. The gateway connects the web app with the services, while the services handle user data and generate questions.
Component | Description |
---|---|
Web App |
User interface that interacts with the rest of the application. |
Gateway |
Manages communication between the web app and various services. |
User Service |
Manages user data and statistics, providing some functions for API consumers. |
Auth Service |
Handles user authentication. |
LLM Service |
Provides hints to the user while playing. |
Question Service |
Manages pictures and data for the questions. |
Database (MongoDB) |
Stores user data and game history. |
Empathy |
External LLM used to obtain the hints. |
WikiData |
External API used to retrieve information from WikiData. |
8. Cross-cutting Concepts
8.1. Motivation
The cross-cutting concepts form the foundation of the system’s conceptual integrity, enabling a coherent and consistent approach to development. They help achieve key qualities like accessibility, user experience, security, and scalability, which are important across various components of the system.
8.2. Domain Concepts
The quiz game is designed to allow users to choose from predefined categories sourced from Wikidata, creating a dynamic and personalized experience. The system supports multiple categories that users can combine to create customized quizzes. The following domain concepts are integral:
-
Categories and Questions: Categories are predefined areas from Wikidata, such as history, science, or geography. Users can select any number of categories to tailor their quiz experience. The system retrieves relevant questions from Wikidata based on these categories.
-
Game Modes: The game supports different modes, such as playing with a time limit or in rounds. Players can also choose to play a single category or a mix of all available categories. This provides flexibility and variety in gameplay.
-
User Profiles: Users can log in, track their progress, and view their historical performance and rankings. Each user profile includes a personalized quiz history, best scores, and achievements.
8.3. User Experience (UX) Concepts
-
Responsibility and Accessibility: The design is focused on ensuring the game is accessible to a wide range of users, including those with color blindness. To ensure inclusivity, the game avoids color schemes that could cause issues for color-blind players and focuses on accessible contrast and fonts.
-
Round-based Play: Users can choose to play in rounds, where each round presents a set of questions, and the game tracks performance across multiple rounds.
-
Time-based Play: Alternatively, players can play against the clock, answering questions as quickly as possible to compete with others or themselves.
-
Clues and Help Options: Players have the option to use several clues, such as hints or using an LLM chat to help them answer difficult questions. Users can mimmick a call a friend for assistance using game stats to determine the best options for asking for help or even ask the audience.
-
Ranking and History: A ranking system tracks the performance of players, allowing users to see how they compare to others. Historical data is stored to allow users to review past quizzes and track improvement over time.
8.4. Technology and Architecture Concepts
The system is built using React and JavaScript to provide a dynamic and interactive user interface. The architecture is designed with the following concepts in mind:
-
React Components: The game’s interface is built using reusable React components, making the system modular and easy to maintain.
-
Wikidata Integration: The game interacts with Wikidata via predefined categories. When a user selects a category, the system fetches questions dynamically, ensuring a rich and diverse quiz experience.
-
State Management: React’s state management system is used to track user selections, game progress, and scores. It ensures a smooth and responsive experience as users navigate through the game.
-
Oracle Deployment: The game will be hosted on Oracle to ensure scalability, flexibility, and easy deployment. Oracle provides a secure and robust infrastructure for hosting both the frontend and backend components.
8.5. Development and Operational Concepts
-
Agile Development: The project is developed using an Agile methodology, specifically in 3-week sprints. This allows for iterative development, rapid feedback, and continuous improvement.
-
Continuous Deployment: The game is deployed through Oracle, with automated build and deployment pipelines to ensure smooth updates and patches.
-
Scalability: As the number of users grows, the system is designed to scale horizontally. Oracle’s cloud infrastructure supports scaling to handle increased traffic and ensure high availability during peak usage times.
9. Architecture Decisions
ELEMENT | OPTIONS | DECISION | REASON |
---|---|---|---|
Architecture |
Microservices, frontend & backend |
Microservices |
We chose the microservices architecture for its scalability, flexibility and decoupling, allowing the game to evolve easily and handle increased loads efficiently. |
Language |
Java, JavaScript |
JavaScript |
The initial prototype was written using JavaScript so we decided to keep on with it. |
Backend framework |
SpringBoot, Express, Node.js |
Express, Node.js |
Since we chose JavaScript as the language, this options would make integration with the front easier. |
Database |
MongoDB (NoSQL), PostgreSQL, MySQL |
MongoDB |
MongoDB was the database used in the prototype of the project so we continued with it. It allows flexible storage of questions and answers, along with horizontal scalability. |
Cloud service |
Oracle Cloud, Azure Cloud |
Oracle cloud |
We started using Azure but Oracle offers more flexibility and it’s easier to use so we finally decided to change. |
Frontend |
React |
React |
Although we had never worked with it before, it is a powerful framework which provides predefined and reusable components. |
Deployment |
Docker |
Docker |
It is a fast option and allows an easy maintaining of the application. Also, it was the option used in the initial prototype. |
LLM |
Empathy (Mistral, Qwen), Gemini |
Mistral |
We tried the three options and they all met our needs for the project but we decided to stick with Mistral, which was an option in the initial prototye. |
Wikidata |
Direct HTTP request, Wikidata Query Service (WDQS), MediaWiki Action API, Wikibase REST API, Dumps |
WDQS |
We decided to use the Wikidata Query Service, with queries in SPARQL, making data retrieval structured and efficient without overloading our backend. |
Component navigation |
React-router, Link |
React-router |
This option provides efficient route and state management, preventing component conflicts and enhancing user experience. |
10. Quality Requirements
10.1. Quality Tree
The Quality Tree is a structured representation of the key quality attributes of our system. The root represents the overall concept of "Quality," which is then divided into different branches representing essential quality attributes derived from our Quality Goals (section 1.2). Each branch further expands into measurable and concrete evaluation scenarios.
Below is an outline of the Quality Tree:
-
Quality
-
Testability
-
Maintain at least 85% code coverage.
-
Implement automated testing for all major functionalities.
-
Usability
-
Ensure an intuitive user interface suitable for all age groups.
-
Conduct usability tests with different user demographics.
-
Portability
-
Deploy the application on various devices with minimal performance impact.
-
Security & Privacy
-
Restrict user data access to authorized individuals.
-
Implement secure authentication mechanisms.
-
Performance
-
Maintain consistent response times regardless of concurrent users.
-
Perform load testing to simulate heavy traffic conditions.
Each of these categories will have detailed scenarios describing expected system behavior under different conditions.
10.2. Quality Scenarios
10.2.1. Usage Scenarios
Scenario ID |
Scenario Description |
UQ-01 |
A user selects an answer, and the system provides feedback within one second. |
UQ-02 |
A user requests a hint, and the AI assistant provides contextual guidance without revealing the answer. |
UQ-03 |
The application maintains stable response times (under 500ms per request) even with 100 concurrent users. |
UQ-04 |
A new user navigates the application for the first time and completes a game without requiring external guidance. |
UQ-05 |
A request to fetch a new question returns a response from the database within 300ms. |
10.2.2. Change Scenarios
Scenario ID |
Scenario Description |
CQ-01 |
Integration of a new LLM model should not degrade performance beyond a 10% increase in response time. |
CQ-02 |
Adding a new game mode should not require modifications to more than 10% of the existing codebase. |
CQ-03 |
Migrating the database to a new provider should require only configuration changes without altering business logic. |
CQ-04 |
Enhancing security policies should not introduce more than 5% additional latency per request. |
By defining these scenarios, we ensure that our system meets stakeholder expectations and maintains high-quality standards throughout its lifecycle.
11. Risks and Technical Debts
11.1. Risks
Risk | Description | Severity | What to do? |
---|---|---|---|
Jumping though the URL |
This can be so dangerous as some users that maybe enter our application as guest arrive to points that are reserved for logIn users. Also we can face situations in which a user can go directly to /game without selecting the mode of playing or even the categories. |
High |
Authentication methods must be used in order to solve this and restricting each area depending the case, maybe some only for users that are authenticated or different cases depending the window. |
LLM Giving the correct answer |
Can happen that the LLM if it does not receive the corrent propmt can give the answer directly to the user, and this is not its purpose. It must give clues without saying the correct answer or neither discarting the rest of the options. |
Medium |
Try to perfect the prompt in order to avoid games that are completly useless as the LLM can say the correct answer. |
LLM Time Response |
Can make the user wait for a huge time until he/she recieves and answer. And the problem is not only that because our ChatBot must be conversational and in case of make wait in each message it will be a loss of time considerable. |
Medium |
Testing a lot what the response time is for giving hints and try different models. |
Repeated Questions |
Can happen that as we save in the database all the different possible questions, that two questions from the same image appears in the consecutive questions, which is not a good approach |
Low |
Is weird this to happen because in our queries we retrieve like 100 options but maybe implementing something like a cache to avoid the repetition of it unless in the same game, it would be nice. |
Credentials With Low Security |
As we have our application the logIn/signUp not requires a specific length of the password or normal things related to security that are asked. |
Low |
Maybe this can be solved by putting some rules when creating new users in order to avoid this things to happen. |
Low level README and Doc |
It will not happen because we already have a powerfull README and the DOC too but it can be a risk to not add the correct information in the different points because the first thing that is see in the README and then the doc. |
Low |
Try to work on it during all the deliverables and improve it. |
11.2. Technical Debt
At this point we cannot think of one, as it is true that is our first time dealing with these new technologies but besides the initial part of getting into it, we cannot think as some of them that are making as working worse or slower.
12. Glossary
12.1. Techniques
Term | Definition |
---|---|
Authentication |
The process of verifying a user’s identity to grant access to different parts of the application. |
Authorization |
Determines what actions or resources a user has permission to access based on their authentication status. |
Caching |
A technique used to store frequently accessed data to improve performance and reduce API calls. |
Kanban |
A project management methodology that visualizes work using boards and columns to track progress efficiently. |
Sprint |
A three-week development cycle in which specific tasks and features are implemented and tested. |
Deployment |
The process of making the application live and accessible to users. Initially planned to be done using Azure, finally Oracle was chosen. |
Technical Debt |
The cost of additional work caused by choosing a quick but suboptimal solution in software development. |
12.2. Terminology
Term | Definition |
---|---|
Wikidata |
A free, collaborative knowledge base that provides structured data, used as the primary source for quiz questions. |
RTVE |
Radiotelevisión Española, the Spanish public television broadcaster and one of our stakeholders. |
Saber y Ganar |
A famous Spanish TV show involving answering questions to win prizes. |
Business Risk |
Potential challenges that could impact the success of the project, such as missed deadlines or low user engagement. |
Game Mode |
The different ways users can play the quiz, such as timed rounds or standard question-answer sessions. |
Clues |
Hints provided to help users answer quiz questions, generated either by the LLM or other game mechanics. |
Ranking System |
A feature that tracks and displays user scores to create competition among players. |
Accessibility |
Design choices made to ensure the game is usable by as many people as possible, including those with disabilities (e.g., colorblind-friendly UI). |
12.3. Technologies
Term | Definition |
---|---|
React |
A JavaScript library for building user interfaces, used for developing the frontend of the quiz game. |
LLM (Large Language Model) |
A type of artificial intelligence model, such as ChatGPT, used to generate hints and assist players in the game. |
API (Application Programming Interface) |
A set of rules and protocols that allow different software applications to communicate with each other, such as fetching data from Wikidata. |
OAuth / JWT |
Authentication mechanisms used to secure user logins and manage access. |
MongoDB |
A NoSQL database used for storing data in a flexible, document-based format. |