Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HireLabz AI Interview Assistant

An automated interview screening system powered by ElevenLabs AI, Twilio, and OpenAI. Built with Deno and React Email.

Features

  • 🎙️ Automated voice interviews using ElevenLabs AI
  • 📞 Phone integration with Twilio
  • 📧 Email communications via React Email & Resend
  • 🤖 Natural language processing with OpenAI
  • 🔄 Webhook integration for dynamic interview content
  • 📊 Automated interview evaluation and feedback
  • 💾 Interview transcription and storage
  • 🗄️ Supabase for data persistence

Prerequisites

  • Deno 1.37 or higher
  • ngrok for webhook testing
  • Supabase account and project
  • API keys for:
    • ElevenLabs
    • Twilio
    • Resend
    • OpenAI
    • Supabase

Environment Setup

  1. Clone the repository
  2. Create a .env file in the root directory:
RESEND_API_KEY=your_resend_api_key
FROM_EMAIL=your_sender_email
ELEVENLABS_API_KEY=your_elevenlabs_api_key
OPENAI_API_KEY=your_openai_api_key
TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_token
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key

Install Dependencies

deno install

Project Structure

/
├── src/
│   ├── controllers/     # Request handlers
│   │   ├── email/
│   │   └── webhook/
│   ├── routes/         # API routes
│   ├── types/         # TypeScript types
│   ├── services/      # Business logic
│   │   ├── elevenlabs/  # Voice & transcript services
│   │   ├── openai/     # Interview evaluation
│   │   └── db/         # Data storage
│   └── middleware/    # Custom middleware
├── emails/            # Email templates
├── tests/            # Test files
└── main.ts           # Application entry

Available Commands

# Load .env
source .env

# Start development server with watch mode
deno task dev

# Start production server
deno task start

# Run tests
deno task test

API Endpoints

Jobs

  • POST /api/jobs - Create a new job posting
  • GET /api/jobs - List all active jobs
  • PUT /api/jobs/:jobId - Update job details
  • DELETE /api/jobs/:jobId - Delete a job posting

Applications

  • POST /api/applications - Submit job application
  • GET /api/jobs/:jobId/applications - List applications for a job
  • GET /api/applications/:applicationId - Get single application
  • PUT /api/applications/:applicationId - Update application status

Interviews

  • POST /api/interviews - Create interview record
  • GET /api/interviews/:interviewId - Get interview with analysis

Analysis

  • POST /api/analysis - Create skill analysis
  • GET /api/analysis/:analysisId - Get specific analysis

Email

  • POST /api/email/send-invite - Send interview invitation
  • POST /api/email/send-reminder - Send interview reminder

Webhook

  • POST /api/webhook/twilio/interview - Handle Twilio interview calls
  • POST /api/webhook/twilio/status - Process call status updates

Interview Flow

  1. Recruiter creates job posting
  2. Candidate applies for job
  3. Recruiter reviews application and triggers interview
  4. Candidate receives interview invitation
  5. Candidate calls the Twilio number
  6. ElevenLabs AI conducts the interview
  7. When call completes:
    • Call transcript is fetched
    • OpenAI evaluates the interview
    • Results are stored
    • Notifications are sent
  8. Recruiter reviews interview results and updates application status

Testing the Webhooks

  1. Start the development server:
deno task dev
  1. In a new terminal, start ngrok:
ngrok http 8000
  1. Use the ngrok URLs in your Twilio configuration:
# Interview webhook (goes in elevenlabs)
https://your-ngrok-url.ngrok.io/api/webhook/twilio/interview

# Status webhook (goes in twillio)
https://your-ngrok-url.ngrok.io/api/webhook/twilio/status

Test Status Webhook

curl -X POST http://localhost:8000/api/webhook/twilio/status \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "CallSid=CA202d9ee8b1bb71f2ee332b80cb6f9b3d&CallStatus=completed&Duration=5&Caller=%2B16172512600&Timestamp=Sun%2C%2023%20Feb%202025%2001%3A09%3A55%20%2B0000"

Test Email Invitation

curl -X POST http://localhost:8000/api/email/send-invite \
-H "Content-Type: application/json" \
-d '{
  "email": "candidate@example.com",
  "invitationData": {
    "company": {
      "name": "ElevenLabs",
      "logoUrl": "https://eleven-public-cdn.elevenlabs.io/payloadcms/9trrmnj2sj8-logo-logo.svg",
      "recruiterCompany": "HireLabz"
    },
    "candidate": {
      "name": "John Doe"
    },
    "position": {
      "title": "Software Engineer",
      "department": "Engineering"
    }
  }
}'

API Testing Guide

Job Management

  1. Create a new job:
