If you've ever tried to learn Python consistently, you know the problem:
you do a tutorial, feel great, then open your laptop three days later
and have forgotten everything.
That's why I built DuCode — a platform that
gives you one Python coding challenge every day, tracks your streak,
and rewards you with XP.
## How it works
Every day a new challenge drops. You get a code snippet like this:
def make_counter(start=0):
def counter(step=1, *, reset=False):
if reset:
counter._val = start
return counter._val
counter._val = getattr(counter, '_val', start) + step
return counter._val
counter._val = start
return counter
c = make_counter(10)
results = [c(), c(2), c(), c(reset=True), c(3), c()]
print(sum(results))
And you have to figure out the output before the timer runs out.
The faster you answer, the more XP you earn. Wrong answers cost XP —
so it pays to think before you type.
The XP + streak system
Every correct answer earns XP based on:
- How much time is left on the timer
- How many wrong attempts you made (each costs a penalty)
Your streak resets if you miss a day. This sounds brutal, but it's
the mechanic that actually keeps people coming back. Nothing hurts
more than breaking a 14-day streak.
Creator bundles
The part I'm most excited about: creators can build multi-day
challenge bundles — think "30 Days of Python Data Structures" or
"7 Days of Recursion". Players buy the bundle and get one challenge
unlocked per day.
The whole payment flow runs through Whop with automatic revenue share,
so creators earn 90% of every sale directly.
Tech stack
- Frontend: React 19 + TypeScript + Vite — no component library, everything is inline CSS
- Backend: Supabase (Postgres + Auth + Edge Functions)
- Payments: Whop (webhooks → Supabase Edge Function → unlock access)
- Hosting: deployed on the edge
One thing I'm proud of: the timer runs in localStorage so if you
close the tab mid-challenge, the timer keeps counting. No pausing to
cheat. ⏱️
What I learned
Supabase RLS is powerful but tricky. Writing row-level security
policies that correctly scope reads/writes without leaking data took
more iterations than I expected. Worth investing the time upfront.
Webhooks need idempotency. Whop can fire the same event more than
once. The first version of my webhook was creating duplicate purchases.
Always check for existing records before inserting.
localStorage > sessionStorage for game state. Players close tabs.
If your game timer or score lives in sessionStorage, you'll get bug
reports that are impossible to reproduce.
Try it
DuCode is free to play — https://ducode.online.
Today's challenge is already up. Let me know in the comments what your
streak is after a week. 👇
Creator bundles (coming soon)
The part I'm most excited about: in a few weeks creators will be able
to build multi-day challenge bundles — think "30 Days of Python
Data Structures" or "7 Days of Recursion". Players buy the bundle and
get one challenge unlocked per day.
The whole payment flow will run through Whop with automatic revenue
share, so creators earn 90% of every sale directly.
We're onboarding the first creators now — if you're interested in
building and selling your own Python challenge bundle, drop a comment
below. 👇
Built with React, Supabase, and too much coffee.
Top comments (0)