Skip to content

ShrootBuck/nudge

Repository files navigation

nudge

Get unstuck without skipping straight to the answer.

Progressive hints, clean editorials, and full C++ solutions for Codeforces problems. Generated by Claude, served at your own pace.

Live Site


What is this?

Most editorial sites give you the whole answer or nothing. Nudge sits in between: every problem has progressive hints that go from a gentle nudge toward the right area all the way to the key insight, plus a prose editorial and the full C++ solution when you're ready.

All content is AI-generated using the Anthropic/OpenAI batch APIs, then stored in Postgres and served through a Next.js frontend. Problems are synced from the Codeforces API automatically.

  1. Sync — A weekly Trigger.dev scheduled task pulls every problem from the Codeforces API and upserts them into Postgres as backlog.
  2. Queue — Backfill moves backlog problems into the ready queue, prioritized by request count.
  3. Generate — A daily scheduler batches ready problems into provider batch API calls. The model generates five progressive hints, a Markdown editorial with LaTeX, and a complete C++ solution for each.
  4. Serve — Next.js renders the problem list with filtering by rating, tag, and search. Each problem page has collapsible hint panels so you control exactly how much you see.
  5. Recover — A daily midnight watchdog detects stale running batches older than 48 hours and marks them failed for retry.
  6. Report — Users can flag incorrect content. A daily digest sends new reports to Discord via webhook for human verification.

Tech stack

Layer Tech
Runtime Bun
Framework Next.js 16 (App Router, React Compiler)
Database PostgreSQL on Supabase
ORM Prisma v7 with @prisma/adapter-pg
Background jobs Trigger.dev v4
AI Provider-agnostic batch pipeline (Anthropic/OpenAI via structured outputs)
Styling Tailwind CSS v4, shadcn/ui
Linting Biome

Getting started

Prerequisites

  • Bun installed
  • A PostgreSQL database (Supabase, Neon, local, etc.)
  • An Anthropic and/or OpenAI API key (depending on active provider)
  • A Trigger.dev account + project

Setup

# Clone
git clone https://github.com/ShrootBuck/nudge.git
cd nudge

# Install
bun install

# Configure environment
cp .env.example .env
# Fill in DATABASE_URL, ANTHROPIC_API_KEY, TRIGGER_SECRET_KEY, etc.

# Push schema to your database
bunx prisma db push

# Run locally
bun dev

Background jobs

# Start the Trigger.dev dev server
bunx trigger dev

This connects to Trigger.dev and registers the scheduled tasks:

  • sync-problems — weekly Codeforces sync (Sundays at midnight MST)
  • generate-content-scheduler — daily batch generation (midnight MST)
  • generation-state-watchdog — daily stale-batch recovery (48h threshold)
  • report-digest — daily Discord digest of user-reported issues
  • backfill — manually triggered, queues backlog problems by rating/tag filters

Or, you know, use the live website

About

AI-powered progressive hints, editorials, and C++ solutions for Codeforces problems

Topics

Resources

Stars

Watchers

Forks

Contributors