惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
V
V2EX
美团技术团队
H
Help Net Security
月光博客
月光博客
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
U
Unit 42
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
A
About on SuperTechFans
博客园 - Franky
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
MyScale Blog
MyScale Blog
B
Blog
雷峰网
雷峰网
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a daily Python challenge app — here's how it works
DuCode · 2026-05-04 · via DEV Community

DuCode

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))

Enter fullscreen mode Exit fullscreen mode

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.