QuizWarts is a modern, responsive micro-quiz platform built with Next.js. It allows users to browse quizzes across various subjects, take them, and track their performance over time.
- Setup and Running Locally
- Design Decisions & Next.js Implementation
- Challenges Faced & Solutions
- AI Coding Tools Utilization
Follow these steps to get QuizWarts up and running on your local machine.
- Node.js (v18.x or later recommended)
- npm or Yarn
Clone the repository:
git clone (https://github.com/Nishat30/QuizWarts)
cd quizwartsInstall dependencies:
npm install
# or
yarn install🚀 Running the Development Server To run the application in development mode:
npm run dev
# or
yarn devOpen http://localhost:3000 in your browser to see the application. The page will hot-reload as you make changes.
QuizWarts leverages several key Next.js features to deliver a fast, efficient, and scalable user experience.
Quiz Categories and Individual Quiz Pages:
src/app/page.js: The homepage fetches category data at build time and renders the quiz category cards.src/app/quiz/[id]/page.js: This dynamic route usesgenerateStaticParamsto pre-render individual quiz pages based on available quiz IDs.
✅ Benefits: Improves performance, SEO, and reduces server load as pages are served as static HTML.
- Although not currently implemented, the architecture supports SSR for future dynamic features (e.g., authenticated dashboards).
- At present, all data is imported statically into components.
- Not yet used since all quiz data is imported directly.
- For future features (e.g., login, external APIs), Next.js API routes will be used.
next/imageis used to optimize images (lazy-load, resize, modern formats like WebP) for better performance and UX across all devices and network conditions.
Challenge:
Handling quiz logic, state, and localStorage on the client while keeping static data rendering on the server.
Solution:
- Marked
QuizClient.jswith"use client". - Passed
initialQuizDatafrom the server component (page.js) as props. - Encapsulated all interactivity and state inside the client component.
AI tools significantly accelerated development. They were used for:
- Resolving persistent errors
- JSX namespace build issues with Recharts
- Quick grasp of SSG, SSR, and
next/image - Tailwind best practices
- Scrollbar targeting and CSS quirks
We welcome contributions to make QuizWarts better! Whether it’s a bug fix, feature addition, UI improvement, or performance enhancement—your input is valuable.
-
Fork the Repository
Click theForkbutton on the top right of this repo. -
Clone Your Fork
git clone https://github.com/your-username/quizwarts.git cd quizwarts