"Turn the Real World into a Game."
An interactive web game designed to drastically reduce children's screen time by incentivizing real-world offline activities through AI vision verification and adventure game progression.
Traditional digital games trap children in front of glowing screens for hours. REAL WORLD ร AI ร GAMING flips the paradigm: the screen becomes a game master, while the real world becomes the playing field.
Instead of tapping virtual buttons, children receive age-appropriate real-world quests such as:
- ๐ฟ Nature: Water a plant, find 3 green leaves, sprout a seed, observe birds.
- ๐งน Home & Organizing: Clean study desk, arrange 5 books neatly, fold clothes.
- ๐จ Creativity & Craft: Draw an animal from life, build something from recyclables.
- ๐ค Helping & Kindness: Help set the dinner table, write a thank-you letter.
- ๐ Fitness: 15 star jumps, outdoor walk, stretching.
- ๐ ๏ธ Building: Build a paper bridge, craft a phone stand.
The player performs the mission in the physical world, snaps a photo proof using their camera or phone, and submits it. A multimodal AI Vision Model (Google Gemini) inspects the photo to confirm that the task was genuinely completed. If verified, the player earns XP, Gold Coins, advances through 10 Levels, builds Daily Streaks, and unlocks Explorer Badges!
- Face is NEVER required: The AI strictly inspects the object, organized items, artwork, or craft, rather than the child's identity.
- Strict Safety Prompts: The AI task generator strictly bans tasks involving fire, electricity, sharp objects, heights, roads, or hazardous chemicals.
- Age-Appropriate Segmentation: Automatically assigns tasks suited to 5โ8 ("Junior Explorer"), 9โ12 ("Adventure Explorer"), or 13โ16 ("Master Explorer").
- Framework: React 18 with TypeScript
- Bundler: Vite 6
- Styling: Tailwind CSS with custom adventure game palette, 3D buttons, and radar animations
- Icons: Lucide React
- Celebrations: Canvas Confetti
- Audio & SFX: Browser-native Web Audio API synthesizer (click chimes, victory fanfare, fail buzzers, and optional ambient chord loops with zero external audio download dependencies)
- Runtime: Node.js (v18+) with Express.js and TypeScript (
tsx) - Database & ORM: PostgreSQL with Prisma ORM (includes seamless local JSON store fallback for zero-friction hackathon evaluation)
- File Uploads: Multer with strict MIME validation (JPEG, PNG, WebP) and 10MB limit
- AI Multimodal Model: Google Gemini API (
gemini-2.5-flash/gemini-1.5-flash) for live image verification and quest generation
antigravity/
โโโ backend/
โ โโโ data/ # Local persistence cache & storage
โ โโโ prisma/
โ โ โโโ schema.prisma # Prisma schema (User, Level, Task, MissionCompletion, Streak, Badge, UserBadge)
โ โโโ src/
โ โ โโโ ai/
โ โ โ โโโ imageVerifier.ts # Multimodal Gemini AI vision verification
โ โ โ โโโ taskGenerator.ts # Gemini AI age-appropriate task generator
โ โ โโโ controllers/
โ โ โ โโโ taskController.ts # Task generation, listing, verification, completion
โ โ โ โโโ userController.ts # Player signup, profile, streaks, badges, progress
โ โ โโโ middleware/
โ โ โ โโโ upload.ts # Multer multipart/form-data validation
โ โ โโโ routes/
โ โ โ โโโ taskRoutes.ts # /api/tasks routes
โ โ โ โโโ userRoutes.ts # /api/users routes
โ โ โโโ services/
โ โ โ โโโ db.ts # Dual-capable database layer (Prisma PostgreSQL + fallback)
โ โ โโโ types/
โ โ โ โโโ index.ts # TypeScript interfaces
โ โ โโโ utils/
โ โ โ โโโ seed.ts # Database seeder script
โ โ โ โโโ seedData.ts # 300 curated offline quests & badges
โ โ โโโ server.ts # Express server entrypoint
โ โโโ uploads/ # Stored proof photographs (.gitkeep)
โ โโโ .env.example # Sample environment configuration
โ โโโ package.json
โ โโโ tsconfig.json
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ BadgeCard.tsx # Achievement badge card with lock/unlock states
โ โ โ โโโ Navbar.tsx # Player stats, level, XP, coins, audio toggles
โ โ โ โโโ PlayMissionModal.tsx # "Your Next Mission" AI quest popup
โ โ โ โโโ VerificationModal.tsx # Animated radar scan, AI score gauge, rewards
โ โ โโโ pages/
โ โ โ โโโ CompletedMissions.tsx # Trophy gallery with category filters & photo previews
โ โ โ โโโ Home.tsx # Main game dashboard & hero PLAY trigger
โ โ โ โโโ Levels.tsx # Levels 1 to 10 with 10 missions per level
โ โ โ โโโ Onboarding.tsx # Player name, age classification, avatar picker
โ โ โ โโโ Profile.tsx # Explorer profile, level progress & badges showcase
โ โ โ โโโ Settings.tsx # Audio FX & music toggles, logout modal
โ โ โ โโโ Streaks.tsx # Daily flame counter, 7-day rewards & calendar
โ โ โ โโโ TaskDetail.tsx # Camera capture input, photo preview, verify trigger
โ โ โโโ services/
โ โ โ โโโ api.ts # REST API client
โ โ โ โโโ soundEffects.ts # Web Audio API game synthesizer
โ โ โโโ styles/
โ โ โ โโโ index.css # Custom game styling and keyframe animations
โ โ โโโ types/
โ โ โ โโโ index.ts # Frontend TypeScript types
โ โ โโโ App.tsx # Master game view coordinator
โ โ โโโ main.tsx # Vite React root
โ โโโ index.html
โ โโโ package.json
โ โโโ tailwind.config.js
โ โโโ tsconfig.json
โ โโโ vite.config.ts
โ
โโโ package.json # Root script orchestrator
โโโ README.md # Full documentation
- Node.js: v18.0.0 or higher
- npm: v9.0.0 or higher
- (Optional) PostgreSQL: v14+ (if using live PostgreSQL; otherwise the built-in local store works immediately out of the box).
- (Optional) Google Gemini API Key: from Google AI Studio for live AI vision verification.
You can install all dependencies for both backend and frontend from the root:
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installOr from the workspace root:
npm run install:allNavigate to backend/:
cd backendCreate your .env file by copying the example:
cp .env.example .envConfigure backend/.env:
# Server Port
PORT=5000
NODE_ENV=development
# Database Connection (PostgreSQL)
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/real_world_game?schema=public"
# AI Configuration (Google Gemini API Key)
# Obtain your free API key at: https://aistudio.google.com/
AI_API_KEY="your_gemini_api_key_here"
# Verification Score Threshold (Pass if score >= 70)
VERIFICATION_PASS_THRESHOLD=70Developer Note on Missing API Key:
In accordance with the hackathon rules, ifAI_API_KEYis not provided during development, the backend will return a clear, informative message explaining that the key is required rather than silently faking verification.
Generate the Prisma Client:
cd backend
npm run prisma:generateIf you have a PostgreSQL database running locally or in Docker:
# Push schema to PostgreSQL database
npm run prisma:push
# Or run standard migration
npm run prisma:migrate
# Seed all 300 missions (10 levels ร 10 tasks ร 3 age groups) and badges
npm run seedZero-Friction Fallback:
If PostgreSQL is not started on your machine yet, the backend automatically detects this and uses the built-in JSON persistence store inbackend/data/storage.json, fully seeded with all 300 offline missions, 10 levels, streaks, and badges.
Terminal 1 โ Backend:
cd backend
npm run devBackend runs on http://localhost:5000
Terminal 2 โ Frontend:
cd frontend
npm run devFrontend runs on http://localhost:5173
Open http://localhost:5173 in your web browser.
| Method | Endpoint | Description | Request Body / Params |
|---|---|---|---|
GET |
/api/health |
Health & info check | None |
POST |
/api/users |
Register / login explorer | { name: string, age: number, avatar?: string } |
GET |
/api/users/:id |
Get explorer profile | None |
PATCH |
/api/users/:id |
Update profile info | { name?: string, avatar?: string } |
GET |
/api/users/:id/progress |
Get XP, coins, level, progress % | None |
GET |
/api/users/:id/streak |
Get streak count, 7-day rewards, history | None |
GET |
/api/users/:id/badges |
Get badges with earned status | None |
GET |
/api/users/:id/missions |
Get verified completed missions | None |
GET |
/api/tasks |
Get level quests | ?ageGroup=9-12&level=1 |
GET |
/api/tasks/:id |
Get single task details | None |
POST |
/api/tasks/generate |
AI-generated dynamic quest | { age: 10, ageGroup: "9-12", level: 1, previousTasks: [] } |
POST |
/api/tasks/:id/verify |
Upload photo & verify with AI Vision | multipart/form-data: image, taskId, userId |
POST |
/api/missions/:id/complete |
Complete verified mission | { userId, proofImageUrl, verificationScore } |
- Photo Upload: The child captures or selects a photo of the completed offline mission via
<input type="file" accept="image/*" capture="environment">. - Pre-flight Validation: The Express backend Multer middleware verifies file type (
image/jpeg,image/png,image/webp) and enforces a 10MB size limit. - Task Grounding: The backend retrieves the specific quest details (e.g. title: "Water a Plant", description: "Find a houseplant or garden plant and gently water it").
- Multimodal Vision Analysis: The backend converts the image buffer into base64 and invokes Google Gemini's multimodal vision API (
gemini-2.5-flash). - Privacy-Focused Prompting:
- The model is instructed: "Focus only on visible evidence relevant to the task (e.g. watered soil, organized books, finished drawing). Do not identify the child. Do not require the child's face. Do not reject valid evidence simply because the child is not visible."
- Structured Evaluation:
The model returns:
{ "passed": true, "score": 92, "reason": "The photo clearly shows a houseplant in fresh, damp soil with a watering can nearby." } - Threshold Decision:
score >= 70: Approved. XP and Coins are credited, level progress updates, daily streak registers, badges evaluate, and the next mission unlocks!score < 70: Not Verified. Constructive feedback is shown, and the child can immediately re-upload another photo without losing progress.
- Age Groups:
- Group 1 (5โ8 yrs): "Junior Explorer" โ Sensory discovery, gentle organization, drawing, toy pairing.
- Group 2 (9โ12 yrs): "Adventure Explorer" โ Recycled crafts, book sorting, simple food prep, leaf rubbing.
- Group 3 (13โ16 yrs): "Master Explorer" โ Mini herb gardens, DIY organizers, workouts, desk cable management.
- 10 Levels & 100 Missions per Age Group:
- Level 1: Very Easy (+50 XP, +10 Coins)
- Level 2โ3: Easy / Easy+ (+60 XP, +15 Coins)
- Level 4โ6: Medium (+75 XP, +20 Coins)
- Level 7โ8: Challenging (+100 XP, +25 Coins)
- Level 9โ10: Hard / Champion (+150 XP, +35 Coins)
- 7-Day Streak Rewards:
- Day 1: +10 coins
- Day 2: +15 coins
- Day 3: +20 coins
- Day 4: +25 coins
- Day 5: +30 coins
- Day 6: +40 coins
- Day 7: +100 coins + 7-Day Streak Master Badge
- Badges:
- ๐ First Mission: Complete first real-world quest.
- ๐ฏ 5 Missions: Complete 5 quests.
- ๐ 10 Missions: Complete 10 quests.
- ๐ฅ 7 Day Streak: Maintain a full 7-day streak.
- ๐ฟ Nature Explorer: Complete 3 nature quests.
- ๐ค Kind Helper: Complete 3 helping quests.
- ๐จ Creative Mind: Complete 3 creativity/building quests.
- ๐ Champion: Complete Level 10.
- Zero Face Recognition: AI prompt instructions explicitly instruct the vision model to ignore faces and focus on physical task outcomes.
- Backend Key Isolation: API keys (
AI_API_KEY,DATABASE_URL) are strictly kept on the Express backend; no sensitive keys are ever packaged into frontend bundles. - CORS & Rate Limiting Ready: Express includes CORS origin protection, JSON body limits, and Multer file validation.
- Sanitized Uploads: Image files are renamed with cryptographically random timestamps before storage.
- Full-stack architecture (React + TypeScript + Vite frontend & Express + TypeScript backend).
- PostgreSQL database schema with Prisma ORM.
- Zero-friction local database fallback for instant reviewer evaluation.
- Real Google Gemini Vision verification engine for photo evidence.
- Strict child privacy protections (no face requirement).
- 3 Age Groups with 10 Levels and 10 Missions each (300 total slots).
- Daily streak tracker with 7-day reward calendar.
- Completed Missions gallery with category filtering.
- Sound effects and gentle ambient music via Web Audio API.
- Clean, responsive, modern adventure game UI.
This project now uses local Ollama + Qwen2.5-VL for mission photo verification.
- Install Ollama.
- Download the vision model:
ollama pull qwen2.5vl:3b - Make sure Ollama is running.
- In
backend, install dependencies withnpm install. - Start the backend with
npm run dev. - Start the frontend with
npm run dev.
The verification endpoint sends only the current uploaded mission image plus the current task title/description to Ollama. It does not send previous uploaded images.
Default Ollama configuration:
OLLAMA_URL=http://localhost:11434OLLAMA_MODEL=qwen2.5vl:3bVERIFICATION_PASS_THRESHOLD=70