Skip to main content

MentorHub

A full-stack mentoring SaaS with WebRTC video rooms, intelligent session booking, tiered mentor profiles, and real-time session lifecycle management.

  • Full-Stack Development
  • WebRTC Integration
  • Product Design
  • Database Architecture
MentorHub dashboard showing mentor profiles and session scheduling

The Challenge

Mentoring platforms exist, but most are clunky. Schedulers don't sync with real availability. Video rooms drop mid-call. Payment flows are fragmented. Mentors and students lose context between sessions. Building a cohesive, real-time mentoring experience at scale requires deep integration across booking, video, payments, and auth.

Platform Overview

MentorHub connects mentors and students for paid 1-on-1 sessions. Mentors set availability windows. Students browse mentor profiles, see real-time slots, and book sessions instantly. When the session time arrives, both parties join a WebRTC video room. After the call, the session closes and data is logged.

Mentor Onboarding — Sign up via Clerk auth. Upload profile photo to Firebase Cloud Storage. Set expertise tags, bio, hourly rate, and availability windows.

Student Discovery — Browse mentor listings with photo, ratings, and availability. Filter by skill. See real-time open slots for the next 7 days.

Booking & Payments — Select a slot and pay upfront via integrated payment processor. Mentor receives confirmation. Session is locked in.

Video Rooms — At session time, both join via WebRTC. Firebase Firestore handles signaling. Call quality monitored and logged. Auto-disconnect at session end time.

Session Lifecycle — Authorize → Start → End. Countdown timer on both sides. Warnings at 5 min and 1 min before end. Post-session feedback collection.

MentorHub UI components and design system

Tech Stack

Frontend: Next.js with App Router for fast, server-side rendered pages. Clerk for authentication (social login + password-less magic links).

Backend: Express 5 REST API. MongoDB with Mongoose ODM for data persistence. Handled payment integration and session lifecycle endpoints.

Real-time Video: WebRTC for peer-to-peer media. Firebase Firestore for ICE candidate signaling. Handles NAT traversal and connection negotiation.

Storage: Firebase Cloud Storage for mentor profile photos. URLs stored in MongoDB. Automatic CDN distribution.

Key Features Implemented

Availability Scheduling — Mentors define recurring availability windows (e.g., "Mon–Wed 6pm–9pm"). Frontend displays open slots in student's local timezone.

Real-time Session Timer — Dual-sided countdown synced to server time. Survives iframe reloads. Visual warnings escalate as session end approaches.

Profile Photo Upload — Direct upload to Firebase. URL persisted to MongoDB root document. Cached for fast loading.

WebRTC Signaling — Firestore document per session pair. ICE candidates exchanged asynchronously. Automatic cleanup on session end.

Payment Flow — Pre-authorization before booking. Webhook handling for payment confirmations. Revenue splitting (platform cut vs. mentor).

Lessons Learned

Timezone Handling: Server runs IST (UTC+5:30). Always use local midnight — never bake timestamps into dates. Use setHours(0,0,0,0) for clean date boundaries.

Concurrent Updates: Mongoose .save() can overwrite concurrent changes. Use findByIdAndUpdate with $set operators for atomic safety.

iframe Stability: Changing src reloads the iframe and kills WebRTC. Freeze src on mount; use ref-based tracking instead.

Cache Busting: Query params (?v=12) force iframe reload on deploy. Increment version on every backend change to invalidate browser cache.

Results

Active mentoring platform with real mentors and students using it daily. Session booking system handling timezone-aware scheduling. WebRTC video rooms delivering sub-100ms latency calls. MongoDB reliably persisting 100K+ sessions and mentor profiles. Scalable architecture ready for multi-region expansion.