A Next.js web application that uses Google Gemini AI to generate realistic, tailored interview questions based on job title, seniority level, and question category.
- Generate 10 interview questions per request
- Select seniority level: Junior, Mid-Level, Senior, or Lead
- Choose from 4 question categories:
- Technical Architecture
- Behavioral & Leadership
- Culture & Core Values
- System Design
- Each question is assigned a difficulty level (Easy / Medium / Hard)
- Smart job title validation and auto-correction
- Node.js v18 or higher
- A Google Gemini API key (free — see below)
- Go to https://aistudio.google.com/app/api-keys
- Sign in with your Google account
- Click "Create API key"
- Select an existing Google Cloud project or create a new one
- Copy the generated API key — you will need it in the next step
For full documentation on the Gemini API key, see: https://ai.google.dev/gemini-api/docs/api-key
The app uses the model name you set in the .env file. Recommended free models:
| Model Name | Notes |
|---|---|
gemini-2.0-flash |
Fast, free tier, recommended |
gemini-1.5-flash |
Stable, free tier |
gemini-1.5-pro |
Higher quality, lower rate limits on free tier |
You can view available models in the Google AI Studio sidebar or in the Gemini API model docs.
In the root of the project, create a file named .env:
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.0-flash
Replace your_api_key_here with the key you copied in Step 1.
.envis listed in.gitignore— it will not be committed to Git, so your key stays private.
Open a terminal in the project root and run:
npm installnpm run devThe app will start at http://localhost:3000.
| Command | Description |
|---|---|
npm run dev |
Start the development server with hot reload |
npm run build |
Build the app for production |
npm start |
Start the production server (run build first) |
ai-question-generator/
├── src/
│ └── app/
│ ├── api/
│ │ └── generate-response/
│ │ └── route.ts # Gemini API integration
│ ├── page.tsx # Main UI
│ └── layout.tsx # Root layout
├── .env # Your local env vars (create this)
├── .env.example # Example env file for reference
└── package.json
Error: GEMINI_API_KEY is not set
— Make sure .env exists in the project root with the correct key.
API key not valid
— Double-check the key was copied correctly with no extra spaces.
Model not found
— Check the model name spelling in .env. Use gemini-2.0-flash if unsure.
Port already in use
— Run npm run dev -- -p 3001 to use a different port.