Skip to content

XfLabs/techspeak-studio

Repository files navigation

TechSpeak Studio

Practice technical communication by recording video answers with live captions, getting AI-powered coaching feedback, and optionally uploading to YouTube.

Features

  • Record — Camera + mic recording with a 3-2-1 countdown, visible timer, and device selector
  • Live Captions — Real-time transcription via Web Speech API (Chrome/Edge) with subtitle overlay
  • Transcript Export — Editable transcript with WebVTT and SRT download
  • AI Coaching — Scores for clarity, structure, tradeoffs, conciseness, and confidence; filler word count; follow-up cross-questions; rewritten answer in your tone
  • YouTube Upload — OAuth 2.0 integration with resumable upload, privacy controls, and caption track upload
  • Privacy-First — Video stays in your browser. Nothing is uploaded unless you choose to.

Practice Modes

Mode Description
Interview Technical interview answer practice
System Design System design discussion walkthrough
Bug Explanation Bug or incident explanation practice
Feature Walkthrough Feature demo or walkthrough practice

Tech Stack

  • Framework: Next.js 14+ (App Router, TypeScript)
  • Styling: Tailwind CSS
  • State: Zustand
  • Storage: IndexedDB (browser), SQLite (server, for OAuth tokens)
  • AI: OpenAI-compatible LLM abstraction (swappable providers)
  • YouTube: Google APIs (googleapis)
  • Testing: Jest + ts-jest

Quick Start

Prerequisites

  • Node.js 18+ and npm
  • A modern browser (Chrome or Edge recommended for live captions)

Setup

# Clone the repo
git clone https://github.com/your-username/techspeak-studio.git
cd techspeak-studio

# Install dependencies
npm install

# Copy environment template
cp .env.example .env.local

# Create database directory
mkdir -p db

# Start development server
npm run dev

Open http://localhost:3000.

Offline Mode (No API Keys Required)

The app works with LLM_PROVIDER=mock (the default in .env.example). This uses a built-in mock that returns plausible coaching feedback without calling any external API.

To enable real AI coaching, set LLM_PROVIDER=openai and provide your LLM_API_KEY.

Environment Variables

Variable Required Default Description
LLM_PROVIDER No mock openai or mock
LLM_BASE_URL No https://api.openai.com/v1 OpenAI-compatible endpoint
LLM_API_KEY For AI coaching API key for LLM provider
LLM_MODEL No gpt-4o-mini Model name
YOUTUBE_CLIENT_ID For YouTube Google Cloud OAuth client ID
YOUTUBE_CLIENT_SECRET For YouTube Google Cloud OAuth client secret
YOUTUBE_REDIRECT_URI No http://localhost:3000/api/youtube/auth/callback OAuth redirect URI
DB_PATH No ./db/techspeak.db SQLite database path

YouTube Setup

Creating Google Cloud OAuth Credentials

  1. Go to Google Cloud Console
  2. Create a new project (or select an existing one)
  3. Enable the YouTube Data API v3 in APIs & Services > Library
  4. Go to APIs & Services > Credentials
  5. Click Create Credentials > OAuth client ID
  6. Application type: Web application
  7. Add authorized redirect URI: http://localhost:3000/api/youtube/auth/callback
  8. Copy the Client ID and Client Secret to your .env.local

Required OAuth Scopes

  • https://www.googleapis.com/auth/youtube.upload — Upload videos
  • https://www.googleapis.com/auth/youtube.force-ssl — Upload captions

Unverified App Warning

During development, Google will show an "unverified app" warning when users authorize. This is normal for local development. To remove it for production:

  1. Go to APIs & Services > OAuth consent screen
  2. Submit your app for Google verification
  3. This requires a privacy policy URL and domain verification

Quota Notes

The YouTube Data API has a daily quota of 10,000 units (default):

Operation Quota Cost
videos.insert (upload) 1,600 units
captions.insert 400 units
videos.list 1 unit

