{"id":48329697,"url":"https://github.com/githubak2002/quizifyai","last_synced_at":"2026-04-05T01:00:43.307Z","repository":{"id":337230200,"uuid":"871806015","full_name":"Githubak2002/QuizifyAI","owner":"Githubak2002","description":"QuizifyAI - Quiz with AI - a quiz web application built using the MERN stack with advanced JWT authentication and AI-generated quizzes through the Google Gemini API. This application allows users to take quizzes on various topics, generate quizzes using AI, and offers a secure and user-friendly experience.","archived":false,"fork":false,"pushed_at":"2026-02-08T12:42:53.000Z","size":497,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T19:43:14.858Z","etag":null,"topics":["ai","gemini-api","jwt-authentication","mern-stack","tailwindcss"],"latest_commit_sha":null,"homepage":"https://ai-quiz-mern.onrender.com","language":"JavaScript","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/Githubak2002.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-13T01:46:27.000Z","updated_at":"2026-02-08T12:42:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Githubak2002/QuizifyAI","commit_stats":null,"previous_names":["githubak2002/quizifyai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Githubak2002/QuizifyAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Githubak2002%2FQuizifyAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Githubak2002%2FQuizifyAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Githubak2002%2FQuizifyAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Githubak2002%2FQuizifyAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Githubak2002","download_url":"https://codeload.github.com/Githubak2002/QuizifyAI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Githubak2002%2FQuizifyAI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31420789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ai","gemini-api","jwt-authentication","mern-stack","tailwindcss"],"created_at":"2026-04-05T01:00:22.142Z","updated_at":"2026-04-05T01:00:43.295Z","avatar_url":"https://github.com/Githubak2002.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [QuizifyAI → live here](https://ai-quiz-mern.onrender.com/) ✨\n\nQuizifyAI — a quiz web application built using the MERN stack (MongoDB, Express, React, Node.js) with advanced JWT authentication and AI-generated quizzes through the Google Gemini API. This application allows users to take quizzes on various topics, generate quizzes using AI, and offers a secure and user-friendly experience.\n\n\u003cimg width=\"1099\" alt=\"QuizifyAI\" src=\"https://github.com/user-attachments/assets/5d7ce235-1493-449e-81a7-a52a9fb2bb87\"\u003e\n\n## Features\n\n- **Advanced JWT Authentication**: Secure user authentication with features such as email verification and password recovery.\n- **Take Quizzes on Various Topics**: Explore a wide range of topics and test your knowledge.\n- **AI-Generated Quizzes**: Generate quizzes on any topic using the Google Gemini API for an engaging learning experience.\n- **Beginner Friendly**: Easy to use interface suitable for all users, regardless of technical expertise.\n- **Fully Secure**: All user data is handled securely with best practices in mind.\n\n### Functionality\n- **Email Verification**: Confirmation emails sent upon signup.\n- **Error Handling**: Informative messages for various scenarios.\n- **Forgot Password \u0026 Reset**: Password recovery via email.\n- **Signup, Login, Logout Endpoints**: RESTful API for user management.\n- **Check Auth Endpoint**: Verifies user authentication.\n- **Sending Verification Emails**: Automated verification process.\n\n### Frontend Setup\n- **User-Friendly UI**: Responsive signup and login pages.\n- **Signup Logic**: User registration with validation.\n- **Email Verification Integration**: Activation link sent to users.\n- **Protected Routes**: Access restriction for authenticated users.\n- **Secure Login**: JWT-based session management.\n- **Forgot Password Handling**: UI for password reset requests.\n\n### Backend Setup\n- **MERN Stack**: Node.js and Express for API handling.\n- **MongoDB**: Secure storage for user and quiz data.\n- **JWT Authentication**: Secure access to protected routes.\n- **RESTful API Development**: Smooth communication between frontend and backend.\n- **Google Gemini API Integration**: AI-generated quizzes on user-defined topics.\n\n\n\n## Technologies Used\n\n- **Frontend**: React, Tailwind CSS\n- **Backend**: Node.js, Express\n- **Database**: MongoDB\n- **Authentication**: JWT (JSON Web Tokens)\n- **AI Integration**: Google Gemini API\n- **Zustand** (State Management)\n\n\n## NPM Package Details\n\n- **cookie-parser**: Middleware to parse cookies\n- **jsonwebtoken**: For generating and verifying JSON Web Tokens (JWTs)\n- **dotenv**: For managing environment variables\n- **express**: A web framework for Node.js\n- **bcryptjs**: For hashing passwords\n- **mongoose**: An Object Data Modeling (ODM) library for MongoDB\n- **nodemon**: Automatically restarts the server when file changes are detected\n- **mailtrap**: For testing email sending (if using Mailtrap)\n- **crypto**: Built-in package for cryptographic functions\n  - `randomInt(10, 20)`\n  - `randomBytes(20).toString('hex')`\n\n---\n\n## JWT Methods\n\n1. **`jwt.sign(payload, secretOrPrivateKey, options)`**\n   - **Purpose**: Create a new JWT.\n   - **Parameters**:\n     - `payload`: Data to include in the token (e.g., user ID, roles).\n     - `secretOrPrivateKey`: Secret key to sign the token.\n     - `options`: Optional settings (e.g., expiration time).\n   - **Usage**: Generate a token to send to clients or store for later use.\n   - **Example**:\n     ```javascript\n     const token = jwt.sign({ userId: '1234' }, 'your-secret-key', { expiresIn: '1h' });\n     ```\n\n2. **`jwt.verify(token, secretOrPublicKey, options, callback)`**\n   - **Purpose**: Check if a JWT is valid and decode it.\n   - **Parameters**:\n     - `token`: The JWT to verify.\n     - `secretOrPublicKey`: Key used to sign the token for verification.\n     - `options`: Optional settings (e.g., expected audience).\n     - `callback`: Function called with verification result or error.\n   - **Usage**: Verify token validity and extract payload if valid.\n   - **Example**:\n     ```javascript\n     jwt.verify(token, 'your-secret-key', (err, decoded) =\u003e {\n       if (err) {\n         console.error('Invalid token');\n       } else {\n         console.log('Decoded payload:', decoded);\n       }\n     });\n     ```\n\n3. **`jwt.decode(token, options)`**\n   - **Purpose**: Decode a JWT without verifying its signature.\n   - **Parameters**:\n     - `token`: The JWT to decode.\n     - `options`: Optional settings (e.g., whether to get header or payload).\n   - **Usage**: Extract and view token payload without validation. Useful for debugging.\n   - **Example**:\n     ```javascript\n     const decoded = jwt.decode(token);\n     console.log('Decoded payload:', decoded);\n     ```\n\n---\n\n# Zustand Store Usage\n\nZustand is a small, fast, and scalable state management solution for React applications. It provides a simple API for managing global state with minimal boilerplate.\n\n## Key Points\n\n### Creating a Store\nTo create a global state store, use the `create` function from Zustand:\n```javascript\nimport create from 'zustand';\n\nconst useCountStore = create((set) =\u003e ({\n  count: 0,\n  increaseCount: () =\u003e set((state) =\u003e ({ count: state.count + 1 })),\n}));\n\n```\n\n### Reading a state\n```javascript\nconst count = useCountStore((state) =\u003e state.count);\n```\n\n### Updating a state\nUpdate the state using setState\n```javascript\nuseCountStore.setState({ count: 0 });\n```\n\nUse \"setState\" when you want to update the state - Example -\n```javascript\nuseAuthStore.setState({ forgotPassPopup: true });\n```\n  \nUse the \"selector function\" when you want to read state values - Example - \n```javascript\nconst isVisible = useAuthStore((state) =\u003e state.forgotPassPopup);\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubak2002%2Fquizifyai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithubak2002%2Fquizifyai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubak2002%2Fquizifyai/lists"}