curl -X POST http://localhost:8000/api/jobs \
-H "Content-Type: application/json" \
-d '{
    "job_name": "Senior Software Engineer",
    "job_description": "We are looking for a Senior Software Engineer with strong experience in distributed systems and cloud architecture.",
    "section_description": "Technical Interview: System Design and Architecture",
    "sections": {
        "technical": ["System Design", "Coding", "Architecture"],
        "behavioral": ["Leadership", "Communication", "Problem Solving"]
    }
}'
  1. List all active jobs:
curl http://localhost:8000/api/jobs
  1. Update a job:
curl -X PUT http://localhost:8000/api/jobs/123 \
-H "Content-Type: application/json" \
-d '{
    "job_name": "Lead Software Engineer",
    "job_description": "Updated role focusing on team leadership and distributed systems",
    "section_description": "Technical Interview: Leadership and System Design",
    "status": true
}'
  1. Delete a job:
curl -X DELETE http://localhost:8000/api/jobs/123

Application Management

  1. Apply for a job:
curl -X POST http://localhost:8000/api/applications \
-H "Content-Type: application/json" \
-d '{
    "job_id": "123",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "resume_url": "https://example.com/resume.pdf",
    "linkedin_url": "https://linkedin.com/in/johndoe",
    "portfolio_url": "https://johndoe.dev",
    "github_url": "https://github.com/johndoe"
}'
  1. Get single application:
curl http://localhost:8000/api/applications/456
  1. List all applications:
curl http://localhost:8000/api/applications
  1. Update application status:
curl -X PUT http://localhost:8000/api/applications/456 \
-H "Content-Type: application/json" \
-d '{
    "status": "interviewed",
    "resume_url": "https://example.com/updated-resume.pdf",
    "linkedin_url": "https://linkedin.com/in/johndoe",
    "portfolio_url": "https://johndoe.dev",
    "github_url": "https://github.com/johndoe"
}'

Interview Process

  1. Send interview invitation:
curl -X POST http://localhost:8000/api/email/send-invite \
-H "Content-Type: application/json" \
-d '{
    "email": "candidate@example.com",
    "invitationData": {
        "company": {
            "name": "ElevenLabs",
            "logoUrl": "https://eleven-public-cdn.elevenlabs.io/payloadcms/9trrmnj2sj8-logo-logo.svg",
            "recruiterCompany": "HireLabz"
        },
        "candidate": {
            "name": "John Doe"
        },
        "position": {
            "title": "Software Engineer",
            "department": "Engineering"
        }
    }
}'
  1. Test Twilio status webhook:
curl -X POST http://localhost:8000/api/webhook/twilio/status \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "CallSid=CA202d9ee8b1bb71f2ee332b80cb6f9b3d&CallStatus=completed&Duration=5&Caller=%2B16172512600&Timestamp=Sun%2C%2023%20Feb%202025%2001%3A09%3A55%20%2B0000"

Interview Management

  1. Create an interview record:
curl -X POST http://localhost:8000/api/interviews \
-H "Content-Type: application/json" \
-d '{
    "applicant_id": "123",
    "transcript": "Interview transcript text...",
    "overall_rating": 85,
    "summary": "Strong candidate with excellent technical skills..."
}'
  1. Get interview with analysis:
curl http://localhost:8000/api/interviews/456

Analysis Management

  1. Create a skill analysis:
curl -X POST http://localhost:8000/api/analysis \
-H "Content-Type: application/json" \
-d '{
    "interview_id": "456",
    "skill_name": "System Design",
    "skill_score": 90,
    "skill_reasoning": "Demonstrated strong understanding of distributed systems..."
}'
  1. Get specific analysis:
curl http://localhost:8000/api/analysis/789

Expected Interview Response:

{
    "data": {
        "id": "456",
        "applicant_id": "123",
        "transcript": "Interview transcript text...",
        "overall_rating": 85,
        "summary": "Strong candidate with excellent technical skills...",
        "created_at": "2024-02-23T01:09:55.976Z",
        "analysis": [
            {
                "id": "789",
                "interview_id": "456",
                "skill_name": "System Design",
                "skill_score": 90,
                "skill_reasoning": "Demonstrated strong understanding of distributed systems...",
                "created_at": "2024-02-23T01:10:55.976Z"
            }
        ]
    }
}
  1. Error response:
{
    "error": "Failed to create job",
    "details": "Error message details"
}

Testing Tips

  1. Replace 123 and 456 with actual IDs from your database
  2. Use jq for pretty-printed JSON responses:
curl http://localhost:8000/api/jobs | jq
  1. For local testing, ensure the server is running:
deno task dev
  1. For webhook testing, ensure ngrok is running:
ngrok http 8000

Security

This project uses Deno's security features with explicit permissions:

  • --allow-env: For accessing environment variables
  • --allow-net: For API endpoints and external services
  • --allow-read: For reading configuration files

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages