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
1.1. Context and Motivation
WIChat is a web-based question-and-answer application where users must guess the location of an image. The platform automatically generates questions based on Wikidata and allows users to receive hints through an external language model (LLM). This functionality adds a conversational component to the game, enhancing the user experience.
RTVE has contracted ChattySw to update an experimental version of the online contest previously developed by HappySw, incorporating new interactive hint functionalities and improving the gameplay experience.
1.2. Key Requirements
The system must meet the following requirements:
-
A web application accessible from any browser.
-
User registration and authentication.
-
Automatic question generation based on Wikidata.
-
The ability to obtain hints generated by a language model (LLM) via an API.
-
Validation and mitigation of incorrect responses from the language model.
-
Time control for answering each question.
-
A documented API for accessing questions and user data.
-
Automatic generation of correct and incorrect answers (distractors).
1.3. Quality Objectives
The following quality objectives will guide architectural decisions:
Objective | Priority | Description |
---|---|---|
Scalability |
High |
The system must support a growing number of users without affecting performance. |
Availability |
High |
The application must be available at all times with minimal downtime. |
Security |
High |
Protection of user data and validation of responses generated by the LLM. |
Usability |
Medium |
Intuitive interface and smooth user experience. |
Maintainability |
Medium |
Modular and well-documented code to facilitate future improvements. |
1.4. Stakeholders
The following stakeholders are involved in the development and use of the system:
Role | Contact | Expectations |
---|---|---|
Client (RTVE) |
Ensure that the application meets contract requirements. |
|
Development Team (ChattySw) |
Implement the system according to quality objectives. |
|
Users |
Registered in the application |
Access an interactive and seamless gaming experience. |
2. Constraints
2.1. Technical Constraints
The following technical constraints affect the development of WIChat:
-
Web Technology: The application must be developed using modern web technologies (React.js for the frontend and Node.js/Python for the backend).
-
Database: PostgreSQL or MongoDB will be used for data storage.
-
Language Model: A language model (LLM) will be integrated through an external API.
-
Question Source: Questions must be automatically generated based on Wikidata data.
-
Response Time: Answers to questions must be recorded within a set time limit.
2.2. Organizational Constraints
The following organizational constraints affect the project:
-
Delivery Deadlines: The application must be operational before the project closure as agreed.
-
Documentation: The architecture and development must be documented following the arc42 standard.
-
Open Source: The source code must be hosted in an accessible repository for review and tracking.
2.3. Security and Privacy Constraints
To ensure user security and privacy, the following constraints are established:
-
Data Management: User data must be protected in compliance with data protection regulations.
-
Response Validation: Potential errors or "hallucinations" from the language model must be mitigated to prevent incorrect information in hints.
These constraints will define the boundaries within which WIChat will be designed and developed.
3. Context and Scope
3.1. Business Context

3.2. Technical Context

4. Solution Strategy
4.1. Types of Decisions
4.1.1. 1. Organizational Decisions
These decisions are related to the work structure and how the team is organized.
-
Using a Kanban-style project: The decision to use a visual task management approach, Kanban, to organize work and ensure that all team members know the status of tasks and what remains to be done.
-
Using GitHub Flow as a workflow: The decision to adopt a GitHub Flow-based workflow, allowing all team members to collaborate easily through Pull Requests and ensuring that all code is reviewed before being merged into the main branch.
4.1.2. 2. Technical Decisions
These decisions are related to how the project is built and the tools used.
-
Using a starter template: The decision to begin with a basic but functional project, allowing for a quick start with a pre-configured structure that works, avoiding the need to build everything from scratch.
-
Starting the project from scratch: Although a starter template can be used, the decision is to create a new project from scratch. This helps the team become more familiar with the code and project structure. Additionally, the previous project can be used as a reference to solve problems or improve the design without relying on it directly.
4.1.3. 3. Quality and Maintenance Decisions
These decisions are about ensuring that the project is high quality and easy to maintain.
-
Using GitHub Flow and Pull Requests: Through Pull Requests, we ensure that every code change is reviewed by the team before integration, maintaining code quality and minimizing errors in the main branch.
5. Building Block View
5.1. Whitebox Overall System
5.1.1. Overview Diagram

