A modern, multilingual quiz application designed for professional orientation assessment. Built with Next.js 14 and powered by AI to provide personalized career recommendations for medical studies.
- Headless CMS: Content management with Sanity CMS for easy quiz creation and updates
- Multiple Quiz Support: Create unlimited quiz variations with custom prompts and questions
- Interactive Quiz System: Engaging question-and-answer flow with progress tracking
- AI-Powered Analysis: Integration with Google Gemini AI for intelligent result analysis
- Multi-language Support: Available in English, Russian, and Ukrainian
- Email Results: Automated email delivery of quiz results via SendGrid
- CRM Integration: Bitrix24 integration for lead management
- Analytics: Comprehensive tracking with Google Analytics, Facebook Pixel, and TikTok Pixel
- Modern UI: Built with NextUI v2 and Tailwind CSS for a responsive, accessible interface
- Dark Mode Support: Theme switching with next-themes
- Next.js 14 - React framework with App Router
- Sanity CMS - Headless CMS for content management
- NextUI v2 - Modern UI component library
- Tailwind CSS - Utility-first CSS framework
- TypeScript - Type-safe JavaScript
- Framer Motion - Animation library
- Google Gemini AI - AI-powered analysis
- SendGrid - Email delivery service
- next-intl - Internationalization
- Vercel Analytics - Performance monitoring
- Node.js 18+
- npm or yarn package manager
- Sanity account and project
- SendGrid account and API key
- Google Gemini API key
- Clone the repository:
git clone <repository-url>
cd quiz_proforientationgit- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env- Configure your
.envfile with required credentials:
# Quiz Source: "local" (files) or "sanity" (CMS)
NEXT_PUBLIC_QUIZ_SOURCE=local
# Sanity CMS Configuration (only if QUIZ_SOURCE=sanity)
NEXT_PUBLIC_SANITY_PROJECT_ID=your_sanity_project_id
NEXT_PUBLIC_SANITY_DATASET=production
SANITY_API_READ_TOKEN=your_sanity_token
# Gemini AI Configuration
GEMINI_API_KEY=your_gemini_api_key
GEMINI_API_MODEL=gemini-1.5-flash
# SendGrid Email Configuration
SENDGRID_API_KEY=your_sendgrid_api_key
EMAIL_FROM=noreply@medstudy.cz
EMAIL_FROM_NAME="Medstudy.cz | Quiz"
EMAIL_REPLY_TO=sales@medstudy.cz- Set up Sanity CMS:
- See SANITY_GUIDE.md for complete setup instructions and AI prompt configuration
- Access Sanity Studio at
http://localhost:3000/studioafter running dev server
Run the development server:
npm run devOpen http://localhost:3000 in your browser to see the application.
Build the application for production:
npm run buildStart the production server:
npm startThe production server runs on port 5050 by default.
.
├── app/ # Next.js App Router
│ ├── [locale]/ # Internationalized routes
│ ├── api/ # API routes
│ └── studio/ # Sanity Studio interface
├── components/ # React components
│ └── ui/ # UI components
├── sanity/ # Sanity CMS configuration
│ ├── schemas/ # Content schemas
│ │ ├── quiz.ts # Main quiz schema (role-based)
│ │ ├── simpleQuestion.ts # Question schema
│ │ ├── university.ts # University schema
│ │ └── school.ts # School schema
│ └── lib/ # Sanity utilities
│ ├── client.ts # Sanity client
│ ├── queries.ts # GROQ queries
│ ├── api.ts # API functions
│ └── types.ts # TypeScript types
├── services/ # Business logic
│ ├── quizService.ts # Quiz data service
│ └── sanityAdapter.ts # Sanity to app format adapter
├── integrations/ # Third-party integrations
│ ├── gemini.ts # Google Gemini AI
│ ├── email.ts # SendGrid email
│ ├── fbpixel.ts # Facebook Pixel
│ └── tiktokpixel.ts # TikTok Pixel
├── locales/ # Translation files
│ ├── en/ # English
│ ├── ru/ # Russian
│ └── uk/ # Ukrainian
├── public/ # Static assets
├── styles/ # Global styles
├── utils/ # Utility functions
├── sanity.config.ts # Sanity configuration
└── SANITY_GUIDE.md # Sanity setup and usage guide
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production server (port 5050)npm run lint- Run ESLint
/api/session-answer- Save quiz answers/api/sendEmail- Send quiz results via email/api/report- Generate analysis report/api/bitrix- Bitrix CRM integration
The application supports three languages:
- English (en)
- Russian (ru)
- Ukrainian (uk)
Language detection is automatic based on browser preferences, with manual switching available.
Headless content management system for creating and managing multiple quiz variations. Access the studio at /studio to create quizzes, questions, and customize AI prompts without code changes.
Used for analyzing quiz responses and generating personalized career recommendations.
Handles email delivery for quiz results and reports.
CRM integration for lead capture and management.
- Google Analytics - User behavior tracking
- Facebook Pixel - Conversion tracking
- TikTok Pixel - Marketing analytics
- Vercel Analytics - Performance monitoring
See .env.example for all available configuration options:
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SANITY_PROJECT_ID |
Sanity project ID | Yes |
NEXT_PUBLIC_SANITY_DATASET |
Sanity dataset (production/staging) | Yes |
SANITY_API_READ_TOKEN |
Sanity API read token | Yes |
GEMINI_API_KEY |
Google Gemini API key | Yes |
SENDGRID_API_KEY |
SendGrid API key | Yes |
EMAIL_FROM |
Sender email address | Yes |
EMAIL_FROM_NAME |
Sender display name | Yes |
EMAIL_REPLY_TO |
Reply-to email address | Yes |
For detailed Sanity CMS setup instructions, see SANITY_GUIDE.md.
Licensed under the MIT license.
For issues or questions, please open an issue in the repository.