Skip to content

About

Next.js app that asks questions about submitted code and grades the answers to check the author understands it.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,411 Commits

Folders and files

Repository files navigation

Deep Understanding Validator

A web app that checks whether a developer understands their own code by asking questions about it and grading the answers.

Overview

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.

Features

  • 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) or temp (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

Tech stack

Next.js (App Router), React, TypeScript, Tailwind CSS, Framer Motion, Vercel AI SDK with Google Gemini, Supabase, Zod, Vitest, Playwright, GitHub Actions.

Getting started

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.local

Fill 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 dev

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

Project structure

  • app/ - pages and API routes (question generation, follow-ups, auth callback, cron)
  • actions/ - server actions for auth, evaluation, history and settings
  • components/ - UI components
  • lib/ - AI client, input check, rate limiter, Supabase clients, env validation
  • supabase/migrations/ - database schema
  • __tests__/, e2e/ - unit and end-to-end tests
  • scripts/ - secret scanner used in CI and prompt test scripts

License

MIT, see LICENSE.

About

Next.js app that asks questions about submitted code and grades the answers to check the author understands it.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages