HADOS persists all tournament data in two Firestore collections, each backed by a strict TypeScript interface.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/VasquezRivero92/HabboCafe/llms.txt
Use this file to discover all available pages before exploring further.
HabboUser represents every participant or staff member in the system, while Dado represents a tournament environment (dice group). Understanding these shapes is the starting point for any integration, admin scripting, or security-rule authoring.
HabboUser
Every authenticated player, intermediary, Dado Admin, and Global Admin is stored as aHabboUser document inside the users collection. The document ID equals the Firebase Authentication UID for self-registered accounts, and is an auto-generated Firestore ID for players added manually by staff.
Field reference
Firestore document ID. Equals
user.uid from Firebase Auth for self-registered accounts. For players added manually via the Crear Usuario modal, this is an auto-generated Firestore document reference ID.The player’s Habbo Hotel nickname exactly as it appears in the game. This value is used verbatim to construct the avatar image URL and to query participations across multiple Dados.
For self-registered users this is the real email address they signed up with. For players added manually by staff, the application writes a synthetic placeholder:
{username}@dummy-habbo.com (all lowercase). These dummy addresses allow the app to store a consistent email field without requiring the player to create a Firebase Auth account.Tournament score accumulated by the player within their Dado. Stored with up to one decimal place of precision (e.g.
42.5). The app uses parseFloat(...toFixed(1)) on every write to enforce this precision. Points can be negative during subtraction but are floored at 0 in all UI actions.The player’s rank as it was before the most recent points update. Used by the leaderboard to render the rank-change arrow (↑ / ↓ / –).
The player’s rank after the most recent sort-and-batch-write cycle. Ranks start at
1 and increment without gaps.Pre-computed Habbo avatar image URL. The pattern is:The leaderboard also appends
&headonly=1 inline when rendering small circular avatars, but the stored avatarUrl field does not include that parameter.ISO 8601 timestamp string generated with
new Date().toISOString() at the moment the document is first written.The user’s stored role. Note that the effective role displayed in the UI is computed by
getActiveRole() (see Permissions), which may differ from this stored value depending on which Dado is currently active.The Firestore document ID of the
Dado this user belongs to. This field is omitted for global_admin accounts, which have access to all Dados.global_admin users do not have a dadoId field. All queries that filter by dadoId will therefore exclude them, which is intentional — Global Admins see all Dados via a separate full-collection listener.Dummy email pattern
When a staff member adds a player manually through the Crear Usuario modal, HADOS cannot create a Firebase Auth account on their behalf (only the player themselves can do that). To maintain a consistentemail field across all documents, the app synthesises a placeholder address:
Example Firestore document
Dado
A Dado is a self-contained tournament environment — think of it as a dice room or competitive group. Each Dado has its own leaderboard, rules, schedule, prize configuration, and assigned admin. Thedados collection stores one document per Dado; the document ID is always Firestore auto-generated.
Field reference
Auto-generated Firestore document ID, created when the Global Admin submits the Generar Dado form.
Human-readable name of the Dado, e.g.
"Dado VIP" or "Dado Alpha". Displayed in the navbar badge and throughout the admin panels.Optional invite or join code. Reserved for future feature development; not currently used by any UI logic.
The Firebase Auth UID of the user who has been assigned as Dado Admin. Set via a batch write that simultaneously updates the
Dado document and the target HabboUser document. Used by getActiveRole() to determine whether the current user is the Dado Admin without relying solely on their stored role field.Denormalized email of the Dado Admin, written alongside
adminId for display purposes in the staff panel.Denormalized Habbo username of the Dado Admin. Displayed in the Intermediarios tab with their avatar.
ISO 8601 timestamp generated at the moment the Global Admin creates the Dado.
Tournament start date in
YYYY-MM-DD format (e.g. "2025-06-20"). Set (or reset) when the Dado Admin triggers Crear Nuevo Torneo. The UI renders this as DD/MM using the formatTournamentDate() helper.Tournament end date in
YYYY-MM-DD format. Displayed alongside startDate in the Info tab.Array of rule strings. Each element corresponds to one line entered in the Reglas textarea in the Dado Admin panel. Stored and retrieved preserving the original order.
Array of schedule/calendar strings, following the same one-element-per-line convention as
rules.Free-text description of the prize pool, e.g.
"3000 USDT" or "1000 Credits + VIP Badge". Defaults to "3000 USDT" in the admin form if not yet set.How many top-ranked players from this Dado qualify for the grand final. Defaults to
12 if not configured.Example Firestore document
Relationship: HabboUser ↔ Dado
The two models are linked by a single foreign-key field:HabboUser document with dadoId: "dado_vip_001" belongs to the Dado whose document ID is "dado_vip_001". This relationship is one-to-one at the Firestore-document level: each player document belongs to exactly one Dado. However, the same Habbo username can appear in multiple Dado documents (because Dado Admins can manually add the same player to their own Dado), so participation queries use where('username', '==', ...) to find all records for a given real user.
global_admin users have no dadoId field. They are not participants in any specific Dado and instead gain access to all Dados via a full-collection onSnapshot listener on dados.