Skip to content

Repository files navigation

🎤 Certum AI

An intelligent interview preparation platform powered by AI voice technology and emotion analysis

Next.js React TypeScript PostgreSQL Vercel


📋 Table of Contents


🎯 Overview

A cutting-edge AI-powered SaaS platform that revolutionizes interview preparation through voice-based mock interviews with real-time emotion analysis. The platform leverages advanced AI models to provide personalized feedback, helping job seekers practice and improve their interview skills.

🌟 What Makes This Special

  • Voice-First Interview Experience: Natural, conversational interviews powered by Hume AI's empathic voice technology
  • Emotion Intelligence: Real-time analysis of confidence, clarity, and emotional cues during responses
  • AI-Powered Feedback: Detailed, actionable insights generated by Google Gemini 2.5 Flash
  • Full-Stack Architecture: Modern Next.js 15 app with TypeScript, PostgreSQL, and production-grade security

✨ Key Features

🎙️ Voice Interview System

  • Real-time voice interaction using Hume AI's emotion-aware voice technology
  • Natural conversation flow with contextual follow-up questions
  • Live emotion tracking and analysis during interviews
  • Audio recording and transcript generation

🤖 AI-Powered Analysis

  • Google Gemini Integration: Advanced feedback generation analyzing:
    • Communication clarity and articulation
    • Confidence levels based on emotional cues
    • Response quality relative to job requirements
    • Pacing, timing, and overall delivery
  • Personalized Recommendations: Tailored improvement suggestions
  • Resume Analysis: AI-driven resume evaluation and optimization tips

💼 Job Management

  • Custom job information profiles with role, company, and requirements
  • Industry-specific interview question generation
  • Experience level matching (Entry, Mid, Senior, Executive)
  • Multiple job profiles per user

🔐 Authentication & Security

  • Clerk Authentication: Secure user management and session handling
  • Arcjet Protection: Rate limiting, bot detection, and attack prevention
  • Protected routes with middleware-level authorization
  • Environment-based security configurations

🎨 Modern UI/UX

  • Responsive design built with Tailwind CSS v4
  • Shadcn/ui component library for consistent design
  • Dark/light theme support with next-themes
  • Smooth animations and transitions
  • Mobile-optimized interface

📊 Dashboard & Analytics

  • Interview history and performance tracking
  • Progress visualization
  • Feedback archive and comparison
  • User onboarding flow

🛠️ Tech Stack

Frontend

  • Framework: Next.js 15.5 (App Router with Turbopack)
  • UI Library: React 19.1 with TypeScript 5
  • Styling: Tailwind CSS v4, Shadcn/ui components
  • State Management: React Hook Form + Zod validation
  • Theming: next-themes for dark/light mode

Backend

  • Runtime: Node.js with Next.js API Routes
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: Clerk
  • Security: Arcjet (rate limiting, bot protection)
  • Validation: Zod schemas with T3 Env

AI & External Services

  • Voice AI: Hume AI (@humeai/voice-react)
  • Language Model: Google Gemini 2.5 Flash (@ai-sdk/google)
  • AI SDK: Vercel AI SDK for streaming responses
  • Webhooks: Svix for secure webhook handling

DevOps & Deployment

  • Hosting: Vercel (frontend + serverless functions)
  • Database: Neon (serverless PostgreSQL)
  • Version Control: Git/GitHub
  • CI/CD: Vercel auto-deployment
  • Environment Management: T3 Env with Zod

Development Tools

  • Package Manager: npm
  • Linting: ESLint with Next.js config
  • Database Tools: Drizzle Kit (migrations, studio)
  • Local Development: Docker Compose for PostgreSQL

🏗️ Architecture

Feature-Based Organization

