
Defeat the Dragon: Focus RPG
Turn focus into adventure!
About
The problem it solves  People want to get real work done, but phones keep hijacking attention. Checklists feel like chores, streaks break easily, and most productivity apps don’t reward not using your phone. **Defeat the Dragon: Focus RPG** turns offline focus into visible progress: the less you touch your phone, the more your tiny adventurer levels up. **What people use it for:** - Studying, deep work, writing, coding, chores, self-care—any 5–120 minute focus block. - Building momentum without shame: complete a session → earn XP/Coins (and Sparks for subscribers) → unlock purely cosmetic skins/pets/backgrounds. - Staying off distracting apps via a “SoftShield” that notices when you leave the screen and gently flags/halts the session. - Playing inside The Base App with frictionless sign-in, sharing progress to friends, and optional web3 subscription payments. **How it makes things easier** - Focus IRL, Level Up In-Game: Focus becomes a game loop that rewards absence from the feed, not time on screen. - Ad-free, cosmetic-only economy: No pay-to-win or dark patterns—rewards are motivational, not manipulative. - Privacy by default: Offline-first PWA; local state with small, deliberate syncs. - Cross-device friendly: Works on web and The Base App; later gains native shields (app blocking) without changing the core loop. Smart Contract Address(es) https://dtd.rchetype.xyz/ Other Onchain Proof  
How it's made
Challenges we ran into **Reliable timers in a PWA (background throttling & “cheating”).** - Mobile browsers throttle timers in background tabs, which corrupted long sessions and opened the door for accidental or intentional mismatches. - Fix: I built a SoftShield that uses visibility and activity signals while the session runs, then validates at completion with a server nonce + elapsed time check. Resulting in sessions that don’t rely on fragile client timers, and users get fair outcomes without false fails. **Keeping it offline-first without spamming Supabase.** - Early prototypes wrote on every UI change (coins, XP, inventory), creating noisy edge calls and occasional race conditions. - Fix: I moved to a “burst-sync” model: write only on critical events (session start, session complete, equip/purchase). Everything else is local (IndexedDB) with a background queue. This cut network chatter, reduced costs, and made the app feel instant. **Clear “no buffs” economy design.** - Testers instinctively expect upgrades to affect power. - Fix: Wrote the economy/shops so Coins/Sparks unlock cosmetics only, reinforced by UI copy and store rules. This preserves the core ethic: the reward is your focus, not stat inflation.