Skip to content

yashikabhalla/Collabrix

Repository files navigation

Collabrix πŸš€

AI-Powered Real-Time Collaborative Coding Platform for Placement Preparation

Live Demo

🌐 Live Demo β€” Click "Launch Demo" for instant access, no signup required.


πŸ“– What is Collabrix?

Collabrix is a full-stack collaborative coding platform built for technical interview preparation. Multiple users can join a shared coding room and code together in real-time, while an AI interviewer guides them through DSA problems β€” just like a real placement interview.

Built for: CS/Engineering students preparing for product company placements at Google, Microsoft, Amazon, and Flipkart.


✨ Core Features

πŸ‘¨β€πŸ’» Real-Time Collaborative Editor

  • Monaco Editor (same as VS Code) with live multi-cursor support
  • Cursor tracking with user names and colors
  • Presence indicators showing who is online
  • Sub-50ms sync latency powered by Liveblocks CRDT

πŸ€– AI Interviewer (Chatbot)

  • Powered by Groq API (Llama 3.1) β€” extremely fast responses
  • Choose between Mock Interview or Practice Mode
  • AI asks DSA problems, gives hints, and evaluates solutions
  • Remembers conversation context throughout the session
  • Tailors difficulty based on your target company

▢️ Code Execution

  • Supports 10+ programming languages via JDoodle API
  • Output displayed in real-time below the editor
JavaScript  β€’  TypeScript  β€’  Python  β€’  Java  β€’  C++  β€’  C
Go  β€’  Rust  β€’  Kotlin  β€’  Swift  β€’  PHP  β€’  Ruby

πŸ“Ή Video Calling (Pro only)

  • Video Calling with Jitsi Meet integration
  • No external app needed β€” runs inside the browser
  • Live notification when a collaborator starts a call

πŸ” Authentication

  • Secure sign-up/sign-in powered by Clerk
  • Google social login supported

πŸ’³ Subscription & Payments

  • Free: 3 rooms/month, 2 participants, 8 languages
  • Pro (β‚Ή299/month): Unlimited rooms, video calling, session recordings, AI Interviewer
  • Payments via Razorpay β€” UPI, cards, net banking supported

πŸ› οΈ Tech Stack

Layer Technology
Framework Next.js 16, React 18, TypeScript
Styling Tailwind CSS, shadcn/ui
Code Editor Monaco Editor
Real-Time Sync Liveblocks (CRDT, <50ms latency)
AI Groq API β€” Llama 3.1 8B Instant
Video Calling Jitsi Meet SDK
Authentication Clerk
Database PostgreSQL + Prisma ORM
Payments Razorpay
Code Execution JDoodle API
Deployment Vercel

πŸ’‘ Free vs Pro

Feature Free Pro
Rooms per month 3 Unlimited
Participants per room 2 5
Programming languages 8 10+
Code execution βœ… βœ…
AI Interviewer ❌ βœ…
Video calling ❌ βœ…
Session recordings ❌ βœ…
Price β‚Ή0/month β‚Ή299/month

πŸ“ Project Structure

collabrix/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/                   # Sign in / Sign up pages
β”‚   β”œβ”€β”€ (dashboard)/              # Dashboard page
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ ai/                   # Groq AI chatbot endpoint
β”‚   β”‚   β”œβ”€β”€ execute/              # Code execution endpoint
β”‚   β”‚   β”œβ”€β”€ liveblocks-auth/      # Liveblocks auth endpoint
β”‚   β”‚   β”œβ”€β”€ payment/              # Razorpay create-order + verify
β”‚   β”‚   β”œβ”€β”€ rooms/                # Room CRUD API
β”‚   β”‚   β”œβ”€β”€ solved/               # Solved problems tracking
β”‚   β”‚   └── video-room/           # Jitsi video room API
β”‚   β”œβ”€β”€ demo/                     # Demo mode (no auth required)
β”‚   └── room/[roomId]/            # Individual room page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ dashboard/                # Dashboard UI components
β”‚   β”œβ”€β”€ editor/
β”‚   β”‚   β”œβ”€β”€ AIChat.tsx            # AI Interviewer chatbot
β”‚   β”‚   β”œβ”€β”€ CollaborativeEditor.tsx
β”‚   β”‚   β”œβ”€β”€ LiveCursors.tsx
β”‚   β”‚   β”œβ”€β”€ Output.tsx
β”‚   β”‚   β”œβ”€β”€ RoomClient.tsx
β”‚   β”‚   β”œβ”€β”€ Toolbar.tsx
β”‚   β”‚   └── VideoCall.tsx
β”‚   └── landing/                  # Landing page sections
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ db.ts                     # Prisma client
β”‚   └── plans.ts                  # Free/Pro plan limits
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma             # Database schema
└── liveblocks.config.ts          # Liveblocks types config

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database (Neon or Supabase free tier works)
  • Accounts on: Clerk, Liveblocks, Groq, Razorpay, JDoodle

1. Clone the repository

git clone https://github.com/yashikabhalla/collabrix.git
cd collabrix
npm install

2. Set up environment variables

Create a .env.local file in the root:

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
 
# Database
DATABASE_URL=postgresql://...
 
# Liveblocks
LIVEBLOCKS_SECRET_KEY=sk_...
NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY=pk_...
 
# Groq AI
GROQ_API_KEY=gsk_...
 
# Razorpay Payments
RAZORPAY_KEY_ID=rzp_test_...
RAZORPAY_KEY_SECRET=...
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_test_...
 
# JDoodle Code Execution
JDOODLE_CLIENT_ID=...
JDOODLE_CLIENT_SECRET=...

3. Set up the database

npx prisma db push
npx prisma generate

4. Run the development server

npm run dev

Open http://localhost:3000 πŸŽ‰


βš™οΈ How It Works

User creates or joins a room
          β”‚
          β–Ό
  Real-Time Editor (Liveblocks)
  cursors Β· presence Β· sync <50ms
          β”‚
          β–Ό
  Code Execution (JDoodle)
  10+ languages Β· output below editor
          β”‚
          β–Ό
  AI Interviewer (Groq)
  mock interview Β· hints Β· evaluation
          β”‚
          β–Ό
  Video Call (Jitsi) β€” Pro only
  face-to-face mock interview

πŸ”§ Key Technical Decisions

Decision Reason
Liveblocks Production CRDT sync, <50ms latency, no rebuild needed
Groq Free tier, <200ms response time, Llama 3.1 quality
Jitsi Open-source, browser-native, no external app required
Clerk Handles JWT + OAuth out of the box β€” saves weeks
Razorpay Indian market standard, supports UPI + cards
Monaco Editor Same editor as VS Code β€” familiar to all developers

πŸ“œ Built By

Β© Yashika Bhalla


**Built with ❀️ for placement preparation**

🌐 Live Demo Β Β·Β