How dagimg-dot/did-exit works
Project type and purpose
• This is a single-page, browser-only web application (no dedicated backend server)
• Purpose: allow users to upload PDF exams, extract multiple-choice questions via Google Gemini AI, cache results locally, and present them as interactive quizzes
File structure
• Top-level artifacts
– index.html: entry point
– Makefile: build/serve helper (e.g., static-server or optimization tasks)
– README.md: high-level overview
• /css: styling for components, theme toggle, quiz layout
• /js: pure-JS modules, each encapsulating a major feature
– ai-integration.js: handles calls to Google Gemini AI
– pdf-processor.js & pdf-analyzer.js: split, chunk, parse PDF files
– batch-processor.js: orchestrates progressive loading of questions
– file-uploader.js: drag-and-drop file interface
– database-manager.js: localStorage/IndexedDB caching of API keys and processed PDFs
– quiz-manager.js: drives quiz logic (question navigation, exam vs. feedback mode)
– theme-manager.js & ui-components.js: UI theming, shared widgets
– app-info.js & main.js: application bootstrap, event wiring
README for insights
• External dependency: Google AI Studio (Gemini API)
• Key features: smart caching, progressive loading, two quiz modes, responsive design
a. Main components (containers)
1. User Interface (Browser)
– index.html + /css + ui-components.js + theme-manager.js
2. Application Controller
– main.js (wires modules)
– file-uploader.js
– quiz-manager.js
3. Service Layer
– pdf-processor.js
– pdf-analyzer.js
– batch-processor.js
– ai-integration.js
4. Storage Layer
– database-manager.js (localStorage / IndexedDB)
5. External Service
– Google Gemini AI API
b. Relationships & data flows
• User → (click/drag) → File Uploader → PDF Processor
• PDF Processor → (chunks) → Batch Processor
• Batch Processor → AI Integration → Google AI
• Google AI → AI Integration → PDF Analyzer → Quiz Manager
• Quiz Manager → UI Components → User (render questions, capture answers)
• Database Manager ↔ PDF Processor & AI Integration (cache raw & processed data, API keys)
• Theme Manager ↔ UI Components (switch light/dark CSS)
c. Architectural patterns & design principles
• Modular JS: each file is a single responsibility module
• Progressive loading: pipeline via Batch Processor → UI
• Local caching: offline/resume capability via database-manager
• Clear separation: View (UI), Controller (main, quiz, file-uploader), Services (PDF, AI)
d. Key technologies
• Vanilla JS modules & ES6 imports
• Google Gemini AI REST API
• Browser localStorage/IndexedDB
• Drag-and-drop File API
• Responsive CSS (mobile-first)