Skip to main content

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.

The Global Admin is the top-level authority in HADOS. A single Global Admin account has unrestricted access to every Dado (tournament instance), every registered user, and every configuration option on the platform. This role exists above the Dado Admin tier and is the only account that can create new Dados and appoint the admins who run them.
Only one Global Admin account should exist at any time. The registration secret GLOBAL2026 grants this elevated role — keep it private. Anyone who obtains it can create a second Global Admin account with full access to all tournament data.

Becoming a Global Admin

There are two ways a HADOS account receives the global_admin role. Option 1 — Register with the secret code During the standard registration flow, check the Global Admin option and enter the secret code. The app validates the code client-side before creating the Firebase Auth account:
if (globalAdminSecret !== 'GLOBAL2026') {
  setAuthError('Código secreto de Administrador Global incorrecto.');
  return;
}
resolvedRole = 'global_admin';
When registration succeeds, a HabboUser document is written to the users Firestore collection with role: 'global_admin'. Option 2 — Auto-recovery for the canonical admin email If the account vasquezrivero92@gmail.com signs in and no Firestore profile exists yet, HADOS automatically creates one with role: 'global_admin':
role: user.email === 'vasquezrivero92@gmail.com' ? 'global_admin' : 'jugador'
This ensures the original administrator can always recover access even if the Firestore document is accidentally deleted.

Creating a Dado

A Dado is a self-contained tournament instance — it holds its own player list, ranking, prize configuration, rules, and schedule. Only the Global Admin can create one.
1

Open the Global Admin panel

After signing in, click the Admin Global tab in the navigation bar. This tab is only visible when your account carries the global_admin role.
2

Enter the Dado name

Type a descriptive name for the new Dado in the Nombre del Dado field (e.g. Dado Café 01).
3

Submit the form

Click Crear Dado. HADOS calls handleCreateDado, which writes the following document to the dados Firestore collection:
const newDado: Dado = {
  id: dadoDocRef.id,       // auto-generated Firestore document ID
  name: newDadoName.trim(), // the name you entered
  createdAt: new Date().toISOString()
};
The new Dado is immediately visible in the Dado selector throughout the app.
The full Dado interface includes optional fields that are populated later by the assigned Dado Admin:
interface Dado {
  id: string;
  name: string;
  adminId?: string;         // UID of the assigned Dado Admin
  adminEmail?: string;
  adminName?: string;
  createdAt: string;        // ISO 8601 timestamp
  startDate?: string;       // YYYY-MM-DD
  endDate?: string;         // YYYY-MM-DD
  rules?: string[];
  schedule?: string[];
  totalPrize?: string;      // e.g. '3000 USDT'
  qualifyingCount?: number; // default 12
}

Assigning a Dado Admin

Once a Dado exists and a user has registered on the platform, the Global Admin can promote that user to dado_admin for a specific Dado. This is done through a single atomic batch write that updates two documents simultaneously:
const batch = writeBatch(db);

// 1. Link the user to the Dado document
const dadoRef = doc(db, 'dados', dadoId);
batch.update(dadoRef, {
  adminId: adminUser.id,
  adminEmail: adminUser.email,
  adminName: adminUser.username
});

// 2. Promote the user's role and bind them to the Dado
const userRef = doc(db, 'users', adminUser.id);
batch.update(userRef, {
  role: 'dado_admin',
  dadoId: dadoId
});

await batch.commit();
Both writes succeed or fail together — there is no risk of a Dado pointing to a non-existent admin or a user holding a dado_admin role without a corresponding Dado assignment.
A user can only be a Dado Admin for one Dado at a time. Assigning them to a second Dado overwrites the previous dadoId on their profile.

Managing All Users

The Global Admin is the only role that triggers the full users collection listener. All other roles only see users belonging to their own Dado.
// Fires only when userProfile.role === 'global_admin'
const unsubAllUsers = onSnapshot(collection(db, 'users'), (snapshot) => {
  const list: HabboUser[] = [];
  snapshot.forEach(docSnap => {
    list.push({ id: docSnap.id, ...docSnap.data() } as HabboUser);
  });
  setAllUsers(list);
});
The resulting allUsers state populates the user table in the Global Admin panel, which shows every registered account regardless of Dado affiliation. Each row displays:
  • Habbo username and avatar
  • Email address
  • Assigned Dado (if any)
  • Current role
  • An Assign as Dado Admin button for quickly promoting the user to admin of any Dado

Switching Between Dados

The navbar renders a Dado selector for the Global Admin. Clicking a different Dado updates the activeDado state, which triggers all downstream listeners — the ranked player list, the tournament config panel, and the Dado Admin panel all reload for the newly selected Dado.
// getAvailableDados returns all Dados for global_admin
const getAvailableDados = () => {
  if (userProfile.role === 'global_admin') return dados;
  // ...
};
Use the Dado selector to audit any Dado’s current standings or configuration without leaving the page. The active Dado’s name is always shown in the navbar.

Build docs developers (and LLMs) love