HADOS is a client-side single-page application — the entire app compiles down to static HTML, CSS, and JavaScript files in theDocumentation 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.
dist/ directory. There is no application server required; all backend logic is handled by Firebase. This makes deployment straightforward: build the assets, then serve them from any static host or the included server.js.
Building for production
Configure environment variables
Ensure your Firebase credentials are available as
VITE_ prefixed environment variables (either in .env.local for manual builds or as platform secrets for CI). See the Environment Variables guide for the full variable list.Run the production build
tsc -b— TypeScript compiles the project using the composite build references intsconfig.json, checkingtsconfig.app.jsonandtsconfig.node.json. Any type errors will abort the build here.vite build— Vite bundles the React application with tree-shaking and minification, writing the output todist/.
dist/ directory contains everything needed to serve the app — no Node.js runtime is required at serve time unless you use server.js.Verify the build locally
Before deploying, confirm the production bundle works correctly:This uses Vite’s built-in preview server to serve
dist/ on http://localhost:4173.Serving with server.js
The repository includesserver.js — a dependency-free Node.js HTTP server that serves the dist/ build with SPA routing support. Use it on any server where you can run Node.js directly.
- Serves from
dist/— ifdist/index.htmlexists the server roots itself there; otherwise it falls back to the project root. - SPA fallback — requests for paths that do not match a physical file receive
index.html, so client-side routes like/tournament/123work correctly after a hard refresh. server.jsprotection — direct requests to/server.jsare rejected with a403 Access Deniedresponse.- MIME types —
.html,.css,.js,.json,.png,.jpg,.gif,.svg, and.icoare served with the correctContent-Typeheaders.
Configuring the port
The server reads its port from environment variables in this order:Alternative hosting options
Because the build output is pure static files, HADOS can be deployed to any CDN-backed static host withoutserver.js. The SPA rewrite rule must be configured on whichever host you choose.
Firebase Hosting
The natural choice — your app and its backend live in the same Firebase project. Firebase Hosting provides a global CDN, automatic HTTPS, and a one-command deploy via the Firebase CLI.
Vercel / Netlify / Cloudflare Pages
All three platforms auto-detect Vite projects, run
npm run build, and deploy dist/ automatically. Configure the SPA rewrite so all routes return index.html.Firebase Hosting
Install the Firebase CLI and initialise hosting in the project root:firebase.json to configure the build directory and enable the SPA rewrite:
Firestore security rules
Before HADOS goes live you must replace the default Firestore security rules with rules that restrict access to authenticated users. By default, databases created in test mode allow any read or write for 30 days — this is not safe for production. Open Firestore Database → Rules in the Firebase console and replace the default rules with the following minimal ruleset:These rules are a starting point. For a multi-organizer setup you may want to store an
organizerId field on each dados document and restrict update and delete to request.auth.uid == resource.data.organizerId, ensuring organizers can only modify their own tournaments.