A comprehensive full-stack application for practicing interviews with AI-powered feedback, built with Next.js 14, Express.js, TypeScript, and Firebase Firestore.
- β¨ Modern, responsive UI with Tailwind CSS + shadcn/ui
- π¨ Smooth animations using Framer Motion
- π Complete authentication flow (sign-in, sign-up, reset password)
- π Interactive dashboard with session management
- π Text-based interview interface with question-by-question flow
- π AI-generated detailed evaluation with per-question feedback
- π― Animated landing page
- π JWT-based authentication with bcrypt password hashing (httpOnly cookies)
- ποΈ Firebase Firestore database (all collections)
- π Audio file upload support (multer) with magic byte validation
- π€ Real AI evaluation with Groq (Llama 3)
- ποΈ Voice features with OpenAI (Whisper + TTS)
- π RESTful API with typed responses
- π‘οΈ Security with Helmet and CORS
- Node.js v20+
- npm or yarn
- Firebase project with Firestore enabled
- Groq API key and OpenAI API key
git clone <repository-url>
cd InterVistacd backend
npm installCreate .env file from the example:
cp .env.example .envEdit .env with your configuration:
PORT=4000
NODE_ENV=development
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=your-client-email@your-project-id.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_KEY_HERE\n-----END PRIVATE KEY-----\n"
JWT_SECRET=your-super-secret-jwt-key-at-least-64-characters
JWT_EXPIRES_IN=7d
CORS_ORIGINS=http://localhost:3000
GROQ_API_KEY=gsk_your_groq_api_key
OPENAI_API_KEY=sk-your-openai-api_key
SMTP_USER=your-email@example.com
SMTP_PASS=your-smtp-passwordFirebase Setup:
- Create a Firebase project at https://console.firebase.google.com
- Enable Firestore Database
- Go to Project Settings β Service Accounts β Generate new private key
- Copy the
project_id,client_email, andprivate_keyvalues into.env
cd web
npm installCreate .env.local:
NEXT_PUBLIC_API_URL=http://localhost:4000cd backend
npm run devBackend runs on http://localhost:4000
cd web
npm run devFrontend runs on http://localhost:3000
InterVista/
βββ backend/ # Express.js + TypeScript backend
β βββ src/
β β βββ config/ # Environment validation
β β βββ controllers/ # Auth, Session, Answer controllers
β β βββ db/ # Firestore initialization
β β βββ lib/ # AI (Anthropic Claude) integration
β β βββ middleware/ # JWT auth middleware
β β βββ routes/ # API route wiring
β β βββ types/ # TypeScript interfaces
β β βββ server.ts # Express app entry point
β βββ uploads/ # Audio file storage
β
βββ web/ # Next.js 14 (App Router)
βββ src/
β βββ app/ # App router pages
β βββ components/ # React components (shadcn/ui)
β βββ contexts/ # Auth context
β βββ lib/ # API client & utilities
βββ public/ # Static assets
- User signs up β password hashed with bcrypt (12 rounds)
- JWT token generated with a JTI and stored securely in an
httpOnlycookie - Session is maintained via the cookie, which is sent with all
Credentials: "include"requests - Sign out revokes the JWT using a Firestore blocklist
- On 401 response β cookie cleared, redirect to sign-in
GET /api/auth/mevalidates token and returns user on page load
InterVista uses Groq (Llama 3.3) and OpenAI for:
- Question Generation: Groq generates 5 role-specific interview questions based on company, role, target difficulty and persona constraints
- Answer Evaluation: Groq evaluates all answers asynchronously (202 Accepted pattern) and returns:
- Overall score (0-100)
- Recommendation (Strong Hire / Hire / Consider / No Hire)
- Skills assessment (Communication, Technical Knowledge, Problem Solving, Confidence)
- Per-question feedback with strengths and areas for improvement
- Transcription: OpenAI Whisper transcribes candidate audio responses
- Text-to-Speech: OpenAI TTS brings the interviewer personas to life
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/signup |
Register new user | No |
| POST | /api/auth/signin |
Sign in user | No |
| GET | /api/auth/me |
Get current user | Yes |
| POST | /api/auth/reset-password |
Request password reset OTP | No |
| POST | /api/auth/verify-reset |
Verify OTP and reset password | No |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/sessions |
Create session + AI questions | Yes |
| GET | /api/sessions |
List user's sessions | Yes |
| GET | /api/sessions/:id |
Get session details | Yes |
| GET | /api/sessions/:id/questions |
Get session questions | Yes |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/answers |
Submit answer (multipart) | Yes |
| GET | /api/answers/evaluation/:sessionId |
Get/generate AI evaluation (async 202) | Yes |
| POST | /api/answers/evaluation/:sessionId/retry |
Retry failed evaluation | Yes |
| POST | /api/auth/signout |
Sign out and revoke token | Yes |
All responses follow: { data: payload } on success, { error: string } on failure.
| Variable | Description | Required |
|---|---|---|
| PORT | Server port (default: 4000) | No |
| NODE_ENV | Environment | No |
| FIREBASE_PROJECT_ID | Firebase project ID | Yes |
| FIREBASE_CLIENT_EMAIL | Firebase service account email | Yes |
| FIREBASE_PRIVATE_KEY | Firebase service account private key | Yes |
| JWT_SECRET | JWT signing secret | Yes |
| JWT_EXPIRES_IN | Token expiration (default: 7d) | No |
| CORS_ORIGINS | Allowed origins (default: localhost:3000) | No |
| GROQ_API_KEY | Groq API key for Llama 3 | Yes |
| OPENAI_API_KEY | OpenAI API key for TTS/Whisper | Yes |
| SMTP_USER | SMTP username | No |
| SMTP_PASS | SMTP password | No |
| Variable | Description | Required |
|---|---|---|
| NEXT_PUBLIC_API_URL | Backend API URL | Yes |
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router), React 18, TypeScript |
| Styling | Tailwind CSS v3, shadcn/ui, Framer Motion |
| Backend | Express.js, TypeScript, Node.js v20+ |
| Database | Firebase Firestore |
| Auth | JWT in httpOnly Cookies, bcrypt |
| AI (LLM) | Groq (llama-3.3-70b-versatile) |
| AI (Audio) | OpenAI (whisper-1, tts-1) |
| File Upload | Multer |
Made with β€οΈ by the InterVista Team