A complete AI-powered interview preparation platform with:
- Aptitude Tests — 10 dynamic questions with scoring
- DSA Coding — 5 real FAANG problems with AI code review
- HR Interview — Voice-based with TTS, tone & grammar analysis
| Layer | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3.2, Spring Security + JWT |
| Frontend | React 18, Vite, Zustand |
| Database | MongoDB 7.0 |
| AI | Groq API (free, Llama 3.3 70B) |
| TTS/STT | Web Speech API (browser-native, free) |
| Container | Docker + Docker Compose |
| Service | Free Tier |
|---|---|
| Groq AI | 14,400 req/day, Llama 3.3 70B 70B |
| MongoDB Atlas | 512MB free cluster |
| Railway.app | Backend + DB hosting |
| Vercel | Frontend hosting |
- Docker Desktop installed
- A free Groq API key
- Go to https://console.groq.com
- Sign up / Sign in
- Click API Keys → Create API Key
- Copy the key
# Copy and edit the .env file
cp .env .env.local # optional backup
# Edit .env with your values:
nano .envRequired fields in .env:
GROQ_API_KEY=gsk_your_actual_key_here
JWT_SECRET=any_random_string_at_least_32_chars_long
MONGO_ROOT_USER=interviewadmin
MONGO_ROOT_PASS=YourSecurePassword123!
MONGO_DB_NAME=interview_simulator
GROQ_MODEL=llama-3.3-70b-versatile
CORS_ALLOWED_ORIGINS=http://localhost:3000
VITE_API_BASE_URL=http://localhost:8080/api# Start everything
docker compose up --build
# Or run in background
docker compose up --build -dFirst build takes ~5 minutes (downloads Maven, Node dependencies).
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080/api
-
Push to GitHub
git init git add . git commit -m "InterviewAI initial" git remote add origin https://github.com/yourusername/interview-ai git push -u origin main
-
Deploy Backend on Railway
- Go to https://railway.app → New Project → Deploy from GitHub
- Select your repo, set root to
/backend - Add environment variables from
.env - Change
CORS_ALLOWED_ORIGINSto your Vercel URL later
-
Deploy MongoDB on Railway
- In same Railway project → Add Service → Database → MongoDB
- Copy the
MONGO_URLfrom Railway and use it asSPRING_DATA_MONGODB_URI
-
Deploy Frontend on Vercel
- Go to https://vercel.com → New Project → Import GitHub
- Set root directory to
frontend - Add environment variable:
VITE_API_BASE_URL=https://your-railway-backend-url/api - Deploy!
-
Update CORS on Railway backend:
CORS_ALLOWED_ORIGINS=https://your-vercel-app.vercel.app
- Backend: New Web Service → Docker → set env vars
- Database: New PostgreSQL (if switching) or use MongoDB Atlas free tier
- Frontend: New Static Site → build command:
npm run build→ publish dir:dist
- Go to https://cloud.mongodb.com → Create free cluster
- Set up user + password
- Whitelist
0.0.0.0/0(all IPs for cloud deployment) - Get connection string, replace in
SPRING_DATA_MONGODB_URI
POST /api/auth/register — Register new user
POST /api/auth/login — Login
POST /api/aptitude/start — Generate 10 questions
POST /api/aptitude/evaluate — Submit & evaluate answers
POST /api/coding/start — Generate 5 DSA problems
POST /api/coding/evaluate — Evaluate submitted code
POST /api/coding/hint — Get a hint
POST /api/coding/complete — Finish session
POST /api/hr/start — Generate 5 HR questions
POST /api/hr/analyze — Analyze a spoken answer
POST /api/hr/complete — Generate final report
GET /api/sessions — Get all sessions
GET /api/sessions/me/stats — Get user stats
GET /api/sessions/:id — Get session details
users— User accounts with session historysessions— Full session data with Q&A and feedback
The HR module uses the browser's Web Speech API:
- TTS (Text-to-Speech): Reads questions aloud
- STT (Speech-to-Text): Transcribes your spoken answers
cd backend
# Set env vars in your shell or IDE
export GROQ_API_KEY=your_key
export SPRING_DATA_MONGODB_URI=mongodb://localhost:27017/interview_simulator
export JWT_SECRET=your_secret_min_32_chars
export CORS_ALLOWED_ORIGINS=http://localhost:3000
mvn spring-boot:runcd frontend
echo "VITE_API_BASE_URL=http://localhost:8080/api" > .env.local
npm install
npm run dev- JWT tokens expire in 24 hours
- Passwords are BCrypt hashed
- API key is server-side only (never exposed to frontend)
- CORS is configured per origin
- Never commit
.envwith real credentials
# Start
docker compose up --build
# Stop
docker compose down
# View logs
docker compose logs -f backend
docker compose logs -f frontend
# Rebuild single service
docker compose up --build backend
# Remove all data (fresh start)
docker compose down -vIn .env, change GROQ_MODEL to any supported model:
llama-3.3-70b-versatile(recommended, most capable)llama-3.1-8b-instant(faster, lower quality)gemma2-9b-it(Google's model)mixtral-8x7b-32768(long context)
Check available models at: https://console.groq.com/docs/models
| Issue | Solution |
|---|---|
Groq API error |
Check GROQ_API_KEY in .env |
MongoDB connection failed |
Ensure MongoDB container is running |
CORS error |
Update CORS_ALLOWED_ORIGINS to match frontend URL |
Speech not working |
Use Chrome; ensure HTTPS in production |
JWT invalid |
Make sure JWT_SECRET is 32+ characters |
| Backend won't start | Check logs: docker compose logs backend |