How corn323/quiz-app-nuxt works
Project type and purpose
• This is a full-stack, server-side-rendered (SSR) quiz-generation web application built on Nuxt 3.
• It uses Vue 3 + Vuetify for UI, Prisma + SQLite for persistence, and Nuxt’s Nitro server/API routes for backend logic.
• Key feature: allow users to create, list, search, tag, and export quiz questions (including PDF generation).
File structure
• Top-level “app.vue”, “pages/” and “components/” hold the Vue UI (Nuxt’s file-based routing + component hierarchy).
• “plugins/vuetify.ts” bootstraps Vuetify into the Nuxt app.
• “server/api/questionDataHandler.js” defines a Nitro serverless endpoint for CRUD on questions.
• “prisma/schema.prisma” + “prisma/questions.db” define the data model and storage.
• “types/question.ts” defines shared TypeScript interfaces.
• “.nuxt/” holds the generated build artifacts (SSR engine, imports, manifests).
• Config files: nuxt.config.ts, tsconfig.json, server/tsconfig.json.
README for additional insights
• Timeline shows initial UI scaffolding, then database integration, then basic functionality.
• Mentions “doc” for PDF generation (see component GeneratePdfButton.vue).
• No complex microservices—single Nitro server with one API route file.
a. Main components
• Client (Browser + Vue/Vuetify SPA)
• Nuxt 3 SSR Server (Nitro)
• Server API Route (questionDataHandler)
• Prisma ORM Layer
• SQLite Database (questions.db)
• PDF/Doc Generation Module
• Static Assets (public/)
• Optional: TypeScript Types (shared between client & server)
b. Relationships & interactions
• Browser → HTTP GET/POST → Nuxt SSR server (initial HTML + hydration)
• Client-side Vue components → Nitro API calls → questionDataHandler → Prisma → SQLite DB
• GeneratePdfButton triggers either a client download or server-side PDF creation via a doc library (e.g., docx or pdfkit).
• Nuxt plugin (Vuetify) injects styling theme at build time.
c. Architectural patterns/design principles
• File-based routing (Nuxt pages → routes)
• Component-driven UI decomposition
• Single API handler for question data (monolith pattern, but isolated in server/api)
• ORM abstraction (Prisma) decouples business logic from raw SQL
• SSR for performance & SEO, with client-side hydration for interactivity
d. Key technologies/frameworks
• Nuxt 3 & Nitro (Vue SSR + serverless functions)
• Vue 3 + Vuetify (UX/UI framework)
• Prisma ORM + SQLite (embedded relational DB)
• TypeScript (type safety across layers)
• PDF/doc generation library (for export feature)
Detailed capture of essential elements
• File-based routing concept: map “pages/add-question.vue” → “/add-question” route, “pages/questions.vue” → questions listing route.
• Plugin initialization: “plugins/vuetify.ts” injecting Vuetify into the app context.
• Shared TypeScript “types/question.ts” used by both front and back.
• Prisma schema file as the source of truth for the data model.
• .nuxt build artifacts as part of the deployment bundle (optional detail).