PawTwin — A Real-Life Tamagotchi for Families and Their Dogs

PawTwin — A Real-Life Tamagotchi for Families and Their Dogs

PawTwin — 专为家庭与爱犬打造的现实版“拓麻歌子”

DEV Weekend Challenge: Dog Days Edition Submission 🐕 This is a submission for the DEV Weekend Challenge: Dog Days Edition. DEV 周末挑战:狗狗主题版参赛作品 🐕 这是我为 DEV 周末挑战:狗狗主题版提交的作品。

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. 我构建了什么:每个养狗的家庭最终都会问同一个问题:“有人喂狗了吗?”PawTwin 将这种日常的不确定性变成了一场共享游戏。它是一个现实版的“拓麻歌子”(Tamagotchi),其状态由家庭成员对现实中爱犬的照料行为来控制,而不是一个仅仅贴着吉祥物图标的任务管理器。

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. 家庭成员首先上传一张爱犬的照片。PawTwin 会创建一个可重复使用的像素化形象,并将其放置在一个动画化的 Phaser 游戏空间中。这个环境会传达真实的生理需求:空碗意味着该喂食了,干涸的碗意味着水喝完了,在门口踱步意味着该遛狗了,而出现的污垢颗粒则意味着卫生状况需要清理。

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. 完成并确认真实的照料行为会让这个“数字孪生”宠物重新变得活泼。照料者可以认领喂食、喂水、遛狗、口腔护理、耳部护理或美容任务。遛狗任务会记录时间、大致距离和脱敏后的路线;其他任务则可以包含私密的照片证据。由监护人(而非计算机视觉)来审核证据并决定其是否有效。审核通过后,可以通过监护人签名的 Solflare 交易发放真实的 Devnet SOL 奖励。

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. V2 版本还赋予了狗狗超越提醒之外的生活:宠物记忆(Pet Memory)功能可以学习可解释的模式,例如通常是谁在什么时间遛狗,然后创建个性化的应用内提醒和月度家庭报告。“找球游戏”(Find the Ball)利用未来已确定的 Solana Devnet 区块哈希值从四个房间中选择一个,并公开槽位、区块哈希、摘要、加盐承诺和随机数,以便任何人都可以复现这一零风险的结果。

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. “生活相册”(Life Album)重现了家庭相册中厚实的纸张、金属环、照片角和保护性玻璃纸,其中包含私密照片、故事、地点以及真实宠物原始声音的短录音。“设备实验室”(Device Lab)演示了一个受保护的树莓派(Raspberry Pi)自动抛球机合约,除非配置了安全的物理硬件,否则它会明确保持在模拟器模式。

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. 演示应用地址:https://pawtwin-v2-future.vercel.app 该应用包含一个标注清晰的预设家庭数据,以便评委即使在没有摄像头、钱包或服务提供商的情况下也能探索完整产品。建议评委路径:使用 Vercel 登录或进入透明演示模式。上传一张狗狗照片并生成像素孪生体。听取介绍并进入 Phaser 房间。点击狗狗、碗、床和门;观察逾期未照料如何改变游戏世界。认领一项任务,提交证据并以监护人身份进行审核。打开“游戏”并运行一轮基于 Solana Devnet 的、可审计的“找球”游戏。打开“宠物记忆”查看已学习的照料者习惯并生成月度报告。在“生活相册”中添加一个私密页面。连接 Solflare 以检查监护人签名的 Devnet 奖励路径。

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. 公开部署版本绝不会伪造服务提供商的成功状态。本地孪生体被标记为“LOCAL FALLBACK”,练习熵被标记为“PRACTICE”,未发送的报告显示“PREVIEW ONLY”,而 Solana 奖励只有在真实签名确认后才会显示成功。

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. 代码公开源码及完整 Git 历史:https://pawtwin-v2-future.vercel.app/source 源码页面包含一个受校验和保护的 Git 快速导出文件,其中包含完整的跟踪树、作者、时间戳、提交记录、分支和带注释的发布标签。页面上印有恢复和验证命令。这是一个托管在 Vercel 上的公共源码镜像(非 GitHub),并已作相应标注。提交的应用版本为 v2-future 分支上的提交记录 8ceb68cf3ce3be93e2a82958a7f50040b9de0753。最终文档检查点为标签 hackathon-submission-2026-08-16-final,冻结的 V1 版本保留在标签 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. 我是如何构建的:PawTwin 使用 Next.js 16、React 19 和 TypeScript 处理产品工作流,而 Phaser 4 则负责房间、宠物移动、交互对象、粒子效果、补间动画和奖励庆祝。一个确定性的状态引擎将任务截止日期和审核结果转换为饥饿度、口渴度、遛狗需求、卫生状况、能量和快乐值;React 仅将派生出的行为传递给游戏。

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. Google AI:面部与视觉理解。服务器会对上传的图像进行验证和边界处理。Gemini 3.5 Flash Lite 被集成用于结构化的视觉特征提取和保守的证据观察;Gemini 3.1 Flash Image 被集成用于生成标准肖像。结果会被缓存,因此情绪变化不会重新生成狗狗的身份。证据分析仅供参考,监护人拥有最终决定权。生产请求通过请求范围的 OIDC 到达 Vercel AI Gateway,但 Vercel 目前需要绑定信用卡才能解锁即使是促销型的模型额度。我没有添加信用卡,也没有误导结果:因此,在线演示使用了一个预设的确定性渲染器,它会采样上传照片的调色板并显示“LOCAL FALLBACK”。Gemini 适配器、模式、仅限 Google 的路由、隐私选项以及提供商安全故障路径都包含在公开源码中。

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. ElevenLabs:狗狗的真实声音。ElevenLabs Flash 为饥饿、喝水、遛狗和奖励时刻提供简短的上下文台词。API 密钥保留在服务器端,短语经过精心挑选,音频经过缓存,浏览器接收 MP3 字节流。在线部署版本已产生了一个经过验证的、HTTP 200 状态码的 ElevenLabs TTS 请求。如果服务提供商不可用,PawTwin 会明确切换到浏览器语音或可见文本,而不是调用备用的 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. Solana 和 Solflare:奖励与可审计的游戏。监护人审核会构建一笔标准的 Devnet SOL 转账给照料者,通过 Wallet Adapter 打开 Solflare,并在显示奖励或浏览器链接之前等待网络确认。不存在服务器钱包、主网密钥或伪造签名。应用幂等性机制会阻止针对同一任务的重复支付。