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
Purpose
WiChat is an extension of a previous experimental web application that allowed users to answer quiz questions emulating the "Saber y Ganar" quiz show. This year, the system is being expanded by adding images accompanying all the questions and introducing a conversational hint system powered by an external Large Language Model, enhancing the user experience by providing dynamic and interactive assistance.
The project is requested by RTVE and developed by ChattySw, which will build the application using some pieces of code or modules from the work previously done by HappySw company, but creating the application from scracth.
Scope of Work
WiChat will expand the existing quiz system by:
-
Retaining the core gameplay, where users answer image-based questions from various domains.
-
Introducing an AI-powered hint system for interactive assistance.
-
Keeping automation of questions using Wikidata, minimizing manual effort.
-
Ensuring accessibility through a web-based platform.
-
Add additional features such as custom games and an AI vs user game mode. Additionally, the system should be designed with extensibility in mind, allowing for future improvements.
Driving Forces
The development of WiChat is guided by the following key goals:
-
Enhancing User Engagement: Implementing an interactive AI-based hint system.
-
Automating Content Generation: Using Wikidata to provide dynamically created questions.
-
Ensuring Accessibility: Delivering a web-based solution that is easy to access and use.
-
Providing a Structured Experience: Offering game statistics and historical data for users.
This document will outline the foundational aspects of the system, including its requirements, quality goals, stakeholder expectations and all the strategies and decisions taken.
1.1. Requirements Overview
The main requirements of the system that encapsulates the key features are:
-
The system shall allow unregistered users to sign up.
-
The system shall provide authentication for users to log in.
-
The system shall allow registered users to log out.
-
The system shall allow registered users to play.
-
The system shall allow registered users to check their statistics.
-
The system shall allow users to request hints for a question.
The complete list of requirements can be found in the Annex of the documentation.
1.2. Quality Goals
Quality Goal | Concrete Scenario |
---|---|
Reliability |
The system should be reliable and diverse in generating questions from Wikidata, having no more than 5% of questions with wrong distractors. AI hint system should be accurate and allucinations should be minimized to no more than 2%. The system shall handle user registrations, logins, game data storage and gameplay with an error rate of less than 1%. |
Performance Efficiency |
The system should efficiently handle an increasing number of concurrent users up to 20 while keeping response times below 1 second. AI hint generation should not cause performance bottlenecks. |
Security |
Users' personal data and authentication details should be securely stored. API requests should be protected from unauthorized access. |
Usability |
The UI should be intuitive for first-time users, and game interactions should be easy to understand. The system learning time for a new user should be less than 1 hour. |
Maintainability |
The architecture should be microservices to allow developers to easily add new game modes, AI features, or question sources without major system refactoring. |
1.3. Stakeholders
Role/Name | Contact | Expectations |
---|---|---|
Development Team |
Héctor Triguero del Río - UO288992@uniovi.es, Daniel Fernández Cabrero - UO288499@uniovi.es, Umut Dolangac - UO311846@uniovi.es, Diego Martínez Chamorro - UO294054@uniovi.es |
They aim to develop a clear, scalable, and well-documented system while gaining hands-on experience in software development. |
Development Company |
ChattySw |
They expect the project to be well-structured, maintainable, and extensible, ensuring it meets the client’s needs. |
Previous Developer |
HappySw |
They expect their previous work to be properly used, ensuring compatibility and that they receive their credits when their work is used. |
Client - RTVE |
RTVE Representatives - rtve.dircom@rtve.es |
They hope to receive an engaging quiz application that aligns with their vision and improves their digital presence. |
Client - Professors (Evaluator) |
Pablo González González - gonzalezgpablo@uniovi.es, Jose Emilio Labra Gayo - labra@uniovi.es, Irene Cid Rico - cidirene@uniovi.es, Diego Martín Fernández - martinfdiego@uniovi.es |
They expect a well-structured architectural document, clear software design decisions, and a properly implemented system. |
Users |
End Users |
They hope for a fun and competitive experience, with the ability to view statistics and receive personalized interactions. |
Wikidata (Wikimedia Foundation) |
Wikidata Community |
They hope for correct and responsible usage of their data, including proper attribution and compliance with API policies. |
LLM Provider |
Gemini/Empathy.ai |
They expect proper API usage, adherence to ethical AI practices, and avoidance of misuse that could generate misleading or inappropriate hints. |
Competitors |
Kahoot, Quizziz, Trivia Crack |
They provide a reference for best practices in engagement and accessibility. |
Legal Advisors and Regulators |
GDPR Regulators, RTVE Legal Team |
They expect the system to comply with data protection regulations and respect intellectual property rights. |
2. Architecture Constraints
2.1. Technical Constraints
Constraint | Explanation |
---|---|
WikiData |
The application requires data retrieval and processing to generate questions using images from WikiData. |
Version control and monitoring (GitHub) |
GitHub is a useful tool for version control and collaboration among the team members working on the project. |
User Experience (UI and UX) |
The application’s design must prioritize a user-friendly and intuitive experience. |
Test coverage |
The code must achieve high test quality and coverage to ensure reliable and expected outcomes. |
Data Storage and Management |
User data must be stored securely and efficiently. In order to achieve this goal, database selection is crucial. |
LLM (Large Language Models) |
The application will leverage LLMs for specific functionalities (e.g., question generation, hint.) |
Web Accessible Front-End |
The application will be accessed through a web browser |
2.2. Organizational Constraints
Constraint | Explanation |
---|---|
Team Size and Structure |
The project will be developed by a team of 5 students. |
Git-Based Development |
The project will follow a Git-based workflow. All tools and processes must integrate seamlessly with Git for version control, collaboration, and code management. |
Meetings and Documentation |
Team meetings will be held every Monday to discuss progress, challenges, and next steps. The development process must be documented in meeting minutes, including decisions made, action items assigned, and progress updates. |
Delivery Deadlines |
The project has 3 deliverables, each with a 3-week interval. |
Communication Channels |
The team will use WhatsApp and GitHub for daily updates, discussions, and issue tracking. |
2.3. Political Constraints
Constraint | Explanation |
---|---|
Documentation |
Arc42 template is pre-selected for documentation. |
Language |
Documentation will be written in english and application will support english and spanish. |
3. Context and Scope
3.1. Description
This project consists of a web application in which users can play a quiz game, as well as registering and logging in. Also, it allows to consult information as an API. The quiz game’s questions are generated using an LLM and WikiData.
3.2. Business Context