5.1.2. Motivation
WIChat is a real-time messaging system that allows users to communicate via text, images, and other media. The system’s architecture is modular, facilitating scalability and integration with different technologies.
5.2. Contained Building Blocks
Name | Responsibility |
---|---|
Frontend |
Web and mobile user interface. |
Backend API |
Handles authentication, messaging, and business logic. |
Database |
Stores users, conversations, and messages. |
Wikidata |
Structured data source to enhance user experience. |
Language Model for Hints |
Provides intelligent suggestions and autocomplete for messages. |
5.3. Important Interfaces
Database Access: Interface between the API and the database.
Wikidata API: Accesses structured and relevant data.
Language Model: Interface with the AI system for text suggestions.
5.4. System Components
5.4.1. Frontend
Purpose / Responsibility
Provide an interactive interface for the user.
Send and receive real-time messages.
Manage sessions and contacts.
Interfaces
Graphical user interface.
Connection to the API for authentication and data retrieval.
Use of the language model for message suggestions.
5.4.2. Backend API
Purpose / Responsibility
Manage user authentication and authorization.
Provide access to message and user data.
Integrate with other services (Wikidata, Language Model).
Interfaces
API for communication with the frontend.
Connection to the database for data storage.
Access to Wikidata to enrich the user experience.
Integration with the language model for message assistance.
5.4.3. Database
Purpose / Responsibility
Store information about users, messages, and conversations.
5.4.4. Wikidata
Purpose / Responsibility
Provide structured data to enhance the user experience in the chat.
Interfaces
Wikidata API to obtain relevant real-time information.
5.4.5. Language Model for Hints
Purpose / Responsibility
Offer intelligent suggestions and message autocomplete.
Interfaces
AI API for text analysis and response generation.
5.5. Level 2

5.5.1. White Box Gateway Service
Module | Functionality |
---|---|
WebApp |
Provides the user interface and manages user interaction. |
Gateway Service |
Acts as an intermediary between the WebApp and other system services. |
Users Manager |
Handles user management, including authentication and profiles. |
Question Manager |
Processes and manages user questions. |
Wikidata |
Structured data source used to answer questions. |
5.6. Component Description
5.6.1. WebApp
Purpose / Responsibility:
Provide an interactive interface for users.
Allow access to system functionalities.
Send and receive requests through the Gateway Service.
Interfaces:
Connection with the Gateway Service to manage users and questions.
5.6.2. Gateway Service
Purpose / Responsibility:
Centralize communication between the WebApp and other services.
Manage request and response routing.
Interfaces:
Bidirectional communication with WebApp, Users Manager, and Question Manager.
5.6.3. Users Manager
Purpose / Responsibility:
Manage users and their profiles.
Administer authentication and access permissions.
Interfaces:
Connection with Gateway Service for user validation and data retrieval.
5.6.4. Question Manager
Purpose / Responsibility:
Process user questions.
Retrieve relevant information from Wikidata.
Interfaces:
Communication with Gateway Service and Wikidata for information queries.
5.6.5. Wikidata
Purpose / Responsibility:
Provide structured data to enrich responses to user questions.
Interfaces:
Query API used by the Question Manager.
5.7. Level 3
5.7.1. White Box Message Handling (Backend API)
Component | Description |
---|---|
Message Storage |
Manages message persistence in the database, ensuring integrity and availability. |
5.7.2. White Box Wikidata Integration
Component | Description |
---|---|
Data Retrieval |
Queries relevant data from Wikidata in real time to enhance user experience. |
6. Runtime View
-
At this stage, we have not yet started development, so the runtime scenarios are still undefined. Once the implementation progresses, we will document key runtime interactions, including authentication flows, data storage, and relevant communication between system components.
-
For now, the following section will be updated as we gain a clearer understanding of how different components interact in real-time.
7. Deployment View
7.1. Infrastructure Level 1

