{"id":29395192,"url":"https://github.com/ydv-ankit/ai-quiz-generator","last_synced_at":"2026-04-08T20:03:21.612Z","repository":{"id":302862499,"uuid":"934036512","full_name":"ydv-ankit/ai-quiz-generator","owner":"ydv-ankit","description":"practice subject topics with multiple choice questions generated by AI","archived":false,"fork":false,"pushed_at":"2025-07-08T02:33:30.000Z","size":1707,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T11:25:19.254Z","etag":null,"topics":["api","appwrite","authentication","lms","nextjs","reactjs","shadcn-ui","tailwindcss","typescript","zustand"],"latest_commit_sha":null,"homepage":"https://quiz.ankitydv.in","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ydv-ankit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-17T07:00:54.000Z","updated_at":"2025-07-08T02:33:33.000Z","dependencies_parsed_at":"2025-07-04T14:20:53.040Z","dependency_job_id":null,"html_url":"https://github.com/ydv-ankit/ai-quiz-generator","commit_stats":null,"previous_names":["ydv-ankit/ai-quiz-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ydv-ankit/ai-quiz-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydv-ankit%2Fai-quiz-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydv-ankit%2Fai-quiz-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydv-ankit%2Fai-quiz-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydv-ankit%2Fai-quiz-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ydv-ankit","download_url":"https://codeload.github.com/ydv-ankit/ai-quiz-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydv-ankit%2Fai-quiz-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","appwrite","authentication","lms","nextjs","reactjs","shadcn-ui","tailwindcss","typescript","zustand"],"created_at":"2025-07-10T11:17:19.328Z","updated_at":"2026-04-08T20:03:21.581Z","avatar_url":"https://github.com/ydv-ankit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 AI Quiz Generator\n\nA modern, full-stack web application that generates personalized quizzes using AI. Built with Next.js 14, TypeScript, and Appwrite for authentication and data storage.\n\n### Test Credentials:\n- Email: `ankit@mail.com`\n- Password: `ankit123`\n\n## ✨ Features\n\n### 🎯 Core Functionality\n- **AI-Powered Quiz Generation**: Create custom quizzes based on subjects, topics, and difficulty levels\n- **Smart Authentication**: Secure user authentication with session management\n- **Real-time Dashboard**: Track quiz performance and completion statistics\n- **Responsive Design**: Beautiful, modern UI that works on all devices\n- **Dark/Light Mode**: Built-in theme switching for better user experience\n\n### 🔐 Security \u0026 Protection\n- **Route Protection**: Middleware-based authentication for protected routes\n- **Session Management**: Automatic session cleanup and conflict prevention\n- **Client-Side Guards**: Additional client-side authentication checks\n- **Secure Cookies**: HttpOnly cookies with proper security attributes\n\n### 📊 Analytics \u0026 Tracking\n- **Performance Metrics**: Track average scores and completion rates\n- **Quiz History**: View all completed quizzes with detailed results\n- **Progress Tracking**: Monitor learning progress over time\n- **Sorting \u0026 Filtering**: Results sorted by completion date (newest first)\n\n## 🚀 Tech Stack\n\n### Frontend\n- **Next.js 14**: React framework with App Router\n- **TypeScript**: Type-safe development\n- **Tailwind CSS**: Utility-first CSS framework\n- **Zustand**: State management with persistence\n- **React Hook Form**: Form handling with validation\n- **Zod**: Schema validation\n- **Lucide React**: Beautiful icons\n\n### Backend \u0026 Services\n- **Appwrite**: Backend-as-a-Service for authentication and database\n- **OpenAI GPT**: AI-powered quiz generation\n- **Vercel**: Deployment and hosting\n\n### UI Components\n- **shadcn/ui**: Modern, accessible component library\n- **Sonner**: Toast notifications\n- **Framer Motion**: Smooth animations\n\n## 📦 Installation\n\n### Prerequisites\n- Node.js 18+ \n- Yarn or npm\n- Appwrite account\n- OpenAI API key\n\n### 1. Clone the Repository\n```bash\ngit clone \u003crepository-url\u003e\ncd ai-quiz-generator\n```\n\n### 2. Install Dependencies\n```bash\nyarn install\n# or\nnpm install\n```\n\n### 3. Environment Setup\nCopy the environment sample file and configure your variables:\n\n```bash\ncp env.sample .env.local\n```\n\nUpdate `.env.local` with your credentials:\n\n```env\n# Appwrite Configuration\nNEXT_PUBLIC_APPWRITE_HOST_URL=appwrite_host_url\nNEXT_PUBLIC_PROJECT_ID=project_id\nAPPWRITE_API_KEY=appwrite_api_key\n\n# OpenAI Configuration\nOPENAI_API_KEY=openai_api_key\n\n# Database IDs (from Appwrite)\nNEXT_PUBLIC_DATABASE_ID=database_id\nNEXT_PUBLIC_QUIZ_COLLECTION_ID=quiz_collection_id\nNEXT_PUBLIC_QUESTION_COLLECTION_ID=question_collection_id\nNEXT_PUBLIC_RESULTS_COLLECTION_ID=results_collection_id\nNEXT_PUBLIC_USER_COLLECTION_ID=user_collection_id\n```\n\n### 4. Appwrite Setup\n\n#### Create Collections\n1. **Users Collection**: Store user profiles\n2. **Quizzes Collection**: Store quiz metadata\n3. **Questions Collection**: Store individual questions\n4. **Results Collection**: Store quiz completion results\n\n#### Set Permissions\nConfigure appropriate read/write permissions for each collection based on user roles.\n\n### 5. Run Development Server\n```bash\nyarn dev\n# or\nnpm run dev\n```\n\nVisit [http://localhost:3000](http://localhost:3000) to see the application.\n\n## 🎮 Usage\n\n### For Users\n\n1. **Sign Up/Login**: Create an account or log in to your existing account\n2. **Generate Quiz**: Navigate to the \"Generate\" page\n3. **Configure Quiz**: \n   - Enter subject (e.g., \"Mathematics\", \"Physics\")\n   - Add specific topics (press Enter to add each topic)\n   - Select difficulty level (Easy, Medium, Hard)\n   - Set number of questions\n   - Add optional additional instructions\n4. **Take Quiz**: Complete the generated quiz\n5. **View Results**: Check your performance in the dashboard\n\n### For Developers\n\n#### Project Structure\n```\nai-quiz-generator/\n├── app/                    # Next.js App Router pages\n│   ├── (auth)/            # Authentication pages\n│   ├── api/               # API routes\n│   ├── dashboard/         # Protected dashboard\n│   ├── generate/          # Quiz generation\n│   ├── quiz/              # Quiz taking interface\n│   └── results/           # Results display\n├── components/            # Reusable UI components\n│   ├── ui/               # shadcn/ui components\n│   ├── auth-guard.tsx    # Authentication wrapper\n│   └── ...\n├── store/                # Zustand state management\n│   └── auth.ts           # Authentication store\n├── utils/                # Utility functions\n├── models/               # Appwrite configuration\n└── middleware.ts         # Route protection\n```\n\n#### Key Components\n\n**Authentication Flow**\n- `middleware.ts`: Server-side route protection\n- `components/auth-guard.tsx`: Client-side authentication\n- `store/auth.ts`: Authentication state management\n- `utils/auth-utils.ts`: Cookie management\n\n**Quiz Generation**\n- `app/generate/page.tsx`: Quiz configuration interface\n- `app/api/create/route.ts`: Quiz generation API\n- `utils/gpt/gpt.ts`: OpenAI integration\n\n**Dashboard \u0026 Analytics**\n- `app/dashboard/page.tsx`: Main dashboard\n- `components/charts/quiz-stats.tsx`: Performance charts\n- `components/completed-quizzes.tsx`: Quiz history\n\n## 🔧 Configuration\n\n### Customizing Quiz Generation\nEdit `utils/gpt/gpt.ts` to modify the AI prompt and quiz generation logic.\n\n### Styling\nThe project uses Tailwind CSS. Customize styles in `tailwind.config.ts` and `app/globals.css`.\n\n### Authentication\nModify `store/auth.ts` to change authentication behavior or add additional user roles.\n\n## 🚀 Deployment\n\n### Vercel (Recommended)\n1. Connect your GitHub repository to Vercel\n2. Configure environment variables in Vercel dashboard\n3. Deploy automatically on push to main branch\n\n### Manual Deployment\n```bash\n# Build the application\nyarn build\n\n# Start production server\nyarn start\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 🆘 Support\n\nIf you encounter any issues:\n\n1. Check the [Issues](https://github.com/your-repo/issues) page\n2. Create a new issue with detailed information\n3. Include steps to reproduce the problem\n\n**Made with ❤️ by Ankit Ydv**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fydv-ankit%2Fai-quiz-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fydv-ankit%2Fai-quiz-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fydv-ankit%2Fai-quiz-generator/lists"}