DEV Community

Cover image for How we built a daily developer quiz that resists DevTools cheating
RAYZEN for Wild Devs

Posted on

How we built a daily developer quiz that resists DevTools cheating

When Wordle blew up in 2022, everyone who writes JavaScript probably did the exact same thing within thirty seconds of loading the page: opened DevTools, clicked into the sources panel, and found the entire solution list sitting in plaintext inside the bundle. It did not ruin Wordle, because most players are not software engineers. But if you build a daily puzzle specifically for programmers, sysadmins, and security folks, that assumption immediately falls apart.

If your users spend their working hours debugging APIs, reading minified code, and inspecting DOM nodes, your game will be taken apart in the first five minutes. That was the main technical problem we had to solve when building 0xDLE, a daily bilingual puzzle with ten different tasks ranging from icon recognition and hex dumps to code snippets and timeline sorting.

Here is how we structured the architecture to keep the game fast, playable without registration, and resilient against inspect-element shortcuts.

Why client-side validation is a dead end

Most browser puzzles keep everything in the browser for good reasons. It is cheap to host, works offline, and gives instant feedback without network latency. The minute a player types an answer, the client already knows if it is right.

For a developer game, that model is dead on arrival. You cannot just obscure strings with base64 or run a basic scrambler. Obfuscating client-side JavaScript only stops people who do not know how to set a breakpoint or read network traffic. The moment an answer exists anywhere in browser memory, someone will write a two-line console snippet to extract it.

The only real boundary is moving evaluation entirely to the backend. The client receives the puzzle prompt, like a cropped icon, an obfuscated hex snippet, or an attribute list, but never the solution string or the lookup table.

Here is the simplified flow:

[ Browser UI ]
      |
      | 1. GET /api/day (receives prompts only: cropped images, snippets, metadata)
      v
[ Fastify Server ]
      |
      | 2. POST /api/solve { slot: 3, guess: "docker" }
      v
[ SQLite / Rules Engine ]
      |
      | 3. Verifies against server pool & records attempt in session row
      v
[ Response: { solved: true, tries: 2, points: 2 } ] (No future answers leaked)
Enter fullscreen mode Exit fullscreen mode

Handling guests without registration friction

Forcing people to sign up before playing a daily puzzle kills retention before you even start. Nobody wants to fill out a registration form just to guess an icon.

To make this work without turning the backend into an open proxy for spam, we treat guests and registered accounts almost identically in the database. When someone visits for the first time, the server issues an anonymous, secure httpOnly session cookie. Solves, attempt counts, and daily streaks are attached to that visitor ID in SQLite.

// Resolving actor identity cleanly in Fastify
async function resolveActor(request, reply) {
  const user = await authService.currentUser(request);
  if (user) {
    return {
      type: 'user',
      id: String(user.id),
      username: user.username,
    };
  }

  // Fallback to anonymous session cookie
  const guestId = authService.getOrCreateGuestSession(request, reply);
  return {
    type: 'guest',
    id: guestId,
    username: null,
  };
}
Enter fullscreen mode Exit fullscreen mode

If the player later decides to create an account, those guest rows get merged into the new user profile automatically. This keeps latency under twenty milliseconds while ensuring that no amount of client-side inspection can bypass the attempt counter.

Server-side solve evaluation

When a player submits a guess, the endpoint verifies the attempt count before doing any string comparisons. If a slot has already reached its maximum allowed tries, the request is rejected immediately:

fastify.post('/api/solve', async (request, reply) => {
  const actor = await resolveActor(request, reply);
  const { slot, guess } = request.body;

  // 1. Fetch current progress row from SQLite
  const progress = await Progress.findOne({
    where: {
      actorType: actor.type,
      actorId: actor.id,
      date: todayBerlin(),
      slot,
    },
  });

  const maxTries = MAX_TRIES_BY_KIND[slot.kind];
  if (progress?.solved || (progress?.tries >= maxTries)) {
    return reply.status(400).send({ error: 'Task already completed or out of tries' });
  }

  // 2. Score the guess against server-only content pool
  const isCorrect = rulesEngine.verifyAnswer(slot, guess);
  const newTries = (progress?.tries || 0) + 1;

  // 3. Persist updated score
  await Progress.upsert({
    actorType: actor.type,
    actorId: actor.id,
    date: todayBerlin(),
    slot,
    tries: newTries,
    solved: isCorrect,
    points: isCorrect ? calculatePoints(slot.kind, newTries) : 0,
  });

  return {
    solved: isCorrect,
    tries: newTries,
    remainingTries: Math.max(0, maxTries - newTries),
  };
});
Enter fullscreen mode Exit fullscreen mode

Because scoring happens on the server, players can inspect the network response all day: they will only ever see their own guess result and remaining attempts.

Rate limiting and dictionary attacks

If you have a puzzle based on technology names or short definitions, a simple script could brute-force 5,000 common tech terms in under a minute.

We mitigate this with two layers:

  1. Hard attempt caps per puzzle: Most tasks permit between 3 and 6 attempts. After that, the task locks for the day. A brute-force script guessing random dictionary words simply burns the player's daily run on attempt 3.
  2. Fastify rate limiting: Endpoints are capped per IP and session to prevent automated discovery of API parameters.

Zero-spoiler share mechanics

A daily game thrives on players sharing their results in chat channels, Discord servers, and social feeds. The share output has to communicate skill and effort without giving away a single answer.

Our share string generates a compact matrix of status blocks:

0xDLE #042 8/10 (26 pts)
🟩🟩🟨🟩🟩
🟩🟥🟩🟩🟩
https://0xdle.rayzen.dev
Enter fullscreen mode Exit fullscreen mode
  • Each block represents one of the ten daily tasks.
  • Green indicates solved on first attempt, yellow on later attempts, red means out of tries.
  • The clipboard helper uses standard navigator.clipboard with plain text, so it pastes cleanly into terminals, Slack, Discord, or X without breaking formatting.

Key takeaways

  1. Never ship solutions to the client if your players know what F12 does. Obfuscation is an inconvenience, not security.
  2. Fastify and SQLite (WAL mode) easily handle daily bursts with response times below 15ms, making server-side checks feel as responsive as local JavaScript.
  3. Guest sessions via signed httpOnly cookies let users play instantly without requiring accounts on day one.

Written by RAYZEN, building browser games, niche tools, and web experiments with the Wild Devs Community. Try today's run at 0xDLE or join our Discord to talk.

Top comments (0)