In addition to what is shown in the diagram, we will also use arc42 for documentation.
- Motivation
-
Initially, the application is deployed using Docker in developers systems, depending on resource availability. This way, each developer will have a local deployment environment for testing.
- Quality and/or Performance Features
-
-
The system is designed with microservices, each running in its own container for better scalability and fault tolerance.
-
A database service will be used for structured data, and a File Storage Service will handle multimedia content.
-
arc42 documentation will be managed within a dedicated Docker container.
-
8. Cross-cutting Concepts
8.1. User Experience (UX)
-
Usable Interface:
Ease of Use |
A simple, predictable, and familiar interface design will be presented, ensuring that all essential elements and options of the application are easily accessible. |
Intuitive |
The system will provide an intuitive interface, making it easy for users to understand. |
Stability |
The application’s loading times will be minimized to ensure a smooth experience. |
-
Immediate Feedback: The user will instantly see whether their answer was correct or not. Additionally, the game history, rankings, and generated questions will always be up to date.
8.2. Security & Protection
-
Secure Access Control: User authentication security will be enforced by verifying the correctness of the entered credentials and denying access otherwise.
8.3. Under-the-Hood
-
Persistence: Both user data and game records will be stored to ensure their integrity and availability.
-
Maintainability: The code is written clearly and legibly, following a modular approach to facilitate maintenance when fixing bugs or adding improvements.
-
Extensibility: The application is built in a way that allows new functionalities to be added easily in the future without significantly affecting existing components.
8.4. Development
-
Implementation: The application will be developed using JavaScript. The front-end will be built with React, while Node.js and microservices architecture will be used for the back-end. MongoDB will be used for managing the NoSQL database.
-
Testing: Various tests will be conducted to ensure a high-quality product.
8.5. Architectural Style
-
Layers: A three-layer architecture will be implemented to ensure better organization and modularity:
Presentation |
Responsible for operating and generating the graphical interface displayed to the user. |
Business Logic |
Where all the necessary logic for the correct operation of the application will be executed. |
Persistence |
Used to store and retrieve various data needed for both the player and the question-and-answer game system. |
8.6. Concept Map

