DEV Community

Clackpit
Clackpit

Posted on

How I built a no-account leaderboard for my typing game — and why I’ll never ask for signup

When I started building Clackpit, I knew I wanted a daily leaderboard. Competitive pressure is the single biggest reason people return to a typing game — seeing your name one slot below someone else is a visceral motivation loop that no feature list can replicate.

But I also knew from playing TypeRacer that account friction kills the moment. You're in the zone, you finish a race at a personal best, and then... "Create an account to save your score." The spell breaks. Half the people close the tab.

So I built Clackpit's leaderboard to work with zero accounts. Here's how.

The core insight: localStorage is your persistent identity layer

Every time someone visits Clackpit for the first time, they're assigned a random handle — something like "QuickFalcon" or "SwiftPine." It gets stored in localStorage. That's it. That's the account.

function getOrCreateHandle(): string {
  const stored = localStorage.getItem('clackpit_handle');
  if (stored) return stored;

  const adjectives = ['Quick', 'Swift', 'Sharp', 'Rapid', 'Keen'];
  const nouns = ['Falcon', 'Pine', 'River', 'Stone', 'Arrow'];

  const handle = 
    adjectives[Math.floor(Math.random() * adjectives.length)] +
    nouns[Math.floor(Math.random() * nouns.length)] +
    Math.floor(Math.random() * 99);

  localStorage.setItem('clackpit_handle', handle);
  return handle;
}
Enter fullscreen mode Exit fullscreen mode

The handle persists across sessions. Players can change it once — this is important, because the ability to choose your name is part of the identity investment. But they can't change it to something that's already on the leaderboard (we check server-side), and once changed, it's locked for 24 hours.

The server side: Cloudflare KV as a daily leaderboard store

The leaderboard resets daily. Each entry is a score object keyed by date:

interface LeaderboardEntry {
  handle: string;
  wpm: number;
  accuracy: number;
  mode: 'sprint' | 'marathon' | 'endurance';
  timestamp: number;
}
Enter fullscreen mode Exit fullscreen mode

When a race finishes, the client POSTs to /api/leaderboard with the handle, score, and mode. The worker looks up the current day's leaderboard from KV, upserts the entry (keeping only the player's best score for the day), and writes it back with a 24-hour TTL.

async function submitScore(env: Env, entry: LeaderboardEntry): Promise<void> {
  const key = `leaderboard:${todayKey()}`;
  const raw = await env.LEADERBOARD.get(key);
  const board: LeaderboardEntry[] = raw ? JSON.parse(raw) : [];

  // Upsert: replace existing entry for this handle, or append
  const idx = board.findIndex(e => e.handle === entry.handle);
  if (idx >= 0) {
    // Only keep the better score
    if (entry.wpm > board[idx].wpm) board[idx] = entry;
  } else {
    board.push(entry);
  }

  // Sort and cap at top 50
  board.sort((a, b) => b.wpm - a.wpm);
  board.splice(50);

  await env.LEADERBOARD.put(key, JSON.stringify(board), {
    expirationTtl: 86400 * 2 // 2-day TTL so yesterday's leaderboard stays readable
  });
}
Enter fullscreen mode Exit fullscreen mode

The daily reset is implicit: a new key (leaderboard:2026-05-17) just starts empty. No cron job needed.

The anti-cheat problem

Without accounts, someone can just refresh localStorage, generate a new handle, and post another score. I don't pretend this is unsolvable — it's not, but it's also not worth solving at this stage. The leaderboard is entertainment, not a tournament with prizes.

What I did add: server-side rate limiting per IP using KV (one submission per 5 minutes), and a WPM cap above which scores are silently rejected (currently 220 WPM — humanly achievable but rare enough to filter obvious bots). Both are soft filters. The goal is making casual cheating annoying, not building a fraud detection system.

Why this works better than I expected

The no-account leaderboard has some emergent properties I didn't anticipate:

The handle creates identity without commitment. "QuickFalcon42 is on the leaderboard" is surprisingly motivating even though QuickFalcon42 is a random string someone got three minutes ago. People name themselves. They check back to see if their name is still in the top 10. The absence of a real account doesn't reduce this effect much.

Daily resets reduce intimidation. On a permanent leaderboard, a 180 WPM typist who's been there for two years makes every new visitor feel hopeless. A daily leaderboard lets a 95 WPM typist realistically place in the top 10 on a quiet morning. It stays competitive.

Zero friction means more completions. This is the real one. In early testing (before I shipped the leaderboard), about 60% of visitors who started a race finished it. After shipping the leaderboard, that number went up — people who were going to quit mid-race sometimes pushed through to post a score.


If you're building anything with a competitive element and you're considering whether to require accounts first: ship the no-account version. You can always add accounts later. You cannot un-kill the momentum you lost from the friction.

Try the leaderboard at clackpit.launchyard.app — the daily reset is at midnight UTC if you want to plant a flag.

Top comments (0)