Maintaining the website Maintainer
The app is a static vanilla-JS site (no framework, no build complexity) backed by Firebase. Repo: D:\ivan\portal. This guide lives in D:\ivan\guide.
Run it locally
cd D:\ivan\portal
npm install
npm run dev → http://localhost:5173
Deploy it
npm run build # → dist/
firebase deploy --only hosting # firebase host
npx vercel deploy --prod # vercel host
How the pieces fit
| Piece | What / where |
|---|---|
| Frontend | Static site in src/, built to dist/. Hosted twice: casiniportal.com (Vercel, production) and casini-portal.web.app (Firebase). Both are safe to share. |
| Database | Firebase Realtime Database, project casini-portal, instance casini-portal-default-rtdb (europe-west1), path janux. Rules require a signed-in user (auth != null). |
| Login | Real Firebase Authentication — Google sign-in plus email/password. Every seeded team member has a real auth account (password CasiniDemo2026!). The super-admin account is admin@casini.local (private password — ask the owner). |
| Admin scripts | scripts/create-users.mjs (create auth accounts), scripts/reset-db.mjs (force-reset data), scripts/seed-rtdb.mjs (seed only if empty), scripts/auth-config.mjs (enable Google / add login domains). |
Common tasks
Reset demo data
Easiest: log in as admin → Settings → Reset demo data. Scripted: node scripts/reset-db.mjs (signs in as the super-admin and overwrites with the clean dataset from src/data.js).
Add a team or distributor account
Add the person to src/data.js (companyUsers or distributorUsers), then create their login with node scripts/create-users.mjs. Or just let them Continue with Google — distributors get a seat automatically.
“Google sign-in is not enabled”
Run node scripts/auth-config.mjs (enables the Google provider), and node scripts/auth-config.mjs add-domain https://your-new-url after deploying to a new domain.
App shows “cannot reach the database”
The Realtime Database instance may be paused in the Google Cloud console (it has happened before). Re-enable it, or run node scripts/rtdb-reenable.mjs, then reload.
Security posture & known limits
node scripts/auth-config.mjs add-domain https://that-domain.