A voice-first AI tutoring platform that lets you learn from your study materials through conversational sessions with an AI tutor — taught in the style of your favorite celebrity or persona.
Upload your notes, pick a persona like Taylor Swift or Morgan Freeman, and start a hands-free voice conversation where the AI teaches you from your own materials.
- Celebrity Persona Tutoring — Choose any celebrity or character, and the AI teaches in their unique style, personality, and catchphrases
- Voice-First Learning — Fully hands-free: speak to the tutor and listen to responses with natural text-to-speech
- Document Upload — Upload PDFs, DOCX, TXT, or Markdown files, or paste text directly
- AI-Generated Study Tools — Auto-generated flashcards, quizzes, and key facts from your materials
- Source-Grounded Responses — AI references your actual materials to prevent hallucination
- Smart Content Retrieval — Keyword-based chunk scoring to find the most relevant sections for each question
| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| AI | OpenAI GPT-4o |
| TTS | MiniMax Speech API (persona voices) + Web Speech API (fallback) |
| STT | Web Speech API (browser-native) |
| Doc Parsing | pdf-parse, mammoth |
| Icons | Lucide React |
- Node.js 18+
- npm or yarn
- API keys for OpenAI and MiniMax (optional for TTS)
git clone https://github.com/Akshobhya-codes/StudyOnce.git
cd StudyOnce
npm installCreate a .env.local file in the root directory:
OPENAI_API_KEY=your_openai_api_key
MINIMAX_API_KEY=your_minimax_api_key # Optional — enables persona-specific voices
ELEVENLABS_API_KEY=your_elevenlabs_api_key # Optional — fallback TTS
ELEVENLABS_VOICE_ID=your_voice_id # Optional — fallback TTS voicenpm run devOpen http://localhost:3000 in your browser.
- Select a Persona — Pick a celebrity tutor (Taylor Swift, Morgan Freeman, Gordon Ramsay, Bob Ross, etc.)
- Add Study Materials — Upload files or paste text. The app chunks and extracts key facts, topics, and a summary automatically.
- Start a Voice Session — The AI greets you in the persona's style and lists topics from your material
- Learn by Conversation — Speak naturally; the AI responds with persona-styled explanations grounded in your documents
- Use Study Tools — Generate flashcards, take quizzes, or review key facts in the Studio panel
User speaks → Web Speech API (STT)
→ /api/chat (GPT-4o with persona prompt + relevant chunks)
→ /api/tts (MiniMax persona voice)
→ Audio playback with waveform visualization
→ Auto-restart listening
| Route | Purpose |
|---|---|
POST /api/chat |
Conversational tutoring with persona and source context |
POST /api/extract |
Extract summary, topics, and key facts from materials |
POST /api/flashcards |
Generate flashcards from document chunks |
POST /api/quiz |
Generate multiple-choice quiz questions |
POST /api/tts |
Text-to-speech with persona-mapped voices |
POST /api/upload |
Parse uploaded documents (PDF, DOCX, TXT, MD) |
src/
├── app/
│ ├── api/ # Serverless API routes
│ ├── page.tsx # Main app — persona selection + 3-panel layout
│ └── layout.tsx # Root layout
├── components/
│ ├── VoiceTutor.tsx # Core voice interaction with animated visualizer
│ ├── SourcesPanel.tsx # Left panel — material management + transcript
│ ├── StudioPanel.tsx # Right panel — flashcards, quiz, key facts
│ ├── PersonaSelector.tsx # Celebrity/persona input
│ ├── DocumentUpload.tsx # File upload with drag-and-drop
│ └── ...
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
└── types/ # TypeScript type definitions
MIT