Next.js React TypeScript Supabase VAPI Clerk Tailwind CSS License
Revolutionize your learning with AI voice companions. Real-time voice conversations, personalized tutors, and gamified learningβall powered by cutting-edge AI. π Voice AI β’ π Analytics β’ π¨ Glassmorphism UI β’ π₯ Streak Tracking
- π£οΈ Real-Time Voice Conversations - Natural, AI-powered tutoring sessions via VAPI SDK
- π― Subject-Specific Companions - Create custom AI tutors for Math, Science, Coding, Languages, History, Economics
- π Personality Customization - Choose voice gender (Male/Female) and teaching style (Formal/Casual)
- π Live Transcription - Real-time conversation capture with full session transcripts
- π Activity Heatmap - GitHub-style learning visualization with weekly, monthly, and yearly views
- π₯ Streak Counter - Track daily learning consistency and longest streaks
- π Bar Charts & Calendars - Multi-view data visualization for insights
- π Gamification - Achievement badges and progress milestones
- β Create Custom Companions - Multi-step form with topic, subject, voice, and duration selection
- π Companion Library - Browse popular companions and recently completed sessions
- πΎ Bookmarking System - Save favorite companions for quick access
- π Reusable Templates - Share companion configurations via shareable links
- π¨ Subject-Themed UI - Color-coded companions by subject (Math: Yellow, Science: Purple, etc.)
- β‘ Next.js 15 - React 19, Server Components, Turbopack for blazing-fast performance
- π¨ Glassmorphism UI - Frosted glass effects with Tailwind CSS 4.0
- π Framer Motion - Smooth animations and micro-interactions
- ποΈ Lottie Animations - Loading states, success animations, and empty states
- π Clerk Authentication - Google OAuth, social login, and session management
- ποΈ Supabase Backend - PostgreSQL database with real-time subscriptions
- π Edge-Optimized - Sentry error tracking and performance monitoring
- π Server-Side Caching - React Cache API for optimized data fetching
- π‘οΈ Type-Safe - Full TypeScript coverage with Zod validation
Dashboard showcasing popular companions across subjects and recent learning sessions
π¨ Companion Creation
Multi-step form for creating AI tutors with custom voice and style Voice Session with Soundwave
ποΈ Live Voice Session
Real-time conversation with soundwave visualization and transcription
β³ Connecting Animation
Smooth loading state while establishing voice connection Session Completion Success Animation
β Completion Animation
Success feedback with lesson saved confirmation
Activity Heatmap Visualization - Monthly
Activity Heatmap Visualization - Weekly
π Activity Heatmap
GitHub-style learning tracker with yearly/monthly/weekly views My Journey Dashboard
π₯ My Journey Dashboard
Progress analytics, streak counter, and session history
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.4.7 |
React framework with App Router, Server Components, and Turbopack |
| React | 19.1.0 |
UI library with latest concurrent features |
| TypeScript | 5.x |
Type-safe development with strict mode |
| Tailwind CSS | 4.0 |
Utility-first CSS with custom glassmorphism design system |
| Framer Motion | 12.23.12 |
Animation library for smooth transitions and micro-interactions |
| Lottie React | 2.4.1 |
JSON-based animations for loading and success states |
| Technology | Version | Purpose |
|---|---|---|
| VAPI SDK | 2.3.0 |
Real-time voice conversation AI with WebRTC |
| React Hook Form | 7.62.0 |
Form state management with Zod validation |
| Zod | 3.25.76 |
Runtime type validation and schema parsing |
| Technology | Version | Purpose |
|---|---|---|
| Supabase | 2.56.0 |
PostgreSQL database with real-time subscriptions and RLS |
| Clerk | 6.31.4 |
Authentication and user management with OAuth providers |
| Prisma (implied) | Latest | Type-safe database ORM (if used) |
| Technology | Purpose |
|---|---|
| Radix UI | Accessible component primitives (Accordion, Select, Label) |
| Lucide React | Modern icon library with 1000+ icons |
| React Calendar Heatmap | GitHub-style activity visualization |
| React Tooltip | Interactive tooltips for data points |
| Shadcn UI | Customizable component system |
| Technology | Purpose |
|---|---|
| Sentry | Error tracking and performance monitoring |
| ESLint | Code linting with Next.js config |
| class-variance-authority | Type-safe variant styling |
| clsx + tailwind-merge | Conditional className utilities |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Next.js 15 β β React 19 β β Tailwind CSS β β
β β App Router β β Components β β Styling β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Authentication Layer β
β ββββββββββββββββ β
β β Clerk Auth β β
β β OAuth 2.0 β β
β ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
βΌ βΌ
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β Voice AI Layer β β Database Layer β
β ββββββββββββββββββββββ β β ββββββββββββββββββββββ β
β β VAPI SDK β β β β Supabase β β
β β - Voice Recognitionβ β β β - PostgreSQL DB β β
β β - Text-to-Speech β β β β - Real-time APIs β β
β β - Conversation AI β β β β - Storage Buckets β β
β ββββββββββββββββββββββ β β ββββββββββββββββββββββ β
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β β
βββββββββββββββ¬ββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Monitoring Layer β
β ββββββββββββββββ β
β β Sentry β β
β β Error/Perf β β
β ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Ensure you have the following installed:
- Node.js
18.0+(Download) π’ - npm package manager π¦
- Git for version control π§
- Supabase account (Sign up) ποΈ
- Clerk account (Sign up) π
- VAPI account (Sign up) ποΈ
-
Clone the repository
git clone https://github.com/chayan-1906/IntelliCourse-Next.js.git cd IntelliCourse-Next.js -
Install dependencies
npm install
-
Configure environment variables
Create a
.envfile in the root directory:cp .env.example .env
Add the following variables:
# Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx CLERK_SECRET_KEY=sk_test_xxxxx # Clerk - Custom Auth NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/ NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/ # Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... # VAPI Configuration NEXT_PUBLIC_VAPI_WEB_TOKEN=xxxxx-xxxxx-xxxxx-xxxxx # Sentry (Optional - for production monitoring) SENTRY_AUTH_TOKEN=xxxxx
-
Set up Supabase database
Run the following SQL in your Supabase SQL Editor:
-- Create companions table CREATE TABLE companions ( id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), name TEXT NOT NULL, subject TEXT NOT NULL, topic TEXT NOT NULL, voice TEXT NOT NULL, style TEXT NOT NULL, duration INTEGER NOT NULL, author TEXT NOT NULL, created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW() ); -- Create session_history table CREATE TABLE session_history ( id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), companion_id UUID REFERENCES companions(id) ON DELETE CASCADE, user_id TEXT NOT NULL, duration_minutes INTEGER DEFAULT 0, transcript TEXT, created_at TIMESTAMPTZ DEFAULT NOW(), completed_at TIMESTAMPTZ ); -- Create bookmarks table CREATE TABLE bookmarks ( id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), companion_id UUID REFERENCES companions(id) ON DELETE CASCADE, user_id TEXT NOT NULL, created_at TIMESTAMPTZ DEFAULT NOW(), UNIQUE(companion_id, user_id) ); -- Enable Row Level Security ALTER TABLE companions ENABLE ROW LEVEL SECURITY; ALTER TABLE session_history ENABLE ROW LEVEL SECURITY; ALTER TABLE bookmarks ENABLE ROW LEVEL SECURITY; -- Create policies (adjust based on your auth setup) CREATE POLICY "Enable read for all users" ON companions FOR SELECT USING (true); CREATE POLICY "Enable insert for authenticated users" ON companions FOR INSERT WITH CHECK (true); CREATE POLICY "Enable update for owner" ON companions FOR UPDATE USING (auth.uid() = author); CREATE POLICY "Enable delete for owner" ON companions FOR DELETE USING (auth.uid() = author);
-
Configure VAPI Assistant
In your VAPI dashboard:
- Create a new assistant
- Configure voice settings (male/female options)
- Set up system prompts for educational tutoring
- Enable conversation transcription
- Copy the Assistant ID to your
.env
-
Run development server
npm run dev
-
Open browser
Navigate to http://localhost:3000 π
IntelliCourse-Next.js/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes
β β β βββ sentry-example-api/ # Sentry integration
β β βββ companions/ # Companion pages
β β β βββ [id]/ # Dynamic companion detail
β β β β βββ page.tsx # Session page
β β β β βββ loading.tsx # Loading skeleton
β β β βββ new/ # Create companion
β β β βββ page.tsx # Companions list
β β βββ my-journey/ # User analytics dashboard
β β βββ subscription/ # Subscription management
β β βββ sign-in/ # Authentication pages
β β βββ layout.tsx # Root layout with providers
β β βββ page.tsx # Home page
β β βββ globals.css # Global styles
β β
β βββ components/ # Reusable components
β β βββ ui/ # Shadcn UI components
β β β βββ button.tsx
β β β βββ form.tsx
β β β βββ input.tsx
β β β βββ select.tsx
β β β βββ skeleton.tsx
β β β βββ ...
β β βββ skeletons/ # Loading skeletons
β β β βββ ActivityHeatmapSkeleton.tsx
β β β βββ CompanionCardSkeleton.tsx
β β β βββ SessionHistorySkeleton.tsx
β β β βββ ...
β β βββ ActivityHeatmap.tsx # Heatmap visualization
β β βββ AnimatedMyJourney.tsx # Animated dashboard
β β βββ AnimationModal.tsx # Loading/success modals
β β βββ CompanionCard.tsx # Companion display card
β β βββ CompanionComponent.tsx # Voice session handler
β β βββ CompanionForm.tsx # Multi-step creation form
β β βββ CompanionList.tsx # List with filtering
β β βββ MonthlyCalendarGrid.tsx # Calendar view
β β βββ Navbar.tsx # Navigation bar
β β βββ SessionHistory.tsx # Session log with export
β β βββ StreakCounter.tsx # Gamification component
β β βββ TranscriptViewer.tsx # Session transcript display
β β βββ WeeklyBarChart.tsx # Bar chart visualization
β β βββ ...
β β
β βββ lib/ # Utility libraries
β β βββ actions/ # Server actions
β β β βββ companion.actions.ts # CRUD operations
β β βββ routes.ts # Route constants
β β βββ share.ts # Share functionality
β β βββ supabase.ts # Supabase client
β β βββ utils.ts # Utility functions
β β βββ vapi.sdk.ts # VAPI SDK wrapper
β β
β βββ types/ # TypeScript definitions
β β βββ companion.ts # Companion types
β β βββ index.d.ts # Global types
β β βββ navigation.ts # Navigation types
β β βββ vapi.d.ts # VAPI types
β β
β βββ hooks/ # Custom React hooks
β β βββ useAnimationModal.ts # Modal state management
β β βββ useBreadcrumbs.ts # Navigation breadcrumbs
β β
β βββ config/ # Configuration files
β β βββ config.ts # App configuration
β β βββ navigation.ts # Navigation config
β β
β βββ constants/ # App constants
β β βββ animations.ts # Lottie animation paths
β β βββ icons.ts # Icon mappings
β β βββ index.ts # General constants
β β βββ soundwaves.json # Soundwave animation
β β
β βββ middleware.ts # Auth & route middleware
β βββ instrumentation.ts # Sentry instrumentation
β
βββ public/ # Static assets
β βββ animations/ # Lottie JSON files
β β βββ neural-network.json
β β βββ no-data.json
β βββ icons/ # SVG icons
β β βββ bookmark.svg
β β βββ mic-on.svg
β β βββ mic-off.svg
β β βββ ...
β βββ images/ # Static images
β βββ logo.svg
β βββ cta.svg
β βββ limit.svg
β
βββ .env # Environment variables (gitignored)
βββ components.json # Shadcn UI config
βββ next.config.ts # Next.js configuration
βββ package.json # Dependencies
βββ postcss.config.mjs # PostCSS config
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript config
βββ sentry.server.config.ts # Sentry server config
βββ sentry.edge.config.ts # Sentry edge config
βββ README.md # The repository README
How it Works:
- User creates a companion with subject, topic, voice, and style
- Session starts via
CompanionComponent.tsxusing VAPI SDK - Real-time transcription captures conversation
- Timer tracks session duration (auto-saved)
- Transcript saved to Supabase on session end
- Activity data updates the heatmap and streak counter
Key Components:
CompanionComponent.tsx- Handles VAPI lifecycle, mic control, and statevapi.sdk.ts- VAPI client initialization and event handlerscompanion.actions.ts- Server actions for session CRUD operations
Voice Features:
- Microphone mute/unmute toggle
- Live speech-to-text transcription
- Soundwave visualization during speech
- Session duration tracking with live timer
- Automatic session history saving
Activity Heatmap:
- Weekly View - Bar chart with session counts
- Monthly View - Calendar grid with daily minutes
- Yearly View - GitHub-style contribution graph
- Export Functionality - Download as PNG/SVG
Streak Counter:
- Current streak tracking (consecutive days)
- Longest streak record
- "Active Today" indicator with fire emoji
- Last activity date display
- Real-time updates on session completion
Session History:
- Tabular view with companion name, subject, date, duration
- Export to CSV functionality
- Transcript viewer modal
- Sorting and filtering options
Multi-Step Form (CompanionForm.tsx):
- Name - Companion display name
- Subject - Select from 6 categories (Math, Science, Coding, etc.)
- Topic - What should the companion teach? (Textarea)
- Voice - Male or Female voice selection
- Style - Formal or Casual teaching approach
- Duration - Estimated session length (minutes)
Validation:
- Zod schema validation
- Real-time error messages
- Form state management via React Hook Form
- Loading animations during creation
- Success modal with auto-redirect
{ id: UUID // Primary key name: string // Companion name subject: string // Subject category (maths, science, etc.) topic: string // Learning topic description voice: string // Voice preference (male/female) style: string // Teaching style (formal/casual) duration: number // Estimated session duration (minutes) author: string // User ID (Clerk) created_at: timestamp // Creation date updated_at: timestamp // Last update date }
{ id: UUID // Primary key companion_id: UUID // Foreign key β companions.id user_id: string // User ID (Clerk) duration_minutes: number // Actual session duration transcript: text // Full conversation transcript created_at: timestamp // Session start time completed_at: timestamp // Session end time }
{ id: UUID // Primary key companion_id: UUID // Foreign key β companions.id user_id: string // User ID (Clerk) created_at: timestamp // Bookmark date UNIQUE(companion_id, user_id) // One bookmark per user/companion }
Science: #E5D0FF ( Purple ) Maths: #FFDA6E ( Yellow ) Language: #BDE7FF ( Blue ) Coding: #FFC8E4 ( Pink ) History: #FFECC8 ( Beige ) Economics: #C8FFDF ( Green )
- Backdrop Blur:
backdrop-blur-lg - Border:
border border-white/20 - Background:
bg-white/10 - Shadow:
shadow-[0_8px_32px_0_rgba(31,38,135,0.37)]
- Font Family: Geist
- Headings: Bold, 2xl-4xl sizes
- Body Text: Regular, sm-lg sizes
- Code: Monospace for session timers
- Framer Motion: Page transitions, accordions, hover effects
- Lottie: Loading spinners, success checkmarks, empty states
- Custom Soundwaves: Real-time visualization during voice sessions
- Server-Side Caching - React Cache API for database queries
- Dynamic Imports - Code splitting for Lottie and heavy components
- Skeleton Loading - Perceived performance with loading states
- Image Optimization - Next.js Image component with lazy loading
- Turbopack - 700x faster than Webpack for local development
// Page revalidation times export const revalidate = 180; // 3 minutes (companion detail pages) export const revalidate = 300; // 5 minutes (my-journey page)
- Clerk Authentication - OAuth 2.0 with Google, GitHub, email
- Row-Level Security (RLS) - Supabase policies for data access
- Input Validation - Zod schemas for all form inputs
- CSRF Protection - Next.js built-in protection
- Environment Variables - Secrets stored in
.env(gitignored) - Sentry Monitoring - Real-time error tracking and alerting
User Login β Clerk OAuth β JWT Token β Supabase Client β RLS Policies β Data Access
- Free Users: 3 companions limit, 10 sessions/month
- Pro Users: Unlimited companions, unlimited sessions
- Admin: (Future) Companion moderation and analytics
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/sentry-example-api |
Sentry test endpoint | β |
Note: Most data operations use Server Actions (.actions.ts) instead of API routes for type safety and better performance.
// Companion CRUD createCompanion(formData : CreateCompanion ): Promise<Companion> getAllCompanions(options : GetAllCompanions ): Promise<Companion[]> getCompanion(id : string ): Promise<Companion> // Session Management addToSessionHistory(companionId : string ): Promise<string> updateSessionDuration(companionId : string, duration : number ): Promise<void> saveSessionTranscript(sessionId : string, transcript : string ): Promise<void> getRecentSessions(limit : number ): Promise<Companion[]> getUserSessions(userId : string, limit : number ): Promise<Companion[]> // Analytics getHeatmapData(userId : string ): Promise<HeatmapValue[]> getWeeklyData(userId : string ): Promise<WeeklyData[]> getMonthlyData(userId : string ): Promise<MonthlyData[]> getUserStreakData(userId : string ): Promise<StreakData> // Bookmarks toggleBookmark(companionId : string, isBookmarked : boolean, path : string ) getBookmarkedCompanions(userId : string ): Promise<Companion[]>
-
Push to GitHub
git add . git commit -m "Initial commit" git push origin master
-
Connect to Vercel
- Go to Vercel Dashboard
- Import
IntelliCourse-Next.jsrepository - Configure environment variables (copy from
.env) - Deploy! π
-
Post-Deployment
- Update Clerk redirect URLs with production domain
- Update VAPI webhook URLs (if applicable)
- Configure Sentry DSN for production monitoring
# Development server with Turbopack npm run dev # Production build npm run build # Start production server npm run start
Contributions are welcome! Please follow these guidelines:
- Fork the repository π΄
- Create a feature branch (
git checkout -b feature/amazing-feature) π - Commit changes (
git commit -m 'feat: Add amazing feature') πΎ - Push to branch (
git push origin feature/amazing-feature) π - Open a Pull Request π
Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation updatestyle:Code style change (formatting)refactor:Code refactoringperf:Performance improvementtest:Adding testschore:Maintenance tasks
- Voice Session Stability: VAPI connection may drop on slow networks (~<1 Mbps)
- Safari Audio Issues: Microphone permissions require HTTPS in production
- Mobile Transcript View: Long transcripts may cause scroll performance issues
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js Team - For the incredible React framework π
- Vercel - For seamless hosting and deployment βοΈ
- VAPI - For cutting-edge voice AI technology ποΈ
- Supabase - For the powerful open-source Firebase alternative ποΈ
- Clerk - For hassle-free authentication π
- Tailwind Labs - For utility-first CSS framework π¨
- Framer - For smooth animation library π
- Sentry - For production monitoring and debugging π
- Open Source Community - For endless inspiration and support π
If you found this project helpful or learned something new, please consider:
- β Starring this repository
- π Reporting bugs via Issues
- π¬ Sharing feedback and suggestions
- π€ Contributing to the codebase