src/
├── app/                    # Next.js App Router
│   ├── api/               # API routes and webhooks
│   ├── app/               # Protected application routes
│   ├── data/              # Environment configuration
│   ├── demo-landing/      # Public landing page
│   ├── onboarding/        # User onboarding flow
│   └── sign-in/           # Authentication pages
│
├── features/              # Domain-driven features
│   ├── interviews/        # Interview management & AI feedback
│   ├── jobInfos/          # Job information CRUD
│   ├── questions/         # Question generation
│   ├── resumeAnalyses/    # Resume analysis
│   └── users/             # User profile management
│
├── drizzle/               # Database layer
│   ├── schema/            # Table definitions
│   ├── migrations/        # SQL migrations
│   └── db.ts              # Database connection
│
├── services/              # External integrations
│   ├── ai/                # Google Gemini integration
│   ├── clerk/             # Auth utilities
│   └── hume/              # Voice AI integration
│
├── components/            # React components
│   └── ui/                # Shadcn/ui components
│
└── lib/                   # Shared utilities

Data Flow

  1. User Authentication → Clerk validates and creates session
  2. Job Setup → User creates job profile with requirements
  3. Question Generation → AI generates relevant interview questions
  4. Voice Interview → Hume AI conducts conversation with emotion tracking
  5. Transcript Analysis → Google Gemini processes conversation + emotions
  6. Feedback Generation → AI creates detailed performance report
  7. Storage → Interview data and feedback saved to PostgreSQL

Caching Strategy

  • Next.js use cache directive for database queries
  • Feature-based cache tags for granular invalidation
  • Automatic cache busting on mutations via server actions

Security Layers

  1. Middleware: Clerk authentication + public route handling
  2. Server Actions: Permission checks per user/resource
  3. Rate Limiting: Arcjet token buckets (12 req/day, refill 4/day)
  4. Input Validation: Zod schemas on all forms and API inputs
  5. SQL Injection Protection: Drizzle ORM parameterized queries

🚀 Getting Started

Prerequisites

  • Node.js 20+ and npm
  • PostgreSQL database (local via Docker or cloud instance)
  • API keys for:
    • Clerk (authentication)
    • Hume AI (voice interviews)
    • Google Generative AI (Gemini)
    • Arcjet (security)

Installation

# Clone the repository
git clone https://github.com/your-username/ai-saas-interview-project.git
cd ai-saas-interview-project

# Install dependencies
npm install

# Set up environment variables (see Environment Setup below)
cp .env.example .env.local

# Start local PostgreSQL (or use cloud database)
docker-compose up -d

# Run database migrations
npm run db:migrate

# Start development server
npm run dev

The application will be available at http://localhost:3000


🔐 Environment Setup

Required Environment Variables

Create a .env.local file in the root directory:

# Database Configuration
DATABASE_URL=postgresql://username:password@hostname:port/database

# Or individual DB variables (for local Docker)
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=interview_platform

# External API Keys
ARCJET_KEY=your_arcjet_key
CLERK_SECRET_KEY=your_clerk_secret
HUME_API_KEY=your_hume_api_key
HUME_SECRET_KEY=your_hume_secret_key
GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key

# Client-side variables
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/app
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL=/onboarding
NEXT_PUBLIC_HUME_CONFIG_ID=your_hume_config_id

Getting API Keys

  • Clerk: clerk.com - Free tier available
  • Hume AI: hume.ai - Sign up for voice API access
  • Google Gemini: ai.google.dev - Free tier with generous limits
  • Arcjet: arcjet.com - Security and rate limiting

🗄️ Database Management

Available Commands

# Generate migrations from schema changes
npm run db:generate

# Apply migrations to database
npm run db:migrate

# Push schema directly (dev only - skips migrations)
npm run db:push

# Open Drizzle Studio for visual database inspection
npm run db:studio

Database Schema

Core Tables:

  • user - User profiles and preferences
  • jobInfo - Job positions and requirements
  • interview - Interview sessions and transcripts
  • question - Generated interview questions
  • resumeAnalysis - Resume evaluation data

Relationships:

  • Users → JobInfos (one-to-many)
  • JobInfos → Questions (one-to-many)
  • JobInfos → Interviews (one-to-many)
  • All foreign keys use CASCADE deletes

📁 Project Structure

Feature Organization

