A fun and interactive personality quiz that matches you with your perfect Diwali sweet! Built with Next.js 15, TypeScript, and optimized for Vercel deployment.
- 🎯 Personality Quiz: Interactive questions to determine your sweet personality
- 🍯 Sweet Matching: Get matched with traditional Diwali sweets
- 📊 Nutrition Info: Detailed nutritional information for each sweet
- 🎨 Beautiful UI: Modern, responsive design with Tailwind CSS
- ⚡ Fast Performance: Optimized for speed and Core Web Vitals
- 🔒 Secure: Production-ready security headers and validation
- 📱 Mobile First: Fully responsive design
- 🚀 Vercel Ready: Optimized for Vercel deployment
- Node.js 18+
- PostgreSQL database
- npm or yarn
-
Clone the repository:
git clone <your-repo-url> cd Diwali-Quiz
-
Install dependencies:
npm install
-
Set up environment variables:
cp env.example .env.local # Edit .env.local with your database URL -
Set up the database:
npx prisma migrate dev npx prisma generate npm run prisma:seed
-
Start development server:
npm run dev
Visit http://localhost:3000 to see the app!
-
Connect to Vercel:
- Push your code to GitHub
- Connect your repository to Vercel
- Set up environment variables in Vercel dashboard
-
Environment Variables:
DATABASE_URL=postgresql://username:password@host:port/database NEXTAUTH_URL=https://your-app.vercel.app NEXTAUTH_SECRET=your-secret-key NODE_ENV=production -
Deploy:
- Vercel will automatically build and deploy
- Run database migrations:
npx prisma migrate deploy - Seed the database:
npm run prisma:seed
📖 Detailed deployment guide: See DEPLOYMENT.md
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- Database: PostgreSQL with Prisma ORM
- Deployment: Vercel
- Performance: Optimized images, lazy loading, caching
- SEO: Meta tags, sitemap, robots.txt
- ✅ Image Optimization: Next.js Image component with WebP/AVIF support
- ✅ Code Splitting: Dynamic imports and lazy loading
- ✅ Caching: API route caching and static asset caching
- ✅ Bundle Optimization: Tree shaking and code splitting
- ✅ SEO: Comprehensive meta tags and structured data
- ✅ Security: Security headers and input validation
- ✅ Core Web Vitals: Optimized for LCP, FID, and CLS
The quiz uses a sophisticated tagging system:
- Each question option has personality tags
- User selections are scored by tag frequency
- Sweet recommendations are matched based on tag compatibility
- Results are saved for future reference
- Mobile-first approach
- Optimized for all screen sizes
- Touch-friendly interactions
- Fast loading on mobile networks
- Input validation on all API routes
- Security headers (XSS, CSRF protection)
- Error handling without data exposure
- Rate limiting ready
- SQL injection protection via Prisma
- Comprehensive meta tags
- Open Graph and Twitter Card support
- Sitemap generation
- Robots.txt configuration
- Structured data ready
- Fast loading times
# Development
npm run dev
# Build
npm run build
# Lint
npm run lint
# Type check
npm run type-check
# Database
npm run prisma:generate
npm run prisma:push
npm run prisma:seedsrc/
├── app/
│ ├── api/ # API routes
│ ├── components/ # Reusable components
│ ├── result/ # Result pages
│ └── quiz/ # Quiz pages
├── lib/ # Utilities
└── types/ # TypeScript types
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
May this quiz bring joy and sweetness to your Diwali celebrations! 🪔✨