AI-Powered Exit Interview Platform for Modern Organizations
Exit Interview - Lyzr AI is an open-source, AI-powered platform that transforms the traditional exit interview process. Organizations can conduct structured, confidential exit interviews with departing employees, gaining actionable insights to improve retention and workplace culture.
- 🤖 AI-Driven Conversations - Natural, adaptive interview flow powered by Lyzr AI
- 📧 Multi-Channel Email Delivery - Gmail OAuth, SMTP fallback, and manual options
- 🎨 Customizable Templates - Brand your interview invitations
- 📊 Real-Time Analytics - Sentiment analysis and comprehensive insights
- 🔒 Enterprise-Grade Security - Multi-tenant architecture with complete data isolation
- ⚡ Modern Stack - Built on Next.js 15, React 19, and TypeScript
|
Intelligent conversation flow that adapts to employee responses using natural language processing and contextual awareness. |
Multiple delivery channels with automatic fallback: Gmail OAuth → SMTP → Manual distribution. |
|
Real-time sentiment analysis, theme extraction, and actionable insights to drive organizational improvements. |
HTML and text email templates with variable substitution for personalized communications. |
|
Enterprise-grade multi-tenant architecture ensuring complete data privacy and isolation. |
Built with Next.js 15, React 19, TypeScript, MongoDB, and Tailwind CSS for maximum performance. |
| Category | Technologies |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript |
| Backend | Next.js API Routes, Node.js |
| Database | MongoDB + Mongoose ODM |
| AI/ML | Lyzr Agent SDK |
| Gmail API, Nodemailer (SMTP) | |
| UI | Radix UI, Tailwind CSS, Lucide Icons |
| State | Redux Toolkit, React Context |
Before you begin, ensure you have the following installed:
- Node.js 18+ and npm/yarn/pnpm
- MongoDB (local or cloud instance)
- Google Cloud Console account (for Gmail OAuth)
- Lyzr API credentials
git clone https://github.com/amitlyzr/exit-interview-os.git
cd exit-interview-osnpm install
# or
yarn install
# or
pnpm installCreate a .env.local file in the root directory:
# Database
MONGODB_URI=mongodb://localhost:27017/exit-interview
# Application
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Gmail OAuth (Required for email sending)
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
# Lyzr AI Integration
LYZR_API_KEY=your_lyzr_api_key_here
LYZR_QUESTIONINAIRE_AGENT_ID=""
LYZR_SENTIMENT_AGENT_ID=""
LYZR_FEEDBACK_AGENT_ID=""
LYZR_SUGGESTIONS_AGENT_ID=""npm run devOpen http://localhost:3000 in your browser. 🎉
The application supports multiple email delivery methods with automatic fallback:
Gmail OAuth (Primary) → SMTP (Fallback) → Manual Link (Last Resort)
🔧 Google Cloud Console Setup (Click to expand)
Step 1: Create Google Cloud Project
- Visit Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API
Step 2: Create OAuth 2.0 Credentials
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Choose Web application
Step 3: Configure OAuth Consent Screen
- Add application name and authorized domains
- Add scopes:
https://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/userinfo.email
Step 4: Set Authorized Redirect URIs
- Development:
http://localhost:3000/api/auth/gmail/callback - Production:
https://yourdomain.com/api/auth/gmail/callback
Step 5: Get Credentials
- Copy Client ID and Client Secret to your
.env.local
- Navigate to Settings → Gmail Connection
- Click "Connect Gmail" button
- Complete Google OAuth consent flow
- Start sending invitations! ✉️
Configure SMTP in application settings:
| Setting | Value |
|---|---|
| Host | smtp.gmail.com |
| Port | 587 |
| Security | STARTTLS |
| Username | your-email@gmail.com |
| Password | your-app-password |
src/
├── app/ # Next.js App Router
│ ├── (hr-dashboard)/ # HR Dashboard routes
│ ├── (interview)/ # Interview participant routes
│ ├── api/ # API endpoints
│ │ ├── auth/gmail/ # Gmail OAuth endpoints
│ │ ├── email-template/ # Email template management
│ │ ├── send-invitation/ # Email sending logic
│ │ ├── sessions/ # Interview session management
│ │ └── analytics/ # Analytics endpoints
│ └── globals.css # Global styles
├── components/ # Reusable UI components
│ ├── shared/ # Common components
│ ├── providers/ # Context providers
│ └── logo/ # Branding components
├── lib/ # Utility libraries
│ ├── mongodb/ # Database schemas and connection
│ ├── features/ # Feature-specific logic
│ ├── lyzr-api/ # AI integration
│ ├── gmail-auth.ts # Gmail OAuth service
│ ├── gmail-email-service.ts # Email sending service
│ └── server-auth-utils.ts # Server-side auth utilities
└── hooks/ # Custom React hooks
View All API Endpoints
POST /api/auth/gmail/connect - Initiate Gmail connection
GET /api/auth/gmail/callback - OAuth callback handler
GET /api/auth/gmail/status - Check connection status
DELETE /api/auth/gmail/status - Disconnect Gmail
POST /api/auth/gmail/test - Send test email
GET /api/email-template - Get email template
POST /api/email-template - Save email template
DELETE /api/email-template - Reset to default template
GET /api/sessions - List interview sessions
POST /api/sessions - Create new session
POST /api/send-invitation - Send interview invitation
GET /api/sessions/:id - Get session details
PATCH /api/sessions/:id - Update session
DELETE /api/sessions/:id - Delete session
GET /api/messages - Get conversation messages
POST /api/messages - Store new message
POST /api/feedback - Generate AI feedback
GET /api/analytics - Get interview analytics
GET /api/sentiment - Get sentiment analysis
POST /api/suggestions - Get improvement suggestions
Customize your interview invitation emails with dynamic variables:
| Variable | Description |
|---|---|
{{name}} |
Employee's full name |
{{role}} |
Job role/title |
{{level}} |
Seniority level (junior/mid/senior) |
{{tenure}} |
Employment duration in months |
{{interviewUrl}} |
Unique interview link |
📄 HTML Template Example
```html <style> .button { background: #007bff; color: white; padding: 12px 24px; text-decoration: none; border-radius: 4px; } </style>
Dear {{name}},
We invite you to participate in an AI-powered exit interview.
Start Exit Interview ```| 🔐 OAuth 2.0 | Secure Gmail integration without password storage |
| 🏢 Multi-Tenant | Complete data isolation per organization |
| 🔄 Token Management | Automatic refresh and secure token storage |
| ✅ Input Validation | Comprehensive validation with Zod schemas |
| 🛡️ CORS Protection | Secure cross-origin request handling |
Transform exit interview data into actionable insights:
- 📈 Completion Rates - Track interview participation metrics
- 😊 Sentiment Analysis - AI-powered emotional tone analysis
- 🎯 Pattern Recognition - Identify common themes and concerns
- 👥 Role-Based Insights - Analytics segmented by department and level
- 📉 Trend Analysis - Historical data and retention patterns
- 💡 AI Recommendations - Actionable suggestions for improvement
# Build for production
npm run build
# Start production server
npm start| Platform | Status | Documentation |
|---|---|---|
| Vercel | ✅ Recommended | Optimized for Next.js |
| Docker | ✅ Supported | Dockerfile included |
| AWS | ✅ Supported | EC2, ECS, or Lambda |
| Google Cloud | ✅ Supported | Cloud Run or App Engine |
| Azure | ✅ Supported | App Service |
🔍 Common Issues & Solutions
- ✅ Verify environment variables are set correctly
- ✅ Check Google Cloud Console OAuth configuration
- ✅ Ensure redirect URIs match exactly (dev vs production)
- ✅ Check Gmail API quotas in Google Cloud Console
- ✅ Verify user has granted necessary permissions
- ✅ Test with SMTP fallback configuration
- ✅ Verify MongoDB URI format and credentials
- ✅ Check network connectivity to MongoDB instance
- ✅ Ensure database user has proper permissions
- ✅ Clear
.nextfolder:rm -rf .next - ✅ Clear
node_modules:rm -rf node_modules - ✅ Reinstall dependencies:
npm install - ✅ Check TypeScript errors:
npm run lint
- Free Tier: 1 billion quota units/day
- Email Sending: ~25 quota units per email
- Monitor: Google Cloud Console → APIs & Services → Quotas
We love contributions! Exit Interview OS is open-source and welcomes improvements from the community.
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow TypeScript best practices
- ✅ Write tests for new features
- 📖 Update documentation
- 🎨 Follow existing code style
- 💬 Write clear commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Lyzr AI