Each feature in /src/features/ follows a consistent pattern:

features/[featureName]/
├── actions.ts          // Server actions for mutations
├── db.ts               // Database queries and operations
├── dbCache.ts          // Cache tags and invalidation
├── permissions.ts      // Authorization checks
└── schemas.ts          // Zod validation schemas

Key Patterns

Server Actions:

export async function createInterview(data: InterviewInput) {
  const user = await getCurrentUser(); // Auth check
  await validatePermissions(user, data); // Permission check
  
  // Rate limiting via Arcjet
  const result = await createInterviewDb(data);
  
  revalidateTag(`interviews-${user.id}`); // Cache invalidation
  return result;
}

Database Queries:

"use cache"; // Next.js caching directive
export async function getInterviews(userId: string) {
  return db.select().from(interview).where(eq(interview.userId, userId));
}

💻 Development Workflow

Running Locally

# Start development server with Turbopack (fast refresh)
npm run dev

# Build for production (test production build)
npm run build
npm start

# Lint code
npm run lint

Adding New Features

  1. Create feature directory in /src/features/[featureName]/
  2. Define database schema in /src/drizzle/schema/[featureName].ts
  3. Generate and run migrations:
    npm run db:generate
    npm run db:migrate
  4. Implement feature logic (actions, db queries, permissions)
  5. Create UI components and integrate with app routes
  6. Add cache tags and invalidation logic

Testing

While there's no formal test suite, verify functionality by:

  • Running the dev server and testing routes manually
  • Using Drizzle Studio (npm run db:studio) to inspect database state
  • Checking browser dev tools for API responses and errors
  • Testing authentication flows and permission checks

🌐 Deployment

Production Deployment (Vercel + Neon)

Current Live Deployment:

Steps:

  1. Fork this repository
  2. Connect to Vercel via GitHub integration
  3. Set up Neon PostgreSQL database
  4. Configure environment variables in Vercel dashboard
  5. Deploy automatically on push to main branch

Environment Variables in Production

Ensure all variables from .env.example are configured in Vercel:

  • Project Settings → Environment Variables
  • Add all required API keys and database credentials
  • Separate staging/production environments if needed

🔮 Future Enhancements

Planned Features

  • Advanced Analytics Dashboard: Interview performance trends over time
  • Video Interview Mode: Add webcam support for body language analysis
  • Multi-Language Support: Internationalization for global users
  • Interview Templates: Pre-built question sets for common roles
  • Team Collaboration: Share interviews with mentors or peers
  • Mobile App: React Native companion app

Technical Improvements

  • Testing Suite: Jest + React Testing Library integration
  • E2E Tests: Playwright for critical user flows
  • Performance Monitoring: Sentry error tracking and performance insights
  • Custom Domain: Professional branding with custom URL
  • Advanced Arcjet Security: Re-enable full security middleware
  • WebSocket Support: Real-time collaboration features

📊 Project Metrics

  • Build Time: ~10 seconds
  • Bundle Size: 187 kB shared JavaScript
  • Lighthouse Score: 95+ (Performance, Accessibility, Best Practices)
  • Database: 5 core tables with relational integrity
  • API Routes: 10+ protected endpoints
  • UI Components: 20+ reusable Shadcn components

🤝 Contributing

This is a portfolio project, but suggestions and feedback are welcome! Feel free to:

  • Open an issue for bugs or feature requests
  • Fork the repository and submit a pull request
  • Star the repository if you find it useful

👨‍💻 Author

Your Name


🙏 Acknowledgments

  • Next.js Team: For the incredible framework and Turbopack
  • Vercel: For seamless deployment and hosting
  • Hume AI: For empathic voice technology
  • Google: For Gemini AI model access
  • Clerk: For authentication infrastructure
  • Shadcn: For beautiful UI components

⭐ Star this repository if you find it helpful!

Built with ❤️ using Next.js, React, and AI

About

An AI‑powered voice interview platform that simulates real job interviews using Hume AI’s empathic technology and delivers performance feedback via Google Gemini.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages