Inspiration
Most online quiz platforms feel cluttered, slow, or require mandatory sign-ups just to test your knowledge on a quick topic. I wanted to build QuizPulse—a fast, distraction-free, and security-hardened single-page quiz application where anyone can jump straight into a timed challenge, select a category, and track their progress locally without sacrificing privacy.
What it does
- Timed Interactive Quizzes: Presents questions with a 15-second countdown timer per question, instant visual feedback, and automated score calculation.
- Dynamic Category Selection: Fetches curated question sets from a custom REST API depending on the chosen topic.
- Local Score History: Automatically logs every completed attempt (score, total questions, and timestamp) inside the browser using IndexedDB (
QuizPulseDB) so users can review their progress anytime. - Zero-Reload SPA Navigation: Seamless switching between the Home screen, active Quiz mode, and History journal via client-side routing.
How we built it
- Frontend: Built with Vue 3, semantic HTML5, and modern CSS3 for a responsive, reactive user interface.
- Backend: Powered by Node.js and Express.js, serving both static assets and RESTful JSON endpoints (
/api/questionsand/api/questions/:id). - Client-Side Storage: Implemented a custom IndexedDB persistence layer (with
LocalStoragemigration flags) to store user history reliably on the client side without requiring an external database or user accounts.
Challenges we ran into
- DOM-based XSS Vulnerability in HTML Entity Decoding: Initially, API question strings containing encoded HTML entities were decoded by assigning them to a temporary
<textarea>viainnerHTML. Even though<textarea>doesn't execute scripts directly, it left raw HTML tags intact downstream, creating a latent XSS risk. I solved this by refactoring the decoder to use the nativeDOMParserAPI combined withtextContent, safely stripping any potentially malicious markup in an inactive document. - Client-Backend Integration & State Sync: Transitioning from external trivia APIs to a local Express backend while keeping asynchronous loading states, timers, and shuffled answer options synchronized cleanly.
Accomplishments that we're proud of
- Security-First Client Architecture: Eliminated raw HTML injection sinks (
innerHTML/v-html), enforced strictDOMParsersanitization, and ensured zero sensitive data or credentials are ever stored inLocalStorageorIndexedDB. - Clean Full-Stack Separation: Designed a self-contained Express API and reactive Vue 3 frontend that works smoothly and reliably out of the box.
What we learned
- How subtle DOM-based XSS vectors hide inside seemingly harmless utility functions, and why
DOMParser+textContentis vastly safer thaninnerHTMLtricks. - How to structure a full-stack JavaScript application with RESTful endpoints, client-side hash routing, and browser-native IndexedDB storage.
- Best practices for maintaining a clean Git history, resolving branch merges, and keeping build artifacts (
node_modules) properly excluded.
What's next for QuizPulse
- Custom Quiz Creator: Allow users to create, export, and share their own JSON question packs.
- Difficulty Levels & Streaks: Add adaptive difficulty modes, daily streaks, and detailed category-by-category analytics charts.
- Leaderboard & Multiplayer Mode: Introduce optional WebSocket rooms for real-time head-to-head quiz battles with friends.
Built With
- css3
- express.js
- html5
- indexeddb
- javascript
- node.js
- rest-api
- vue.js