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.

Firebase is the sole backend for HADOS. It provides the real-time Firestore database that stores tournament and user data, as well as the Authentication service that handles organizer sign-in. No other server-side infrastructure is required — Firebase handles persistence, querying, and identity entirely from the client.

Setting up Firebase

1

Create a Firebase project

Open console.firebase.google.com and click Add project. Give it a name (e.g. hados-production), optionally enable Google Analytics, then click Create project.
2

Enable Firestore Database

In the left sidebar go to Build → Firestore Database and click Create database. Choose a region close to your users, then select a starting mode:
  • Production mode — all reads and writes are denied until you write security rules. Recommended for live deployments.
  • Test mode — all reads and writes are allowed for 30 days. Useful during initial development.
Click Enable to provision the database.
3

Enable Email/Password Authentication

Go to Build → Authentication and click Get started. On the Sign-in method tab, click Email/Password, toggle it Enabled, and click Save. HADOS uses this provider for organizer accounts — no other sign-in methods are required.
4

Register a Web App and copy the config

From the project overview page click the Web icon (</>). Give the app a nickname (e.g. hados-web) and click Register app. Firebase will show you a firebaseConfig object — copy the entire object, you will need it in the next step.
5

Paste the config into src/firebase.ts

Open src/firebase.ts in your editor and replace the placeholder values with the config object you copied from the Firebase console.

The firebase.ts module

src/firebase.ts is the single entry point for all Firebase services in the app. It initialises the Firebase app and exports the two service instances used throughout HADOS:
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import { getAuth } from 'firebase/auth';

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "your-project.firebaseapp.com",
  projectId: "your-project-id",
  storageBucket: "your-project.firebasestorage.app",
  messagingSenderId: "YOUR_SENDER_ID",
  appId: "YOUR_APP_ID",
  measurementId: "YOUR_MEASUREMENT_ID"
};

const app = initializeApp(firebaseConfig);
export const db = getFirestore(app);
export const auth = getAuth(app);

Exports

ExportTypePurpose
dbFirestoreUsed for all Firestore reads and writes — tournament groups, participants, and results.
authAuthUsed for organizer sign-in, sign-out, and auth-state observation.
app (internal)FirebaseAppThe root initialized app instance. Consumed internally by db and auth; not re-exported.

Firestore collections

HADOS uses two top-level Firestore collections:
CollectionDescription
usersStores HabboUser documents representing registered players and organizers.
dadosStores Dado tournament-group documents, each representing a dice-roll group in a tournament round.
Neither collection needs to be created manually — Firestore creates them automatically the first time your application writes a document to them.
The Firebase Spark (free) plan is sufficient for running small to medium Habbo dice tournaments. Spark includes 1 GiB of Firestore storage, 50,000 daily reads, and 20,000 daily writes — more than enough for a typical HADOS event.
The firebaseConfig object contains your API key and other project identifiers. Never commit real Firebase credentials to a public repository. Move the values to environment variables before pushing to GitHub or any public host. See the Environment Variables guide for the recommended approach using Vite’s import.meta.env.

Build docs developers (and LLMs) love