A full-stack AI-powered mock interview platform that helps developers practice technical interviews. The application uses Google Gemini AI to generate interview questions and provide intelligent feedback on candidate responses.
- User Authentication: Secure registration and login with OTP email verification
- AI-Powered Interviews: Generate interview questions using Google Gemini AI based on technology and difficulty level
- Real-time Interview Sessions: Interactive interview interface with question-by-question progression
- AI Evaluation: Automated scoring and detailed feedback on interview performance
- Interview History: Track and review all past interview sessions
- User Profiles: Manage and view user profiles with interview statistics
- Dashboard: Comprehensive overview of interview performance and statistics
- Email Notifications: OTP verification and interview updates via email
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose
- AI Integration: Google Gemini AI (gemini-2.5-flash)
- Authentication: JWT (JSON Web Tokens) with cookie-based sessions
- Email Service: Nodemailer
- Security: bcrypt for password hashing
- Framework: React 19
- Build Tool: Vite
- Styling: Tailwind CSS
- State Management: Redux Toolkit with Redux Persist
- Routing: React Router DOM v7
- HTTP Client: Axios
- Icons: React Icons
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- MongoDB (local instance or MongoDB Atlas account)
- Google Gemini API Key (from Google AI Studio)
git clone <repository-url>
cd interviewPrepcd Backend
npm installCreate a .env file in the Backend directory:
PORT=5000
MONGODB_URL=your_mongodb_connection_string
GEMINI_API_KEY=your_google_gemini_api_key
JWT_SECRET=your_jwt_secret_key
JWT_REFRESH_SECRET=your_jwt_refresh_secret_key
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_specific_password
FRONTEND_URL=http://localhost:5173cd Frontend
npm installCreate a .env file in the Frontend directory (if needed):
VITE_API_URL=http://localhost:5000/api/v1Backend:
cd Backend
npm run devThe backend server will start on http://localhost:5000
Frontend:
cd Frontend
npm run devThe frontend will start on http://localhost:5173
Backend:
cd Backend
npm startFrontend:
cd Frontend
npm run build
npm run previewinterviewPrep/
βββ Backend/
β βββ app.js # Express app configuration
β βββ index.js # Server entry point
β βββ package.json
β βββ config/
β β βββ db.js # MongoDB connection
β βββ controllers/
β β βββ user.controller.js
β β βββ interview.controller.js
β β βββ dashboard.controller.js
β βββ middelwares/
β β βββ auth.js # JWT authentication middleware
β βββ models/
β β βββ User.model.js
β β βββ Interview.model.js
β βββ routes/
β β βββ user.routes.js
β β βββ interview.routes.js
β β βββ dashboard.routes.js
β βββ utils/
β βββ gemini.js # Google Gemini AI integration
β βββ sendEmail.js # Email service
β
βββ Frontend/
βββ index.html
βββ package.json
βββ vite.config.js
βββ tailwind.config.js
βββ public/
βββ src/
βββ App.jsx # Main app component with routing
βββ main.jsx # React entry point
βββ Layout.jsx # Layout wrapper
βββ components/
β βββ Header.jsx
β βββ Footer.jsx
β βββ ProtectedRoute.jsx
β βββ ProfileForm.jsx
β βββ UserProfileCard.jsx
β βββ InterviewHistory.jsx
β βββ OTPInput.jsx
βββ pages/
β βββ Home.jsx
β βββ Login.jsx
β βββ Register.jsx
β βββ OTPVerification.jsx
β βββ Dashboard.jsx
β βββ Interview.jsx
β βββ InterviewSession.jsx
β βββ InterviewResults.jsx
β βββ UserProfile.jsx
β βββ ViewProfile.jsx
βββ store/
βββ index.js # Redux store configuration
βββ slices/
βββ authSlice.js
βββ interviewSlice.js
βββ dashboardSlice.js
βββ profileSlice.js
POST /register- Register a new userPOST /verify- Verify email with OTPPOST /login- User loginGET /logout- User logoutPOST /resend- Resend OTPGET /my-profile- Get logged-in user's profile (Protected)PUT /profile- Update user profile (Protected)GET /profile/:userId- Get specific user's public profile
POST /start- Start a new interview session (Protected)POST /submit/:id- Submit answer for a question (Protected)GET /results/:interviewId- Get interview results (Protected)GET /history- Get user's interview history (Protected)
- Various dashboard statistics endpoints (Protected)
The application uses Google Gemini AI to generate contextual interview questions based on:
- Technology: e.g., JavaScript, Python, React, Node.js
- Difficulty Level: Beginner, Intermediate, Advanced
After completing an interview, the AI evaluates:
- Overall score (out of 10)
- Detailed feedback on strengths and areas for improvement
- Performance analysis based on difficulty level
- User registers with email
- OTP sent to email for verification
- After verification, user can login
- JWT tokens stored in HTTP-only cookies for security
- Password hashing with bcrypt
- JWT-based authentication
- HTTP-only cookies for token storage
- Protected routes on both frontend and backend
- CORS configuration for secure cross-origin requests
| Variable | Description |
|---|---|
PORT |
Server port (default: 5000) |
MONGODB_URL |
MongoDB connection string |
GEMINI_API_KEY |
Google Gemini API key |
JWT_SECRET |
Secret for JWT token signing |
JWT_REFRESH_SECRET |
Secret for refresh token signing |
EMAIL_HOST |
SMTP server host |
EMAIL_PORT |
SMTP server port |
EMAIL_USER |
Email address for sending emails |
EMAIL_PASS |
App-specific password for email |
FRONTEND_URL |
Frontend application URL |
Backend:
npm start- Start production servernpm run dev- Start development server with nodemon
Frontend:
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Google Gemini AI for interview question generation and evaluation
- React and Vite communities for excellent tooling
- Express.js and MongoDB for robust backend infrastructure
Note: Make sure to set up all environment variables before running the application. The application requires a valid MongoDB connection and Google Gemini API key to function properly.