MK-QuizFlow

PRODUCT_SPEC.md — MK QuizFlow v2

Product: MK QuizFlow · Domain: https://quizflow.mkazi.live · Repo: https://github.com/mk-knight23/MK-QuizFlow Author: Kazi Musharraf · License: MIT · Stack: Next.js App Router + TypeScript strict + Tailwind v4 + pnpm (STANDARDS §1).

1. Objective

Turn study material (PDF or pasted text/markdown) into working study artifacts — quizzes and flashcard decks — entirely in the browser, with an optional AI layer for higher-quality question generation. Local-first: documents are never stored server-side, all user data lives in IndexedDB. The core tool must work end-to-end with zero AI keys via the deterministic Quick mode.

2. Personas

  1. Exam-prep student (primary). Uploads lecture PDFs the night before a test. Wants questions fast, retakes only what she got wrong, and cares that nothing is uploaded anywhere.
  2. Teacher/tutor. Pastes course notes, generates a question set, edits and reorders it, exports to printable HTML/PDF or CSV for a class handout or LMS import.
  3. Professional certifier / lifelong learner. Works through long technical PDFs chapter by chapter (page ranges), uses flashcards with spaced self-grading and the weak-topic analysis to focus revision.

3. Features and acceptance criteria

3.1 V1 core — deterministic, must work with zero AI keys

F1. Document input

F2. Quick mode (no AI) — deterministic generator

F3. Quiz player

F4. Question management

F5. Flashcards

F6. Export

F7. Share & import safety

3.2 AI features — POST /api/ai/* (Vercel AI Gateway, STANDARDS §10)

Route pattern: zod input → rate limit → quota → generateObject/streamText with gateway model strings (AI_MODEL default anthropic/claude-haiku-4.5, AI_MODEL_QUALITY default anthropic/claude-sonnet-4-5). All responses are structured outputs validated with zod schemas. Uploaded documents are never stored server-side; text is streamed to the route and discarded after the response.

3.3 Dashboard & history — real local data only

4. Non-goals (v1)

5. Page map (STANDARDS §4)

/ landing · /tool quiz workspace (upload → configure → generate → play) · /flashcards deck player (product-appropriate extension) · /dashboard · /history · /settings (clear/export/import data, consent, BYOK) · /docs · /use-cases/* (≥5: exam prep, teaching handouts, certification study, onboarding/training, language vocab) · /guides/* (≥8 substantial originals) · /faq · /changelog · /about · /creator · /open-source · /privacy · /terms · /cookies · /contact · custom not-found.tsx · root error.tsx.

SEO per STANDARDS §5 (metadata, sitemap, robots, JSON-LD incl. WebApplication, FAQPage, Article/HowTo on guides, Person on /creator). Footer sentence on every public route: “Built and maintained by Kazi Musharraf. Open source for everyone.”

6. Privacy constraints (binding)

7. Definition of done (this phase)

Zero TS errors · vitest green · Playwright smoke green locally · all §5 pages with real content · Quick mode works end-to-end offline · dashboard shows real local data · docs complete · clean conventional commits on rebuild/v2. Deployment is orchestrator-owned.