Communication Partner | Input | Output |
---|---|---|
User |
Interaction with the application like answering to questions, introducing credentials and asking for user data. |
Proper response to the interaction performed by the user. |
WIChat |
Interaction by the user. |
Data to the user like questions, question’s results and user data. |
Wikidata |
Queries from the application for obtaining information from Wikidata. |
Data returned from the Wikidata database that is asked for in the query. |
LLM |
Queries from the application for generating hints. |
The hints that have been generated by the LLM. |
3.3. Technical Context

Component | Description |
---|---|
User |
The user that interacts with the application. |
User device |
The device used by the user to interact with the application. |
User agent |
The browser through which the user can request and access the application. |
Cloud |
The cloud that hosts the application. |
WIChat |
The application which the users can interact with. |
Database |
Database that stores all the data of the application. |
Wikidata |
Returns data to the application requested by SPARQL queries received. |
LLM |
Generates and returns hints based in the queries received. |
4. Solution Strategy
4.1. Technology decisions
-
JavaScript: It is the chosen programming language for this application. After comparing it with TypeScript, we concluded it is the best choice taking into account easiness in the use and team experience.
-
React: We have chosen this JavaScript library for the UI because it is the industry standard and other alternatives don’t provide any benefits compared to it and it’s easy use.
-
Node.js: We decided to use it so we use JavaScript both in the frontend and backend. Also, since Mongoose, which will be used to comunicate with the database, is a Node.js library, Node.js is a good option for this application.
-
Docker: We chose it since several members of the team have experience with it and it’s easy to learn for new users compared to other alternatives. Also, it’s open-source and user friendly.
-
MongoDB: We decided to use this document database due to its flexibility and simple query language.
-
Microsoft Azure: We chose this platform since it provides the needed infrastructure and the team members have experience with it.
-
Express.js: We have chosen this web application framework for Node.js due to its high flexibility, its easy use and learning and its powerful middleware.
There are more technology decisions that are not listed here, but they are not as relevant as the ones listed above. The complete list can be found in the Architecture Decisions section of the documentation.
4.2. Top-level decomposition decisions
-
Non-pure microservices pattern: This pattern is used, so the application is divided into different components with a responsibility each one. This makes the different components independent and lowly coupled, allowing mantainability. Also, it reduces possible conflicts between the development carried out by the team members and the code dependencies. The pattern is non-pure to reduce the complexity of the application and redundancies between the microservices.
-
Gateway pattern: This pattern is chosen because it allows to give the application a single request interface that redirects requests by the user to the appropiate application component. It is the appropiate pattern to complement the Microservices pattern due to these reasons.
4.3. Decisions to achieve key quality goals
-
Mantainability: The application will be well structured and documented to allow a proper mantainability.
-
Usability: A user-friendly application will be developed, as well as intuitive.
-
Testability: Multiple tests will be performed on the application to ensure the proper functioning of the application and to ensure there are no errors.
4.4. Organizational decisions
-
Use of a Github repository for the project.
-
Weekly meeting of the team to review and discuss work done during the week, to take decisions for the project and assigning tasks that must be made.
-
Communication between members and task assigning using Github Issues.
-
For a quick and agile communication, use of a WhatsApp group of the team.
-
Keep track of all the work done by the team using Github Projects, linking on it the different Issues.
-
Record the weekly meeting minutes and details and project decisions by means of Github Wiki.
5. Building Block View
5.1. Context
- Contained Building Blocks
Building Block | Brief description |
---|---|
WiChat |
Overall system that is being documented. |
Player |
Regular players of the game which interact with the system through the web interface. |
API User |
Users of the different public APIs. |
WikiData |
API used to generate questions and answers for the game. |
LLM |
LLM API used to generate hints for the game. |
5.2. Whitebox Overall System
- Motivation
-
We divided the system into microservices according to their responsibilities to ensure:
-
simplicity: Each component is minimal and is responsible for a single function, which makes it easier to understand and maintain.
-
reusability: Microservices have interfaces which can be easily used by other new or old components if required.
-
independence: Components are made as independent as possible, also dependencies are always on stable abstractions protecting client services from the implementation.
-
maintainability: Each component is simple and as independent as possible from the others allowing fast understanding and reducing the probability of making mistakes.
-
extendability: New features can be added easily by adding new code to components or by adding new components, avoiding having to modify / rewrite code.
-
switchability: External services can be easily replaced by other services by just writing an adapter.
-
Note
|
Check LLM Service for an example of reusable design. |
- Contained Building Blocks
Building Block | Brief description |
---|---|
LLM Service |
Serves as an adapter for the external LLM service. |
Questions Service |
Generates questions using WikiData. |
Game Service |
Manages game states and tracks the user’s progress. |
Statistics Service |
Tracks and provides statistics for the users. |
Authentication Service |
Handles login, signup and session for the users. |
Gateway |
Proxies some services to the Internet and supports the WebApp. |
WebApp |
Provides the web UI. |
- Interfacing
-
-
The different microservices communicate with each other via RESTful APIs using an intranet.
-
The Gateway and WebApp are the only services which allow external requests and communicate with eachother through Internet.
-
LLM Service and Question Service also communicate with the external LLM and WikiData respectively using the Internet.
-
-
5.2.1. LLM Service
- Motivation
-
This thin module could be integrated in Questions Service, but we decided to keep it separate to promote reusability, since one of the optional requirements is using AI for anything other than hints.
- Purpose
-
Act as a bridge (adapter) between the external LLM service and the other internal services of the application.
- Interface
-
Internal RESTful API for communication with the other internal microservices.
- Structure
-
Just an Express.js app with an adapter for the external LLM.
5.2.2. Statistics Service
- Purpose
-
Tracks and provides statistics for the users.
- Interface
-
Internal RESTful API for communication with the other internal microservices.
- Structure
-
It’s a typical Express.js application with a model for the statistics and a database adapter to store the data.
5.2.3. WebApp
- Purpose
-
Provides the web UI for the application.
- Interface
-
Web UI for the users.
- Structure
-
Follows the structure of a typical React application with several routes.
5.2.4. Gateway
- Purpose
-
Proxies some services to the Internet (public API) and supports the WebApp. Adds "firewall" mechanisms typical of APIs: ratelimiting, HTTPs, security headers, etc.
- Interface
-
RESTful API exposed to the Internet with a subset of the internal services.
- Structure
-
It’s a typical Express.js application with middleware, proxy and endpoint documentation modules.
5.3. Level 2
5.3.1. White Box "Questions Service"
- Purpose
-
Generates questions and hints ensuring performance and correctness.
-
Questions and answers are generated through WikiData.
-
- Motivation
-
Handles the responsibility of generating questions.
- Why is WikiData part of the module and not standalone?
-
Since the service is used only for generating questions and answers (and this will most likely remain true), it is more efficient to have it as part of the module and reduce the overall system complexity at the cost of increasing the module’s one.
- Contained Building Blocks
Building Block | Brief description |
---|---|
WikiData Adapter |
Serves as an adapter for the external WikiData API. |
Questions Module |
Generates questions from the WikiData information. |
Questions Cache |
Allows caching of questions to reduce the load on the WikiData API. It is necessary for performace reasons. |
Express.js Server |
Provides an internal RESTful API for the rest of microservices. |
5.3.2. White Box "Auth Service"
- Purpose
-
Allows users to login, signup and verify their local session.
- Motivation
-
Keeps the user’s sensitive data and session separate from the rest of the application to ensure higher standards of security and privacy.
- Contained Building Blocks
Building Block | Brief description |
---|---|
Data Model |
Represents the user’s data. |
DB Adapter (Mongoose) |
Provides persistence for the model entities. |
Login Handler |
Allows login and obtaining a session. |
Register Handler |
Allows registering a user. |
Verify Handler |
Allows verifying an user session. Internal service |
Encryption Utilities (Argon2/JWT) |
Provides encryption utilities to secure sessions and stored passwords. |
Configuration |
Provides configuration for the service. |
Validators |
Provides validation inputs. |
Server (Express.js) |
Provides an internal secured RESTful API for the rest of microservices. |
5.3.3. White Box "Game Service"
- Purpose
-
Responsible for connecting Questions Service with Statistics Service, that way we can keep track of the user’s progress and provide statistics. It also generates hints using LLM Service.
- Motivation
-
Takes care of the game logic and user’s progress. Also it tracks the user’s progress to provide statistics.
- Contained Building Blocks
Building Block | Brief description |
---|---|
Game Manager |
Keeps track of user games and fires stats events. |
Hints Module |
Generates hints using the LLM Service. |
Express.js Server |
Provides an internal secured RESTful API for the rest of microservices. |
6. Runtime View
6.1. Abstract states of the application
-
General usage, the user arrives to the application, creates an account or logs in, goes through the menu settings and plays. The state diagram shows the relation of the different situations of the app.

6.2. Login of a user
-
Login, the app shows the login interface, where the user is asked for the username and password, and the possibility to create an account.
When logging, the app does a login request to the authentication service through the GatewayService, which redirects the user to the identity provider, which handles the authentication by checking the registered users. If the login is succesfully, the app shows the different options of the game. In case the login isn’t succesfully, a warning message is shown.

6.3. Game
-
Game transitions and process behind the user interface.
When playing, the user interface interacts with the distribution facade Gateway, in charge of hiding the back-end services, business and persistance layers.

6.4. Statistics of a user
-
Statistics of a user.
When the user enters the view, statistics about themselves are shown.

7. Deployment View
7.1. Infrastructure Level 1

Motivation:
The system uses Docker to keep services isolated and portable, ensuring smooth transitions between development, testing, and production. A microservices approach separates key functions like authentication, game logic, stats, and question handling, allowing independent scaling and preventing failures in one service from affecting the rest.
A central API Gateway simplifies client interactions and enhances security by preventing direct access to internal services. External services like WikiData and an LLM API handle question generation and AI-driven hints, reducing infrastructure complexity and using external computing power.
Quality and/or Performance Features:
This system is built to handle growth. Each part can be scaled up as needed. In this diagram we use containers, so if we need more of something like the Question Service, we can easily add it. With Docker-compose we can automate this.
Security is important.The API Gateway adds a layer of security by managing and authenticating all incoming requests.
If something goes wrong, the container system helps because if one part fails, it can be restarted without affecting the others. We also have logging and monitoring to help us find and fix problems quickly.
We’ve focused on performance too, MongoDB is used for flexible and efficient data storage for game info.
- Mapping of Building Blocks to Infrastructure
Artifact | Infrastructure |
---|---|
webapp (React) |
WebApp Container |
gatewayservice (Node.js/Express) |
Gateway Container |
authservice (Node.js/Express) |
AuthService Container |
statservice (Node.js/Express) |
StatsService Container |
gameservice (Node.js/Express) |
GameService Container |
questionservice (Node.js/Express) |
QuestionsService Container |
llmservice (Node.js/Express) |
LLMService Container |
Database (MongoDB) |
Database Container |
8. Cross-cutting Concepts
8.1. User Experience (UX)
The user experience in the system involves the design of the user interface and the level of accessibility, usability and satisfaction that it provides. As the part of the system that the user interacts with, the focus is put in providing a user-friendly interface, which gives a proper user experience. This user experience is a key concept in web applications such as the one developed, in which a high degree of usability is required for the user’s satisfaction and overall experience.
8.2. Internationalization
As a key part of User Experience, Internationalization (i18n) is a very important part in the system. The adjustment to several languages and the flexibility it provides, allows the system to be user-friendly, providing a high usability to several types of users based on their languages, overrunning language barriers.
8.3. Architectural patterns
The system follows several architectural patterns: Microservices pattern, so the system is composed of different independent components, and Gateway pattern, which provides a single interface for all the users that manages and redirects all their requests. The use of these architectural patterns provides a high degree of mantainability and also high flexibility in the development.
8.4. Security
As a key in all types of systems, security is a very important concept in this one and its development. Resources and data are protected and only provided to allowed users, implementing an authentication systemps that enforces the system’s security.
8.5. Error handling
Proper error handling techniques are implemented in each system’s component to ensure the reliability and availability of the system. Every call or dependency between components or important parts is managed to throw and detect types of errors and not propagate them thorughout the application, sending proper messages and codes to the different components to ensure the availability of the system and its proper working without failing. This enhances, in case an error occurs, the user experience so the user is informed if some process can not be carried out.
8.6. Observability
The system is designed to be observable, allowing gateway request monitoring from Grafana + Prometheus, as well as a more rudimentary monitoring of the different components through the use of a common and consistent logging system. This system allows logging errors, warnings and requests among others. It also enables faster debugging. Lastly the system is configured to censor sensitive information in the logs, such as authentication tokens and referrers.
9. Architecture Decisions
The ADRs (Architecture Decision Records) are stored in the GitHub Wiki of the project and are available at: https://github.com/Arquisoft/wichat_en1c/wiki/Decision-Records
10. Quality Requirements
The system must maintain a high level of operational stability and accuracy. This is measurable through several key indicators:
-
Question Generation Accuracy: The rate of incorrectly generated distractors in quiz questions sourced from Wikidata should be less than 5%.
-
AI Hint Accuracy: The AI-powered hint system should provide accurate and relevant hints, with the occurrence of hallucinations or misleading information being less than 5% of hint requests.
-
Core Functionality Error Rate: The system’s handling of user registrations, logins, game data storage, and gameplay should have an error rate of less than 1%.
The system must provide a responsive and efficient user experience, even under moderate load. This can be measured by:
-
Concurrent User Capacity: The system should be able to handle up to 20 concurrent users while maintaining an average response time for critical user interactions (loading questions, submitting answers, requesting hints) below 1 second.
-
AI Hint Generation Latency: The time taken to generate an AI hint should not introduce a performance bottleneck, adding no more than 1 second to the overall response time for a hint request.
The confidentiality and integrity of user data and system access must be ensured. Measurable aspects include:
-
Data Storage Security: User personal data and authentication credentials must be stored using robust encryption algorithms and protected against unauthorized access.
-
API Access Control: API endpoints should be secured through authentication and authorization mechanisms (JWT), preventing any successful unauthorized access attempts as verified by security testing.
The system should be intuitive and easy to use for all users, including those new to the application. This can be evaluated by:
-
First-Time User Success Rate: At least 80% of new users should be able to successfully register and complete a basic game within 10 minutes without needing external assistance.
-
User Interface Clarity: User feedback should indicate that at least 90% of users find the game interactions to be "easy to understand."
-
Learning Curve: The average time required for a new user to become proficient with the core functionalities of the system should be less than 1 hour, as measured by their ability to complete defined tasks during an onboarding process.
The system’s architecture should facilitate future modifications, extensions, and bug fixes with minimal effort and risk. This can be assessed by:
-
Modularity for New Features: Adding a new game mode or integrating a new question source should require modifications to no more than 5% of the existing codebase and be achievable within a timeframe of 2 weeks.
-
Ease of Updating External Dependencies: Updating the AI hint model or integrating a completely new LLM service should be possible with a development effort of no more than 3 days.
10.1. Quality Tree
-
Quality
-
Reliability
-
[login] (Core Functionality)
-
[start-game] (Core Functionality)
-
[answer] (Core Functionality)
-
[hint] (AI Hint Accuracy)
-
[stats] (Core Functionality)
-
-
Performance Efficiency
-
[login] (Response Time)
-
[start-game] (Response Time)
-
[answer] (Response Time)
-
[hint] (AI Hint Generation Latency)
-
[stats] (Response Time)
-
-
Security
-
[login] (Authentication)
-
(Implicitly covers all interactions involving user data)
-
-
Usability
-
[login] (First-Time User Success)
-
[start-game] (First-Time User Success)
-
[answer] (User Interface Clarity)
-
[hint] (User Interface Clarity)
-
[stats] (User Interface Clarity)
-
-
Maintainability
-
[email-add] (Modularity)
-
[new-game] (Modularity)
-
[switch-LLM] (Modularity)
-
-
10.2. Quality Scenarios
Usage Scenarios
Change Scenarios
11. Risks and Technical Debts
Considering the recent loss of a team member, the team’s tendency towards end-of-sprint workload accumulation, challenges with branch merging due to testing, and the adoption of new technologies, the following are key risks and potential areas of technical debt that require attention (Relevance from 1(low) to 3(high)):
Category & Item |
Relevance |
Considerations & Potential Mitigation |
Team Capacity Risk: Loss of a team member. |
2 |
Reduced team capacity directly impacts velocity and potentially deadlines. Mitigation: Re-evaluate current workload distribution, prioritize critical tasks, explore options for temporary or permanent replacement, and ensure thorough knowledge transfer from the departed member. |
Workflow Risk & Potential Debt: End-of-sprint workload spikes. |
2 |
Accumulating work at the end of a sprint leads to rushed implementations, increasing the risk of bugs and impeding sustainable pace. It can also result in "quick fixes" that introduce technical debt. Mitigation: Implement stricter "work in progress" limits, encourage continuous integration and testing throughout the sprint, and focus on completing tasks earlier. |
Code Integration Risk & Potential Debt: Branch merge conflicts due to testing issues. |
2 |
Frequent merge conflicts disrupt development flow and signal potential issues with test coverage, quality, or understanding. This can lead to hastily resolved conflicts and hidden technical debt. Mitigation: Enhance team understanding and application of testing strategies, enforce stricter test requirements before merging, and consider more robust branching strategies. Investigate the root causes of test failures and conflicts. |
Technology Adoption Risk & Potential Debt: Limited experience with React, MongoDB, Jest, and Puppeteer. |
1-2 (reducing over time) |
While the team is using these technologies, a lack of deep understanding can lead to suboptimal implementations, performance issues, or maintainability challenges (potential technical debt). Mitigation: Encourage ongoing learning through documentation, tutorials, and internal knowledge sharing. Implement thorough code reviews focusing on best practices for these technologies. Dedicate time for focused learning on testing frameworks. |
Implicit Knowledge Risk: Reliance on individual team member knowledge. |
1 |
Despite efforts towards knowledge sharing, some critical aspects or modules might still heavily rely on the understanding of specific team members. Proactive knowledge transfer and documentation of key functionalities and architectural decisions are crucial to ensure maintainability by the entire team. |
12. Test Report
Our application has been tested using the following methods:
12.1. Unit tests
Unit tests were written to test each microservice independently, by mocking the dependent microservices and ensure each microservice works as expected.
The unit tests were written using the Jest framework, which is a popular testing framework for JavaScript applications.
12.1.1. Coverage
These tests have a minimum required coverage of >80% of the codebase which, at the time of writing this report is, 86.8%.
For a more detailed report about the coverage, refer to the following link.
12.2. Acceptance / integration tests (E2E tests)
Integration tests were written using the Cucumber framework, and Jest as the execution platform.
A total of five sets of tests were created to ensure all features of the application are covered and tested.
These tests allow verifying that the system behaves as expected when all components interact together.
The functionalities that were tested are:
-
Register
-
Login
-
Game flow
-
Statistics storage and display
-
Customization of game
12.3. Load tests
Load tests were written using the Gatling framework, which is a popular testing framework for load testing.
A load test comprising all the features except for custom games was created and run by 20 active users at a time. Overall the test output was positive, as the system was able to handle the most of the load without issues, thus proving the "performance" quality attribute.
The last test report can be found in the repository.

