Skip to content

The-Learning-Algorithm/quiz-generator

Repository files navigation

Quiz Generator

A modern web application built with Next.js that generates interactive quizzes using AI. This project leverages OpenAI's API to create engaging quiz content with a beautiful, responsive UI.

You can read the blog post here

Features

  • 🤖 AI-powered quiz generation using OpenAI API
  • 🎨 Modern, responsive UI with Tailwind CSS and DaisyUI
  • ⚡ Fast development with Next.js 15 and Turbopack
  • 🔔 Real-time notifications with React Hot Toast
  • 📝 Type-safe development with TypeScript and Zod validation
  • 🎯 Interactive quiz experience

Tech Stack

  • Framework: Next.js 15 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS + DaisyUI
  • AI Integration: OpenAI API
  • Validation: Zod
  • Notifications: React Hot Toast
  • Development: Turbopack for faster builds

Getting Started

Prerequisites

  • Node.js 18+
  • npm, yarn, pnpm, or bun
  • OpenAI API key

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd quiz-generator
  1. Install dependencies:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
  1. Set up your environment variables: Create a .env.local file in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
  1. Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
  1. Open http://localhost:3000 with your browser to see the result.

Usage

  1. Navigate to the application in your browser
  2. Enter your quiz topic or subject
  3. Configure quiz settings (number of questions, difficulty, etc.)
  4. Generate your quiz using AI
  5. Take the interactive quiz

Available Scripts

  • npm run dev - Start development server with Turbopack
  • npm run build - Build the application for production
  • npm run start - Start the production server
  • npm run lint - Run ESLint for code quality

Project Structure

quiz-generator/
├── app/                 # Next.js app directory
│   ├── api/            # API routes
│   ├── components/     # React components
│   ├── utils/          # Utility functions
│   ├── layout.tsx      # Root layout
│   └── page.tsx        # Home page
├── lib/                # Library code
├── public/             # Static assets
├── data/               # Data files
└── ...config files

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Learn More

To learn more about the technologies used in this project:

Deployment

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out the Next.js deployment documentation for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published