A fast, fun, and endlessly replayable word-guessing game powered by Firebase, Cloud Functions, and Gemini AI.
Heads Up is a mobile-optimized web game inspired by the classic party game. Players choose a category, place the phone on their forehead, and their friends give clues as they guess the word.
The game uses:
- ✅ Firebase Auth for secure Google Login
- ✅ Firestore for persistent word decks
- ✅ Cloud Run Function (
getAiWords) to generate new words using Gemini - ✅ Personal private decks per user ("slave decks")
- ✅ One shared "master deck" per category
- ✅ Tone.js sound effects
- ✅ Fully responsive UI with Tailwind CSS
This ensures:
- Unique gameplay for each player
- Words never repeat
- Decks automatically refill
- Minimal API usage (cost-optimized)
- Correct / Skip zones
- Dynamic word font resizing
- Animated feedback overlays
- Sound effects (ticks, beeps, success tones)
- Total score
- List of correct words
- List of skipped words
- Modal popup viewer
Your game uses a two-level deck architecture:
Stored at:
artifacts/heads-up-v1/public/data/decks/{deckId}
- Created ONLY once per category/difficulty.
- Contains all unique words ever generated.
- Shared by all players.
- Prevents re-calling Gemini again when another user plays the same category.
Stored at:
artifacts/heads-up-v1/users/{userId}/userDecks/{deckId}
-
Cloned from the master deck on first play.
-
Keeps track of:
allWords[]seenWords[]
-
Ensures unique words per user.
-
When the deck gets low or empty → automatically refills using new AI words.
The client detects low words → calls backend →
Backend fetches new words from Gemini →
Appends them to master deck →
Creates a fresh slave deck with seenWords = [].
- HTML
- TailwindCSS
- Tone.js
- Vanilla JS (ES modules)
- Firebase Auth
- Firestore
- Cloud Run (via Firebase Functions V2)
- Node.js (serverless API)
- Gemini 2.5 Flash (AI word generation)
Hosted on Vercel Just run:
vercel
Or push to your GitHub repo with Vercel integration.
The backend API lives at:
https://getaiwords-xxxxxxxxxx-uc.a.run.app
Deployed using:
firebase deploy --only functions
Ensure these are in Authorized Domains:
localhost
your-vercel-domain.vercel.app
oauth-redirect.googleusercontent.com
Uses Google Sign-in:
const provider = new GoogleAuthProvider();
signInWithPopup(auth, provider);On first login, user deck is created.
Run Firebase emulator for Firestore + Functions:
firebase emulators:start
Run local web server:
npm run dev