SapCoach is an interactive SAP certification training app for S/4HANA Sales & Distribution exam prep. It runs as a single-page React app with shuffled multiple-choice questions, optional AI-generated challenge items, timed attempts, clue hints, and persistent score tracking — all stored locally in the browser.
What it does
Home screen
Landing view with test overview and personal statistics:
- 39 standard questions covering SAP SD topics (pricing, delivery scheduling, goods issue, condition exclusion, BOM sub-items, payer data, and more)
- Progress tracking — last score, best score, and total attempts saved via
localStorage - Timed test — elapsed time shown during each attempt
- Theme toggle — light/dark mode via
useThemehook
Two start modes:
| Mode | Questions | Description |
|---|---|---|
| Standard Test | 39 | Original certification-style questions only |
| AI Challenge | 64 | Standard set plus 25 AI-generated questions (flagged as potentially containing errors) |
Test flow
During a test session:
- Questions appear in random order each attempt (
shuffleQuestions) - Progress bar shows current position (e.g. 12 / 39)
- Live timer counts elapsed seconds in the header
- Multi-select support — questions with 2–3 correct answers use checkboxes with a max-selection limit; single-answer questions use radio buttons
- Clue hints — after wrong attempts, users can reveal a contextual hint (
cluefield per question) - Answer reveal — optional show-correct-answer for study mode
- Previous / Next navigation between questions
- Abandon dialog — confirms before returning home and losing progress
Results screen
After finishing, TestResults displays:
- Current score percentage, time taken, previous score, and best score
- New Best badge when a personal record is beaten
- Per-question breakdown with correct/incorrect indicators
- Retake and Go Home actions
Question bank
src/data/questions.ts holds the full question set:
- 39 standard questions — SAP SD certification-style items with
correctAnswers,options, and optionalcluetext - 25 AI questions (
aiQuestions) — additional items markedisAiGenerated: truefor the challenge mode
Topics include schedule line categories, automatic pricing setup, goods issue effects, condition exclusion, group conditions, payer master data, BOM structure scope, and precise delivery scheduling.
Tech stack
| Layer | Choice |
|---|---|
| Framework | React 18 + TypeScript + Vite |
| UI | shadcn/ui + Tailwind CSS |
| State | React useState + custom useLocalStorage hook |
| Data fetching | TanStack React Query (provider scaffold) |
| Routing | React Router 6 (single-page, / only) |
| Icons | Lucide React |
| Toasts | Sonner + shadcn Toaster |
No backend — all question data is static TypeScript; scores and attempt history persist in localStorage under the key sap-cert-stats.
Development process
Initial build
Scaffolded from the Lovable/Vite React template. Implemented the full test flow:
questions.ts— 39 SAP SD certification questions with cluesaiQuestions— 25 AI-generated challenge questionsIndex.tsx— home, testing, and results state machineQuestionCard— multi/single select, hint reveal, answer reveal, Note parsingTestResults— score summary and question-by-question reviewProgressBar,ThemeToggle,useLocalStorage,testUtils(shuffle, scoring, time format)
Mobile polish
solved overflow issues on question card mobile view — fixed layout overflow on small screens so long question text and option lists scroll correctly on mobile devices.


Building Smartclic Demo