Skip to content

Repository files navigation

Mockli Logo

Mockli

AI-Powered Mock Interview Platform for Top Tech Companies

Live Demo Next.js TypeScript Tailwind


What is Mockli?

Mockli is an AI-powered mock interview platform that helps you ace your next technical interview. Practice with realistic interview questions for top companies like Google, Microsoft, Amazon, and more. Get instant AI-generated feedback, track your progress, and earn certificates.

Key Features

  • AI-Generated Questions - 30 unique MCQ questions tailored to your target company and role
  • Multiple Difficulty Levels - From Novice to Expert, choose your challenge
  • Real-Time Scoring - Instant feedback with detailed performance analytics
  • Certificates - Downloadable certificates for completed tests
  • Progress Tracking - Dashboard to monitor your interview preparation journey
  • Credit System - Free tier with weekly credits, premium plans for unlimited practice
  • Admin Panel - Comprehensive management for companies, roles, and analytics

Tech Stack

Frontend

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript 5
  • Styling: Tailwind CSS + shadcn/ui
  • UI Components: Radix UI
  • State Management: React 19
  • Authentication: Clerk

Backend

  • Runtime: Node.js
  • API Routes: Next.js API Routes
  • Database: PostgreSQL (Neon)
  • ORM: Drizzle ORM
  • File Storage: Vercel Blob
  • Email: Resend

AI & Automation

  • LLM Providers: Groq (gpt-oss, llama-3.1) + OpenAI (gpt-4o-mini fallback)
  • Background Jobs: Inngest
  • Payments: Dodo Payments

Infrastructure

  • Hosting: Vercel
  • Database: Neon (Serverless Postgres)
  • Storage: Vercel Blob
  • CDN: Vercel Edge Network

Installation

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database (or Neon account)
  • Clerk account for authentication
  • API keys for AI providers

1. Clone the repository

git clone https://github.com/Amit00008/mockli.git
cd mockli

2. Install dependencies

npm install

3. Set up environment variables

Create a .env file in the root directory:

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

# Database (Neon)
DATABASE_URL=postgresql://user:password@host/database?sslmode=require

# AI Providers
GROQ_API_KEY=your_groq_api_key
OPENAI_API_KEY=your_openai_api_key

# Inngest (Background Jobs)
INNGEST_EVENT_KEY=your_inngest_event_key
INNGEST_SIGNING_KEY=your_inngest_signing_key

# Vercel Blob Storage
BLOB_READ_WRITE_TOKEN=your_blob_token

# Payments (Dodo Payments)
NEXT_PUBLIC_DODO_CLIENT_ID=your_dodo_client_id
DODO_PAYMENTS_SECRET=your_dodo_secret
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Email (Resend)
RESEND_API_KEY=your_resend_api_key

4. Set up the database

# Generate migrations
npm run db:gen

# Push schema to database
npm run db:push

# (Optional) Open Drizzle Studio to view/edit data
npm run db:studio

# (Optional) Seed database with sample data
npm run db:seed

5. Run the development server

npm run dev

Open http://localhost:3000 to see your app.

6. Run Inngest dev server (separate terminal)

npm run inngest

Development Guide

Available Scripts

# Development
npm run dev              # Start dev server
npm run build            # Build for production
npm run start            # Start production server

# Background Jobs
npm run inngest          # Start Inngest dev server

# Database
npm run db:gen           # Generate migrations
npm run db:push          # Push schema changes to DB
npm run db:studio        # Open Drizzle Studio
npm run db:seed          # Seed database with sample data

Key Features to Explore

1. Test Taking Flow (/test/start)

  • Select company and role
  • Choose difficulty level
  • AI generates 30 unique questions
  • 15-minute timed test
  • Instant scoring and feedback

2. Dashboard (/dashboard)

  • View test history
  • Track performance over time
  • See credits and subscription status
  • Quick access to new tests

3. Results & Certificates (/test/[id]/results)

  • Detailed score breakdown
  • AI-generated performance summary
  • Downloadable certificate
  • Share on social media

4. Admin Panel (/admin)

  • Analytics dashboard
  • Company management with logo uploads
  • Role management
  • User statistics

Database Schema

The app uses Drizzle ORM with PostgreSQL. Main tables:

Core Tables:

  • users - User accounts with credits and subscription status
  • tests - Test records with questions, answers, and scores
  • companies - Companies with logos (stored in Vercel Blob)
  • roles - Job roles associated with companies
  • subscriptions - User subscription plans and expiration
  • admins - Admin user IDs for platform management

View full schema: lib/schema.ts

AI Question Generation

Mockli uses a multi-model fallback system:

  1. Groq gpt-oss-120b (Primary)
  2. Groq llama-3.1-8b (Fallback 1)
  3. Groq gpt-oss-20b (Fallback 2)
  4. OpenAI gpt-4o-mini (Final Fallback)

Questions are validated to ensure:

  • Exactly 4 options per question
  • Valid correctAnswer (0-3)
  • Automatic conversion of letter answers (A-D) to numbers
  • Fallback to safe defaults if validation fails

Getting API Keys

Required Services

  1. Clerk - clerk.com - Authentication
  2. Groq - console.groq.com - AI Models
  3. OpenAI - platform.openai.com - Fallback AI
  4. Neon - neon.tech - Database
  5. Inngest - inngest.com - Background Jobs
  6. Vercel - vercel.com - Hosting & Blob Storage
  7. Dodo Payments - dodopayments.com - Payments
  8. Resend - resend.com - Email

Features

For Users

  • ✅ Free tier with 5 credits per week
  • ✅ Premium plans (Standard: 50 credits, Premium: 200 credits)
  • ✅ Practice for 50+ companies
  • ✅ Multiple difficulty levels
  • ✅ Instant AI feedback
  • ✅ Performance tracking
  • ✅ Downloadable certificates
  • ✅ Report issues via email

For Admins

  • ✅ Analytics dashboard
  • ✅ User statistics
  • ✅ Company management with logo uploads
  • ✅ Role management
  • ✅ Test completion metrics

Deployment

Deploy to Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy
# Or use Vercel CLI
vercel --prod

Environment Variables Checklist

Make sure to add all variables from .env to your Vercel project settings.

Post-Deployment Setup

  1. Add Admin Users:

    INSERT INTO admins (user_id) 
    SELECT id FROM users WHERE email = 'your-email@example.com';
  2. Configure Inngest:

    • Set up webhook endpoint: https://your-domain.com/api/inngest
    • Configure weekly credit refresh cron job
  3. Configure Dodo Payments:

    • Add webhook URL: https://your-domain.com/api/webhooks/dodo
    • Set return URL to your domain

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.


Acknowledgments


Try MockliReport BugRequest Feature

Made with ❤️ by Amit

About

AI-Powered company mock tests

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages