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.

Before running HADOS locally you need a compatible Node.js runtime, a Firebase project (see the Firebase setup guide), and the project dependencies installed. This page covers the full local setup, explains how to move Firebase credentials out of source code using Vite environment variables, and documents the PORT variable used by the production static server.

Prerequisites

  • Node.js 18 or later — HADOS targets modern ESM and React 19; older Node versions are not supported.
  • npm — bundled with Node.js; no alternative package manager configuration is included.
Run the following to verify your versions:
node --version   # should be v18.0.0 or higher
npm --version
Install project dependencies after cloning:
npm install

npm scripts

All development and build tasks are defined in package.json:
ScriptCommandPurpose
devviteStarts the Vite development server with HMR on http://localhost:5173.
buildtsc -b && vite buildType-checks with TypeScript first, then bundles the app into dist/.
lintoxlintRuns the Oxlint linter against the codebase to catch errors and enforce code style.
previewvite previewServes the dist/ build locally to verify the production bundle.
npm run dev       # start local dev server
npm run build     # production build → dist/
npm run lint      # lint the codebase
npm run preview   # preview the production build

Firebase credentials

src/firebase.ts currently contains the Firebase config object with credentials hardcoded directly in the file. This is acceptable for private repositories during development, but you should move these values to environment variables before deploying to any public or shared environment. Vite exposes environment variables to the browser bundle at build time — any variable prefixed with VITE_ is statically replaced in the output. Update src/firebase.ts to read from import.meta.env instead of hardcoded strings:
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import { getAuth } from 'firebase/auth';

const firebaseConfig = {
  apiKey:            import.meta.env.VITE_FIREBASE_API_KEY,
  authDomain:        import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
  projectId:         import.meta.env.VITE_FIREBASE_PROJECT_ID,
  storageBucket:     import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
  messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
  appId:             import.meta.env.VITE_FIREBASE_APP_ID,
  measurementId:     import.meta.env.VITE_FIREBASE_MEASUREMENT_ID,
};

const app = initializeApp(firebaseConfig);
export const db = getFirestore(app);
export const auth = getAuth(app);
The VITE_ prefix is required. Vite deliberately excludes any variable that does not start with VITE_ from the browser bundle for security. Variables without this prefix are only accessible in Vite config files and Node.js-side plugins — not in your React components or firebase.ts.

.env.local

Create a .env.local file in the project root and add your Firebase project values:
VITE_FIREBASE_API_KEY=AIzaSy...
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=601105669821
VITE_FIREBASE_APP_ID=1:601105669821:web:abc123
VITE_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX
Vite automatically loads .env.local during npm run dev and npm run build. You can find all the values in the Firebase console under Project settings → Your apps → SDK setup and configuration.
Add .env.local to your .gitignore file so it is never committed to version control. This file contains sensitive credentials that would allow anyone with read access to your repository to write to your Firestore database and impersonate users.

Server PORT variable

The production static server (server.js) reads its listening port from environment variables at startup:
const PORT = process.env.PORT || process.env.SERVER_PORT || 8080;
The resolution order is:
  1. PORT — the conventional variable used by most cloud platforms (Heroku, Railway, Render, etc.).
  2. SERVER_PORT — a fallback for platforms that use a different naming convention.
  3. 8080 — the default when neither variable is set, suitable for local testing.
To run the server on a custom port:
PORT=3000 node server.js
The server also logs all port-related environment variables at startup to help diagnose platform-specific port binding issues.

Build docs developers (and LLMs) love