A quiz application built with Next.js that allows users to create and answer questions.
- Framework: Next.js 15.1
- Database: PostgreSQL with Drizzle ORM
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: HeroUI
- Form Handling: React Hook Form
- Validation: Zod
- Animation: Framer Motion
- Runtime: React 19
- AI Integration: Google Generative AI (Gemini)
- 📝 Create and manage quizzes
- 🤖 AI-powered question generation using Google's Gemini
- 🎯 Intelligent question suggestions based on topics
- 💾 Persistent storage with PostgreSQL
- 📱 Responsive design
- ⚡ Fast page loads with Next.js
- 🎨 Modern UI with Tailwind CSS and HeroUI
- 🎬 Smooth animations with Framer Motion
- 📝 Type-safe development with TypeScript and Zod
- Clone the repository:
git clone <your-repo-url>
cd questions-answers
- Install dependencies:
npm install
- Set up your environment variables:
cp .env.example .env
Fill in your PostgreSQL database connection details and other required variables.
- Seed the database with sample data:
npm run seed
- Run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
src/
├── app/ # Next.js app directory
├── components/ # React components
├── db/ # Database schema and configurations
└── lib/ # Utility functions and configurations
npm run dev
- Start development servernpm run build
- Create production buildnpm run start
- Start production servernpm run lint
- Run ESLint for code lintingnpm run dbml
- Generate DBML documentationnpm run seed
- Populate database with sample quiz questions
This project uses PostgreSQL with Drizzle ORM for database management. The schema can be visualized using the DBML generator tool.
Running npm run seed
will populate your database with:
- 10 quiz questions across various categories (capitals, companies, historical events)
- Each question includes 1 correct answer and 2 wrong answers
- Answers are randomly shuffled for each question
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.
We welcome contributions! Please see our Contributing Guide for details on how to:
- Submit issues using our templates:
- Create pull requests following our Git Flow
- Set up your development environment
- Follow our conventional commits standard
This project is open source and available under the MIT License.