A web app that checks whether a developer understands their own code by asking questions about it and grading the answers.
You paste a piece of code. The app generates a question about how that code behaves, evaluates your answer, and asks follow-up questions when the answer is incomplete. It runs on Next.js with Google Gemini as the model and Supabase for accounts and storage. A deployed version is available at https://deep-understanding-validator.vercel.app.
- Input check that rejects submissions that are not code (highlight.js detection plus a small Gemini model)
- Question generation, answer evaluation and follow-up questions, with beginner and advanced difficulty levels
- Final verdict at the end of each session
- Sign up and log in with email and password or Google (Supabase Auth)
- History of past sessions, with deletion
- Two storage modes:
supabase(persistent) ortemp(in memory) - Per-user rate limiting and DOMPurify sanitization of rendered content
- Mock AI mode (
USE_MOCK_AI=true) for running without an API key
Next.js (App Router), React, TypeScript, Tailwind CSS, Framer Motion, Vercel AI SDK with Google Gemini, Supabase, Zod, Vitest, Playwright, GitHub Actions.
Prerequisites: Node.js 20, a Supabase project, a Gemini API key.
git clone https://github.com/Tpchck/Deep-Understanding-Validator.git
cd Deep-Understanding-Validator
npm install
cp .env.example .env.localFill in .env.local (Supabase URL and anon key, GEMINI_API_KEY, STORAGE_MODE). Apply the SQL files in supabase/migrations/ to your Supabase database, then run:
npm run devThe app runs at http://localhost:3000.
Tests:
npm run test # unit tests (Vitest)
npm run test:security # security tests only
npm run test:e2e # end-to-end tests (Playwright)app/- pages and API routes (question generation, follow-ups, auth callback, cron)actions/- server actions for auth, evaluation, history and settingscomponents/- UI componentslib/- AI client, input check, rate limiter, Supabase clients, env validationsupabase/migrations/- database schema__tests__/,e2e/- unit and end-to-end testsscripts/- secret scanner used in CI and prompt test scripts
MIT, see LICENSE.