Interview Prep AI is a full-stack web application that helps users prepare for interviews with AI-generated, role-specific questions and answers. Users can practice, expand on answers, get detailed explanations, and track their progress—all in a modern, responsive interface.
- AI-powered, role-specific interview questions and answers
- Expand answers and dive deep into concepts
- Save, organize, and revisit questions
- Analytics and progress tracking
- User authentication and profile management
- Responsive design for all devices
- Frontend: React, Vite, Tailwind CSS
- Backend: Node.js, Express
- Database: MongoDB
- AI Integration: (e.g., OpenAI API)
- Node.js (v16+ recommended)
- npm or yarn
- MongoDB instance
- (Optional) OpenAI API key or other AI provider key
-
Clone the repository:
git clone https://github.com/KaranUnique/Interview-Prep-AI.git cd Interview-Prep-AI -
Install dependencies for both frontend and backend:
cd backend npm install cd ../frontend/InterviewPrepAI npm install
-
Set up environment variables (see
.env.examplein each folder):- For backend: create a
.envfile inbackend/with your MongoDB URI, JWT secret, and AI API keys. - For frontend: create a
.envfile infrontend/InterviewPrepAI/if needed.
- For backend: create a
-
Start the backend server:
cd backend npm start -
Start the frontend dev server:
cd ../frontend/InterviewPrepAI npm run dev
backend/ # Express server, API routes, models, controllers
frontend/InterviewPrepAI/ # React app (Vite + Tailwind)
Create a .env file in the backend/ directory with the following (example):
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
OPENAI_API_KEY=your_openai_api_key
This project is licensed under the MIT License.
Built with ❤️ by KaranUnique
- Push latest code to
main. - Create a new Web Service on Render:
- Repository: this repo
- Root directory:
backend - Build Command:
npm install - Start Command:
node server.js(ornpm startif defined) - Environment: add the variables from
backend/.env.example:PORT(Render usually injectsPORTautomatically, but keep default fallback)MONGO_URIJWT_SECRETGEMINI_API_KEY/GEMINI_MODEL(or other AI keys)FRONTEND_ORIGINset later to the deployed frontend URL- (Optional)
EXTRA_ORIGINScomma-separated for preview builds
After deploy, note the Render backend URL, e.g. https://your-backend.onrender.com.
In frontend/InterviewPrepAI, create .env.production (or .env for a static host) with:
VITE_BACKEND_URL=https://your-backend.onrender.com
Rebuild the frontend: npm run build.
You can deploy the dist/ output to:
- Render Static Site (root:
frontend/InterviewPrepAI, build command:npm install && npm run build, publish directory:dist) - Netlify / Vercel / GitHub Pages
After the frontend deploys, copy its public URL and update the backend service env var FRONTEND_ORIGIN to that URL. Redeploy backend (Render auto-redeploys after env change).
Backend dynamically allows:
FRONTEND_ORIGIN- Any origins in
EXTRA_ORIGINS - Local dev:
http://localhost:5173
If you have multiple staging URLs, set EXTRA_ORIGINS=https://staging-1.onrender.com,https://staging-2.onrender.com.
- Local:
.env.developmentusesVITE_BACKEND_URL=http://localhost:8000and Vite proxy handles/api. - Production: Direct calls go to the absolute
VITE_BACKEND_URL; no proxy configured.
| Issue | Fix |
|---|---|
| 401 after deploy | Ensure JWT secret consistent; clear localStorage token |
| CORS error | Verify FRONTEND_ORIGIN matches exact protocol + domain + (no trailing slash) |
| 404 API | Confirm VITE_BACKEND_URL has no trailing slash and includes https |
| Mixed content | Use https backend URL |