Inspiration
Building habits is notoriously difficult. While many of us start with good intentions, maintaining a streak on a generic app gets boring because there are no real stakes. We noticed the addictive loops of competitive games and wager-based mechanics and thought: what if we could bring that thrilling engagement to self-improvement? Inspired by the social pressure of playing with friends and the excitement of having something on the line, we wanted to build a platform where you put your virtual money (XP) where your mouth is.
What it does
Persist is a gamified, social habit-tracking and productivity arena.
- Wager Rooms: Users can create or join competitive rooms with their friends, putting down an "entry fee" in XP.
- Compete & Earn: Participants complete daily tasks or quizzes to earn a score. At the end of the room's duration, the total XP pot is distributed among the top performers based on rank.
- Social Hub: A fully functional social layer allows you to add friends, track their win streaks, send direct messages, and chat ephemerally inside active wager rooms.
- Neo-Brutalist UI: A dynamic, bold interface that makes tracking habits feel like an intense arcade game, rather than a mundane chore.
How we built it
- Frontend: We built the app using Next.js 14 (App Router) and React 19, styled with Tailwind CSS for our neo-brutalist design system.
- Animations & UI: We leveraged
motion(Framer Motion) for fluid interactions,lucide-reactfor iconography, andcanvas-confettito celebrate victories. - Backend & Database: Supabase handles our PostgreSQL database and user authentication.
- Complex Logic: We designed robust SQL schemas utilizing Row Level Security (RLS) for secure social features (Friendships, DMs, Room Chat). To handle the wager economy securely, we wrote custom PL/pgSQL RPC functions (
join_wager_room,complete_wager_room) for atomic XP deductions, dynamic pot calculations, and payout distribution. - AI Integration: We incorporated the Groq SDK for lightning-fast LLM features.
Challenges we ran into
- Database Transactions & Economy: Distributing the wager pot correctly based on participant rank (e.g., 35% to 1st, 25% to 2nd) while ensuring atomicity so that no XP is duplicated or lost. We solved this by pushing the heavy lifting to PostgreSQL procedures rather than handling it on the client.
- Secure Social State: Managing the complex state of bidirectional friendships (pending/accepted) and restricting direct messages using Supabase Row Level Security without over-complicating the backend.
- Balancing the Gamification: Designing a fair XP economy where both high-performers and consistent participants feel rewarded enough to keep their streaks alive.
- Perfecting the UI & Mascot: Designing a bold, neo-brutalist UI that looks engaging rather than overwhelming was a tough balancing act. We spent a lot of time iterating on our reactive mascot to ensure it had the right personality and perfectly synced with user interactions across the app.
- Authentication Hurdles: Integrating Supabase authentication cleanly with Next.js App Router and managing the user session state seamlessly across the client and server components proved tricky.
- Combat Log Integration: We implemented an ephemeral chat/combat log in the wager rooms, but ensuring that it updated in real-time alongside database XP transactions without race conditions or UI lag was a major technical challenge.
Accomplishments that we're proud of
- Successfully engineering a fully-functional wager and reward system natively in the database.
- Creating a frictionless, visually striking user experience that seamlessly blends a habit tracker with a multiplayer game lobby.
- Building a comprehensive social system (friending, DMs, real-time room chats) that works perfectly alongside the core gamification loops.
What we learned
- We deeply expanded our knowledge of PostgreSQL functions, triggers, and Row Level Security policies via Supabase.
- We learned how to manage complex, stateful multi-player rooms in a modern Next.js ecosystem.
- We discovered the nuances of behavioral design-specifically how introducing "stakes" (XP wagers) and social accountability drastically transforms how users interact with their goals.
What's next for Persist
- Global Leagues & Matchmaking: Expanding beyond friend groups to automated matchmaking and global ranking tiers (Bronze, Silver, Gold).
- Nurturing the Mascot: Evolving the mascot system so users can interact with, nurture, and upgrade their mascot using the XP they've earned from completing habits.
- Real-World Rewards & Partnerships: Partnering with companies to offer real-world discounts and perks. The higher you rank on the global leaderboard and the longer your streak, the better the discounts you unlock!
- Verified Habits: Integrating with health APIs and wearables (Apple Health, Fitbit) to automatically verify physical habits and prevent cheating.
- Real-World Bounties: Eventually allowing users to wager real money or crypto on their habit streaks through Stripe or Web3 integrations for the ultimate commitment device.
Built With
- framer-motion
- groq
- nextjs
- resend-api
- supabase
- tailwindcss
Log in or sign up for Devpost to join the conversation.