QuizGenius is a comprehensive AI-powered quiz generation platform built with React, Express.js, and PostgreSQL. The application allows users to create, manage, and take quizzes with AI assistance, featuring real-time analytics, user authentication, and multi-language support.
Preferred communication style: Simple, everyday language.
- Framework: React 18 with TypeScript
- Build Tool: Vite for fast development and optimized builds
- Styling: Tailwind CSS with shadcn/ui components for consistent UI
- State Management: Zustand for global state management
- Routing: Wouter for client-side routing
- Animations: Framer Motion for smooth transitions and interactions
- Internationalization: react-i18next for multi-language support (English, French, Spanish, Chinese, Arabic) with RTL support
- Runtime: Node.js with Express.js framework
- Language: TypeScript for type safety
- API Design: RESTful API with JSON responses
- Session Management: Express sessions with PostgreSQL session store
- Email Service: SendGrid integration with mock fallback
- Primary Database: PostgreSQL with connection pooling
- ORM: Drizzle ORM for type-safe database operations
- Connection: Neon serverless PostgreSQL with WebSocket support
- Migrations: Drizzle Kit for schema management
- Primary: Firebase Authentication with email/password and Google OAuth
- Mock Implementation: Fallback authentication for development without Firebase credentials
- User Management: Custom user transformation layer to bridge Firebase users with app-specific user models
- Session Persistence: localStorage for client-side persistence
- Creation Methods:
- Manual quiz creation with question editor
- AI-assisted generation using OpenAI GPT-4
- Template-based creation with predefined categories
- Question Types: Multiple choice with optional code snippets
- Categories: Hierarchical categorization system
- Tags: Flexible tagging system for enhanced organization
- Provider: OpenAI GPT-4 for intelligent quiz generation
- Mock Mode: Comprehensive mock responses for development without API keys
- Features: Topic-based generation, difficulty adjustment, code snippet inclusion
- Design System: shadcn/ui components with Tailwind CSS
- Theme Support: Light/dark mode toggle
- Responsive: Mobile-first design approach
- Accessibility: ARIA compliance and keyboard navigation
- User selects creation method (manual/AI/template)
- Form data validation and processing
- AI service generates questions (if AI mode)
- Questions stored in PostgreSQL database
- Quiz metadata created with associations
- Real-time updates to user dashboard
- User navigates to quiz from dashboard or public link
- Quiz questions loaded from database
- Timer management and answer tracking
- Real-time progress updates
- Results calculation and storage
- Achievement system evaluation
- User authentication through Firebase
- User object transformation for app compatibility
- Session creation and persistence
- Protected route access management
- PostgreSQL Database: Primary data storage
- Firebase: Authentication provider
- OpenAI API: AI quiz generation
- SendGrid: Email notifications
- Firebase (uses mock authentication)
- OpenAI (uses predefined mock quizzes)
- SendGrid (console logging for emails)
- Testing: Cypress for E2E and component testing
- Linting: ESLint with TypeScript support
- Type Checking: TypeScript strict mode
- Hot Reload: Vite HMR for development
- Local Development: Vite dev server with Express backend
- Database: Local PostgreSQL or development cloud instance
- Mock Services: Automatic fallback for missing API keys
- Build Process: Vite production build with static asset optimization
- Server: Express.js with production optimizations
- Database: Production PostgreSQL with connection pooling
- Environment Variables: Secure configuration management
DATABASE_URL: PostgreSQL connection string (required)VITE_FIREBASE_API_KEY: Firebase configuration (optional)VITE_FIREBASE_PROJECT_ID: Firebase project ID (optional)VITE_FIREBASE_APP_ID: Firebase app ID (optional)OPENAI_API_KEY: OpenAI API access (optional)SENDGRID_API_KEY: Email service access (optional)
- Database connection pooling for concurrent users
- Stateless server design for horizontal scaling
- CDN-ready static asset handling
- Session store configuration for distributed deployments
The application is designed with a "mock-first" approach, allowing full functionality in development environments without requiring external service credentials, while seamlessly transitioning to production services when credentials are provided.