PawTwin - A Real-Life Tamagotchi for Families and Their Dogs
This is a submission for the DEV Weekend Challenge: Dog Days Edition. What I Built Every family with a dog eventually asks the same question: did anyone feed the dog? PawTwin turns that daily uncertainty into a shared game. It is a real-life Tamagotchi whose state is controlled by care performed for the family's physical dog-not a task manager with a mascot pasted on top. The family begins with a photo of the real dog. PawTwin creates a reusable pixel identity and places it inside an animated Phaser home. The environment communicates real needs: an empty bowl means food is due, a dry bowl means water is overdue, pacing at the door means a walk is waiting, and dirt particles mean hygiene has slipped. Completing and approving real care makes the twin playful again. A caregiver can claim feeding, water, walking, oral-care, ear-care or grooming work. Walks record time, approximate distance and a privacy-reduced route; other tasks can include private photo evidence. A guardian-not computer vision-reviews the proof and decides whether it counts. Approval can release a real Devnet SOL reward through a guardian-signed Solflare transaction. The V2 experience also gives the dog a life beyond reminders: - Pet Memory learns explainable patterns such as who normally walks the dog and at what time, then creates personalized in-app reminders and a monthly family report. - Find the Ball uses a future finalized Solana Devnet blockhash to choose one of four rooms, exposing the slot, blockhash, digest, salted commitment and nonce so anyone can reproduce the zero-stakes result. - Life Album recreates the thick paper, metal rings, photo corners and protective cellophane of a family photo album, with private photos, stories, places and short recordings of the real pet's original sounds. - Device Lab demonstrates a guarded Raspberry Pi ball-launcher contract while remaining clearly in simulator mode unless safe physical hardware is configured. The core loop is: Real need โ visible game behavior โ real family action โ proof โ guardian approval โ reward โ happier digital twin โ care memory. The better the family cares for the real dog, the better its digital twin's life becomes. Demo Live application: https://pawtwin-v2-future.vercel.app The app includes a clearly labelled seeded household so judges can explore the full product even when a camera, wallet or provider is unavailable. Suggested judge path: - Sign in with Vercel, or enter the transparent demo. - Upload a dog photo and reveal the pixel twin. - Hear the introduction and enter the Phaser room. - Click the dog, bowls, bed and door; inspect how overdue care changes the world. - Claim a task, submit evidence and review it as guardian. - Open Play and run a live, auditable Find the Ball round against Solana Devnet. - Open Pet Memory to inspect learned caregiver routines and generate the monthly report. - Add a private page to Life Album. - Connect Solflare to inspect the guardian-signed Devnet reward path. The public deployment never fabricates provider success. A local twin is labelled LOCAL FALLBACK, practice entropy is labelled PRACTICE, an unsent report says PREVIEW ONLY, and a Solana reward is successful only after a real signature confirms. Code Public source and complete Git history: https://pawtwin-v2-future.vercel.app/source The source page contains a checksum-protected Git fast-export with the full tracked tree, authors, timestamps, commits, branches and annotated release tags. Restore and verification commands are printed on the page. It is a public Vercel-hosted source mirror-not GitHub-and is labelled accordingly. The submitted application revision is commit 8ceb68cf3ce3be93e2a82958a7f50040b9de0753 on v2-future . The final documentation checkpoint is tag hackathon-submission-2026-08-16-final , and the frozen V1 remains preserved at tag v1.0.0-hackathon . How I Built It PawTwin uses Next.js 16, React 19 and TypeScript for product workflows, while Phaser 4 owns the room, pet movement, interactive objects, particles, tweens and reward celebrations. A deterministic state engine converts task deadlines and approvals into hunger, thirst, walk need, hygiene, energy and happiness; React passes only the derived behavior into the game. Google AI: the face and visual understanding The server validates and bounds the uploaded image. Gemini 3.5 Flash Lite is integrated for structured visible-trait extraction and conservative proof observations; Gemini 3.1 Flash Image is integrated for a canonical portrait. Results are cached so mood changes never regenerate the dog's identity. Evidence analysis is advisory and the guardian remains authoritative. The production request reached Vercel AI Gateway through request-scoped OIDC, but Vercel currently requires a billing card to unlock even its promotional model credits. I did not add a card or mislabel the result: the live demo therefore uses an authored deterministic renderer that samples the uploaded photo's palette and displays LOCAL FALLBACK. The Gemini adapter, schemas, Google-only routing, privacy options and provider-safe failure path are all present in the public source. ElevenLabs: the dog's actual voice ElevenLabs Flash provides short contextual lines for hunger, water, walks and reward moments. The API key stays server-side, phrases are curated, audio is cached, and the browser receives MP3 bytes. The live deployment produced a verified ElevenLabs TTS request with HTTP 200. If the provider is unavailable, PawTwin explicitly switches to browser speech or visible text rather than calling the fallback ElevenLabs. Solana and Solflare: rewards and auditable play Guardian approval constructs a standard Devnet SOL transfer to the caregiver, opens Solflare through Wallet Adapter, and waits for network confirmation before displaying a reward or Explorer link. There is no server wallet, mainnet key or fabricated signature. Application idempotency blocks a second payout for the same task. Find the Ball supplies a second real Solana use: the game commits locally to the hidden room before a selected future slot exists, then resolves with that finalized Devnet blockhash. A live smoke round resolved slot 484487750 and exposed the complete reproducible SHA-256 calculation. It is deliberately zero-stakes-not a wager, prize or claim that public blockhashes are secure randomness for valuable outcomes. Snowflake: long-term care memory Every meaningful mutation creates a privacy-reduced CareEvent. The live production path first wrote PET_CREATED to the Neon/Postgres operational ledger and returned HTTP 201, then authenticated to Snowflake using a scoped service user and key-pair JWT. Deterministic event IDs and MERGE make analytical ingestion idempotent. Pet Memory turns those facts into visible value: caregiver contribution, usual care time, task patterns, completion streaks, walking distance, rewards, urgent reminders and monthly reporting. Gemini can phrase one bounded narrative over validated aggregates, but it cannot change counts, invent care or see photos, GPS routes, wallet addresses or recipients. Resilient, private-by-default product engineering Photos and reduced GPS evidence stay off-chain. Uploads have signature, type and size validation; server mutations have same-origin checks, session authorization, bounded rate limits and concurrency limits. Private metadata is stripped before Neon or Snowflake. Provider failure degrades the experience without turning failure into fake success. The original room and all premium late-VGA/32-bit-style art are authored for PawTwin. Phaser, Next.js, React, Lucide, Solana Wallet Adapter and provider SDKs are used under their published licenses; detailed links and licenses are recorded in docs/ATTRIBUTIONS.md . Prize Categories - Best Use of Google AI: Gemini structured vision, proof understanding and canonical portrait generation are implemented behind validated server routes. The current deployment truthfully shows its deterministic local renderer because AI Gateway's model call is blocked by a billing-card requirement; it does not present local work as Gemini output. - Best Use of Solana: Guardian-approved care constructs a real Solflare-signed Devnet SOL reward, and Find the Ball already uses finalized Devnet blocks as a public, reproducible zero-stakes game mechanic. - Best Use of ElevenLabs: ElevenLabs Flash is the contextual speaking voice of the digital twin. The live server-side TTS path returned genuine MP3 audio and is distinct from the labelled browser/text fallback. - Best Use of Snowflake: A scoped JWT service user ingests privacy-reduced, idempotent CareEvents into Snowflake; the live PET_CREATED event path authenticated successfully and powers the pet's analytical-memory story. Top comments (0)
Comments
No comments yet. Start the discussion.