With the default quota, you can upload approximately 6 videos per day. Request a quota increase in the Google Cloud Console if needed.

Scripts

npm run dev      # Start dev server
npm run build    # Production build
npm run start    # Start production server
npm test         # Run tests
npm run lint     # ESLint

Or use Make:

make setup       # First-time setup
make dev         # Development
make test        # Tests
make build       # Production build

Project Structure

techspeak-studio/
├── src/
│   ├── app/                    # Next.js App Router
│   │   ├── page.tsx            # Landing page
│   │   ├── practice/           # Record screen
│   │   ├── sessions/           # Session list + detail
│   │   └── api/                # API routes
│   │       ├── coach/          # POST /api/coach
│   │       └── youtube/        # YouTube auth, upload, captions
│   ├── components/             # React components
│   │   ├── Recorder.tsx        # Main recording component
│   │   ├── CaptionOverlay.tsx  # Live subtitle display
│   │   ├── TranscriptEditor.tsx
│   │   ├── CoachingReport.tsx
│   │   └── YouTubeUpload.tsx
│   ├── hooks/                  # Custom React hooks
│   │   ├── useMediaRecorder.ts
│   │   ├── useSpeechRecognition.ts
│   │   └── useIndexedDB.ts
│   ├── lib/                    # Core logic
│   │   ├── types.ts            # TypeScript types
│   │   ├── subtitles.ts        # VTT/SRT generation
│   │   ├── db.ts               # SQLite for OAuth tokens
│   │   └── llm/                # LLM provider abstraction
│   │       ├── provider.ts     # Interface + factory
│   │       ├── openai.ts       # OpenAI-compatible implementation
│   │       ├── mock.ts         # Offline mock
│   │       └── coaching-prompt.ts
│   └── store/                  # Zustand state
├── __tests__/                  # Jest tests
├── db/                         # SQLite database (gitignored)
├── .env.example
├── README.md
├── SECURITY.md
├── PRIVACY.md
├── Dockerfile
└── Makefile

Data Model

interface PracticeSession {
  id: string;
  mode: "interview" | "system-design" | "bug-explanation" | "feature-walkthrough";
  createdAt: string;
  promptContext: string;
  transcript: string;
  segments: CaptionSegment[];
  vtt: string;
  srt: string;
  metrics: CoachingMetrics | null;
  aiFeedback: CoachingFeedback | null;
  videoBlobRef: string;
  youtube: { videoId: string; privacyStatus: string; url: string } | null;
}

API Routes

Method Path Description
POST /api/coach Send transcript, get coaching feedback
POST /api/youtube/auth/start Get YouTube OAuth URL
GET /api/youtube/auth/callback OAuth callback (handles token exchange)
GET /api/youtube/auth/start Check YouTube connection status
POST /api/youtube/upload Upload video (multipart/form-data)
POST /api/youtube/captions Upload captions track (VTT)

Roadmap

MVP (v0.1) — Current

  • Camera + mic recording with MediaRecorder
  • Live captions via Web Speech API
  • WebVTT + SRT export
  • Editable transcript
  • AI coaching with mock + OpenAI providers
  • YouTube upload with OAuth 2.0
  • Keyboard shortcuts
  • IndexedDB storage
  • Privacy-first architecture

v1.1 — Planned

  • Burn subtitles into video (ffmpeg.wasm)
  • Whisper API fallback for better transcription
  • Session comparison (before/after coaching)
  • Export coaching report as PDF
  • Dark/light theme toggle

v2.0 — Future

  • Multi-language support
  • Team/org features (shared sessions)
  • Custom coaching rubrics
  • WebRTC-based mock interview with AI interviewer
  • Mobile-responsive recording

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes with tests
  4. Run npm test && npm run lint
  5. Submit a pull request

License

MIT

Acknowledgments

About

TechSpeak Studio: Your AI communication coach for technical conversations.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages