Building QuizApp: A Full-Stack Timed Quiz Platform
Project Overview
I recently built and shipped QuizApp, a full-stack quiz application designed for educators and learners who want a clean, competitive quiz experience. Here's a look at what it does and how it's built. What It Does QuizApp lets admins create timed quizzes — both multiple-choice (up to 6 options) and true/false — with configurable time limits. Users browse published quizzes, take them under a live countdown, and get instant, per-question feedback the moment they submit. Scoring follows a simple negative-marking scheme: +1 for a correct answer, -1 for an incorrect one, and 0 for anything skipped. Results feed into a global leaderboard, a per-quiz leaderboard, and a personal score history on each user's profile. The Stack Backend: Laravel 12, Sanctum for cookie-based SPA authentication, MySQL Frontend: React 19, Vite, React Router v7, Tailwind CSS Testing: Pest/PHPUnit, covering auth, role enforcement, quiz CRUD, and scoring logic A Few Details I Cared About Trustworthy timers. The countdown is driven by an expiresAt timestamp from the server, not Date.now() on the client. Refreshing the page or messing with local state doesn't buy extra time — the quiz still auto-submits the moment the server-side deadline passes. Server-side authority. Roles are never trusted from the client; they're always assigned on the backend. The is_correct flag on quiz options is stripped from every API response sent to non-admin users, so there's no way to peek at answers through the network tab. Layered access control. Admin routes are protected twice — once by Sanctum's auth middleware, and again by a dedicated AdminMiddleware — and the whole session model avoids storing any tokens in localStorage. Real test coverage. The scoring logic is tested against all-correct, all-incorrect, all-skipped, and mixed-answer scenarios, alongside leaderboard ranking and role-based access.