12.3.1. Issues found
Some performance issues were detected during the load tests, and an issue in the repository was created to track them:
-
We detected that the question service struggled with getting the first question, which took >1200ms almost half of the time. The question service should be improved to be able to handle more requests.

To solve it the queries to WikiData were optimized which improved a lot the timings.

-
Also, we detected that serving the background video stream was a bottleneck, so it should be moved to an external CDN to alliviate the load on the WebApp.

We currently don’t have means for solving this issue, but we are aware of it and will try to solve it in the future.
13. Glossary
Term | Definition |
---|---|
Question |
A set comprising: a textual question referring to an image, the image itself, and a series of options where one is correct while the others serve as distractors. |
Distractor |
A wrong answer to a question. The distractors are the options that are not correct, and they are used to mislead the user into selecting them instead of the correct answer. |
LLM (AI) |
A large language model is a type of artificial intelligence that uses deep learning techniques to understand and generate human-like text. It is trained on vast amounts of text data and can perform various natural language processing tasks, such as text generation, translation, summarization, and more. In the context of this project, the LLM is used to generate hints based on questions. |
Hint |
Textual clue or suggestion provided to the user (when requested) to help them answer a question correctly. These are generated by the LLM based on the question and the image associated with it. |
Docker |
A platform for developing, shipping, and running applications in isolated environments called containers. Used in WiChat for service isolation and portability. |
Docker-compose |
A tool for defining and managing multi-container Docker applications. |
Microservices Approach |
The architectural style of building an application as a collection of small, independent services. |
API Gateway |
The Gateway component that acts as a single entry point for all client interactions, simplifying access to backend services and enhancing security. |
HTTPS |
Hypertext Transfer Protocol Secure, a protocol for secure communication over a computer network, widely used on the Internet. |
SPARQL |
SPARQL is a simple query language for data in RDF format (Resource Description Framework). It helps find specific information by describing patterns. |
14. Annex
14.1. Functional Requirements
14.1.1. Registration
-
FR-REG-1: The system must allow unregistered users to create an account.
-
FR-REG-1.1: The system shall require the following information for registration:
-
FR-REG-1.1.1: Username (mandatory and unique).
-
FR-REG-1.1.1.1: The username must be:
-
FR-REG-1.1.1.1.1: Longer than or equal to 5 characters
-
FR-REG-1.1.1.1.2: Shorter than or equal to 20 characters
-
FR-REG-1.1.1.1.3: Alphanumeric (no special characters allowed)
-
-
-
FR-REG-1.1.2: Password (mandatory).
-
FR-REG-1.1.2.1: The password must have at least one from each of the following:
-
FR-REG-1.1.2.1.1: Uppercase letter.
-
FR-REG-1.1.2.1.2: Lowercase letter.
-
FR-REG-1.1.2.1.3: Number.
-
FR-REG-1.1.2.1.4: Special character.
-
-
FR-REG-1.1.2.2: The password must have at least 8 characters.
-
-
FR-REG-1.1.3: Confirm Password (mandatory).
-
FR-REG-1.1.3.1: The input must be the same as the one in the Password field.
-
-
-
-
FR-REG-2: The system shall validate input data.
-
FR-REG-2.1: If any field is invalid, the system shall prevent registration.
-
-
FR-REG-3: The system shall check for duplicate accounts.
-
FR-REG-3.1: If an account with the same username already exists, the system shall prevent registration.
-
14.1.2. Login and Logout
-
FR-LOG-1: The system must allow unidentified users to log in.
-
FR-LOG-1.1: The system shall require the following information for log in:
-
FR-LOG-1.1.1: Username (mandatory).
-
FR-LOG-1.1.2: Password (mandatory).
-
-
-
FR-LOG-2: The system shall validate login credentials.
-
FR-LOG-3: The system must allow logged-in users to log out at any time.
14.1.3. User Data Management
-
FR-UPD-1: The system must allow users to access their historical data.
-
FR-UPD-1.1: The system shall display the following statistics for each user:
-
FR-UPD-1.1.1: Number of games played.
-
FR-UPD-1.1.2: Number of questions answered correctly.
-
FR-UPD-1.1.3: Number of questions answered incorrectly.
-
FR-UPD-1.1.4: Number of questions unanswered.
-
FR-UPD-1.1.5: Total time played.
-
FR-UPD-1.1.6: Minimum time spent per game.
-
FR-UPD-1.1.7: Maximum time spent per game.
-
FR-UPD-1.1.8: Average time spent per game.
-
FR-UPD-1.1.9: Minimum time spent per question.
-
FR-UPD-1.1.10: Maximum time spent per question.
-
FR-UPD-1.1.11: Average time spent per question.
-
FR-UPD-1.1.12: Total number of questions answered.
-
FR-UPD-1.1.13: Accuracy percentage (based on correct/total questions).
-
-
14.1.4. Game Session
-
FR-GAME-1: The system shall allow only authentified users to play.
-
FR-GAME-1.1: The game shall consist of 10 rounds.
-
FR-GAME-1.1.1: Each round shall include:
-
FR-GAME-1.1.1.1: A generated question from Wikidata using a template.
-
FR-GAME-1.1.1.2: A set of possible answers (one correct, at least one distractor).
-
FR-GAME-1.1.1.3: An image from Wikidata related to the question.
-
FR-GAME-1.1.1.4: A time limit of 20 seconds to answer the question.
-
-
-
FR-GAME-1.2: The system shall move to the next round when:
-
FR-GAME-1.2.1: An answer is submitted.
-
FR-GAME-1.2.2: Time runs out.
-
FR-GAME-1.2.2.1: When time runs out the question is considered incorrectly answered.
-
-
-
FR-GAME-1.3: The game shall end after all the rounds are completed.
-
-
FR-GAME-2: The system shall allow authentified users to play against the AI.
-
FR-GAME-2.1: The configuration would be the same as the normla game.
-
FR-GAME-2.2: At the end of the game the result of the game shall be informed to the user.
-
14.1.5. Hint System
-
FR-HINT-1: The system shall allow users to request hints for a question.
-
FR-HINT-1.1: The hints shall be generated using an LLM.
-
FR-HINT-1.1.1: The system shall send to the LLM:
-
FR-HINT-1.1.1.1: The message from the player.
-
FR-HINT-1.1.1.2: An additonal message explaining that it is being used as a hint provider for a quiz game.
-
FR-HINT-1.1.1.3: The question.
-
FR-HINT-1.1.1.4: The correct answer.
-
FR-HINT-1.1.1.5: The distractors.
-
FR-HINT-1.1.1.6: The previous hints given by the LLM for that question if possible.
-
-
-
FR-HINT-1.2: The system shall allow up to 3 hints per question.
-
FR-HINT-1.3: After getting a hint, there will be a cooldown of 3 seconds for asking again.
-
14.1.6. Custom Games
-
FR-CGAME-1: The system shall allow users to create custom game sessions.
-
FR-CGAME-1.1: The system shall allow users to customize:
-
FR-CGAME-1.1.1: Number of rounds.
-
FR-CGAME-1.1.2.1: The minimum number will be 1 round.
-
FR-CGAME-1.1.2.2: The maximum number will be 50 rounds.
-
FR-CGAME-1.1.2.3: There will be an option for infinite rounds.
-
FR-CGAME-1.1.2.3.1: In this case, the game will end when a question is answered incorrectly.
-
-
-
FR-CGAME-1.1.2: Time per question in seconds.
-
FR-CGAME-1.1.2.1: The minimum time will be 10 seconds.
-
FR-CGAME-1.1.2.2: The maximum time will be 60 seconds.
-
-
FR-CGAME-1.1.3: Hints per question.
-
FR-CGAME-1.1.3.1: The minimum will be 0 hints.
-
FR-CGAME-1.1.3.2: The maximum will be 5 hints.
-
-
FR-CGAME-1.1.3: There will be an option for AI game mode.
-
FR-CGAME-1.1.4: Question categories.
-
FR-CGAME-1.1.4.1: If no category is selected, all categories would be active.
-
-
-
14.1.7. Question Management
-
FR-APIQ-1: The system shall provide an API to access generated questions.
-
FR-APIQ-1.1: The API shall include endpoints to retrieve questions and answers.
-
FR-APIQ-1.2: The API shall be documented for developers.
-
14.1.8. User Data Access
-
FR-APIU-1: The system shall provide an API to access user data.
-
FR-APIU-1.1: The API shall include endpoints for retrieving user statistics.
-
FR-APIU-1.2: The API shall be documented for developers.
-