9. Architecture decisions
-
These decisions are not final and may change as the project evolves. They represent our current approach based on the available information and team expertise, but adjustments might be necessary as we gain more experience and face new challenges.
Decision | Reasons | Disagvantanges |
---|---|---|
JavaScript |
We have decided to develop the application using JavaScript because, in addition to having some prior knowledge, working with the provided template encourages us to do so, avoiding unnecessary complexity in the initial development phase. |
It is a complex language that can cause us problems while other simpler languages could make our work easier. |
React.js |
It is the most popular JavaScript framework, with extensive documentation available. |
None of us in the team have worked with it before, so we will all need to learn how to use it. |
MongoDB |
As a non-relational database, it offers ease of use. Additionally, it is widely adopted by major telecommunications companies. |
Non-relational databases are the ones with which we have the least experience. |
10. Quality Requirements
The WIChat system prioritizes five critical quality attributes to ensure success:
-
Usability:
-
Goal: An intuitive interface that allows users to play and access hints easily.
-
-
Maintainability:
-
Goal: Modular and well-documented code to facilitate updates.
-
-
Performance:
-
Goal: Low latency in critical operations:
-
Question generation.
-
LLM response.
-
-
Security:
-
Goal: Data protection and resistance to attacks.
-
-
Functionality:
-
Goal: Reliably meeting key business requirements:
-
Automatic question/answer generation from Wikidata.
-
Conversational hints with hallucination mitigation (RAG).
-
These requirements guide technical decisions and ensure the system meets both RTVE’s expectations and the end-user experience.
10.1. Quality Tree
Quality Attribute | Goal/Description | Associated Scenarios |
---|---|---|
Usability |
Intuitive interface for gameplay and hint access |
|
Maintainability |
Modular and well-documented code for updates |
|
Performance |
Low latency in question generation and LLM responses |
|
Security |
Data protection and resistance to attacks |
|
Functionality |
Reliable question/answer generation with hallucination mitigation (RAG) |
10.2. Quality Scenarios
Scenario | Stimulus/Source | Environment | Artifact | Expected Response |
---|---|---|---|---|
SC-1: Accurate question generation |
System needs a new question |
Normal load |
Wikidata Service |
Question generated with verified data (no hallucinations) |
SC-2: Performance under load |
500 users start a game simultaneously |
Peak demand |
Question API |
Low generation latency |
SC-3: User data protection |
Unauthorized attempt to access sensitive data |
Brute force attack |
Database |
Encryption of sensitive data |
SC-4: Intuitive hint access |
New user tries to get a hint |
First use |
User interface |
Hint accessible |
SC-5: Maintainability of topics |
Developer adds "European History" topic |
Development environment |
Codebase |
Topic integrated quickly |
11. Risks and Technical Debt
11.1. Technical Risks
-
Inadequate Version Control Management
-
Possible Issues
-
GitHub conflicts due to multiple team members collaborating.
-
Risk of code loss or overwriting.
-
-
Preventive Measure
-
Define a clear Git workflow with mandatory Pull Requests.
-
-
-
Tight Deadlines and Lack of Experience
-
Possible Issues
-
Inability to complete planned tasks due to other courses or poor time estimation.
-
Difficulties in implementing advanced features due to lack of experience in JavaScript.
-
Increased number of errors due to limited proficiency in the language.
-
-
Preventive Measure
-
Better task organization and development time estimation.
-
Self-learning of the language to improve proficiency.
-
-
-
Documentation Deficiencies
-
Possible Issues
-
Code with few comments and insufficient technical documentation.
-
Difficulty for other team members to understand the existing code.
-
-
Preventive Measure
-
Maintain clear and up-to-date documentation in the GitHub repository.
-
-
-
Lack of Automated Testing
-
Possible Issues
-
Dependence on manual testing, which is prone to errors.
-
Increased time to detect and fix bugs.
-
-
Preventive Measure
-
Introduce unit and functional testing using tools like Jest or Mocha.
-
-
-
Lack of Code Standards
-
Possible Issues
-
Different programming styles within the team.
-
Difficulty in unifying code from different team members.
-
-
Preventive Measure
-
Define common code standards to ensure consistency and ease of collaboration.
-
-
-
Inefficient and Repetitive Code
-
Possible Issues
-
Lack of modularity and code reuse.
-
Difficulty in project maintenance and scalability.
-
-
Preventive Measure
-
Apply modular programming principles and perform periodic refactoring.
-
-
-
Suboptimal Performance
-
Possible Issues
-
Inefficient use of data structures and algorithms.
-
Potential performance issues during application execution.
-
-
Preventive Measure
-
Review and optimize the code once it is functional.
-
-
11.2. Technical Debt
11.2.1. There is no technical debt
Currently, there is no significant technical debt in the project. However, we will monitor the codebase to ensure that technical debt does not accumulate over time.
12. Glossary
Term | Definition |
---|---|
JavaScript |
JavaScript is a high-level, dynamic, and event-driven programming language primarily used for web development. It is an interpreted language, prototype-based, and weakly typed, running in the browser through the JavaScript engine. It can also be used on the backend with environments like Node.js. |
Frontend |
JavaScript in the frontend is used to manipulate the DOM, handle events, and enhance web interactivity. It runs in the browser and works alongside HTML and CSS to create dynamic experiences. Frameworks like React make it easier to develop more structured and efficient applications. |
React |
React is a JavaScript library for building user interfaces efficiently and modularly. It follows a component-based approach and uses a Virtual DOM to improve performance. Developed by Facebook, it is primarily used in the frontend to create interactive and dynamic web applications. |
Backend |
On the backend, JavaScript is used with environments like Node.js to handle servers, databases, and business logic. It enables API creation, HTTP request management, and database connections with systems like MongoDB. |
Node.js |
Node.js is a JavaScript runtime environment based on Chrome’s V8 engine, designed to execute code outside the browser. It is asynchronous and event-driven, making it ideal for real-time applications and scalable servers. It uses the CommonJS module system and has npm for package and dependency management. |
MongoDB |
MongoDB is a NoSQL document-oriented database that stores data in BSON format (similar to JSON). It is scalable, flexible, and allows handling large amounts of data without a fixed structure. It integrates well with Node.js and is commonly used in modern web applications. |