🛡️ Admin & Server Settings

← User Settings
📥
Import my YouTube playlists
Pulls every playlist from the Google account you're signed in with — each becomes a hashtag. Then pick which to share.
→

API Keys & Configuration Required

To use the full functionality of YouTube Learning Library, you'll need to configure the following in your .env.local file.

0. YouTube OAuth 2.0 (Required for login)

Required for signing in and accessing your YouTube library. Use Google's OAuth Playground for quick testing.

Quick Setup with Google OAuth Playground:

  1. Go to Google OAuth Playground
  2. Click ⚙️ (gear icon, top right) and check "Use your own OAuth credentials"
  3. Search for "YouTube" and select: YouTube Data API v3
  4. Check the scope: https://www.googleapis.com/auth/youtube.readonly
  5. Click "Authorize APIs" → Sign in with your Google account → Grant permission
  6. Click "Exchange authorization code for tokens"
  7. Copy the Access Token and Refresh Token to .env.local:
GOOGLE_ACCESS_TOKEN=your_access_token_here GOOGLE_REFRESH_TOKEN=your_refresh_token_here NEXTAUTH_SECRET=generate_with_openssl

💡 Generate NEXTAUTH_SECRET with: openssl rand -base64 32

Alternatively, if you want to use the standard OAuth flow, you can create a Google Cloud project and use GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET instead.

Loading settings...

🤖 AI Model

Pick the provider and model used for AI features (e.g. auto topic classification). The key is encrypted at rest; leave it blank to use the matching environment variable.

Sync Database to Production (Staging)

Admin tool. Ingest playlists, tags, and custom videos locally on your development machine, then click the button below to push and sync the local SQLite database directly to the live server on c3p0.local and reload the staging service.

🎬 Bulk Playlist & Channel Importer

Admin tool. Crawl a YouTube channel's public playlists or submit a custom list of video/playlist URLs to seed the catalog.

— OR —

2. Anthropic Claude API (Optional - Phase 2)

For AI-powered transcript summarization and analysis.

Get your API key:

  1. Go to Anthropic Console
  2. Create an account or sign in
  3. Create an API key
  4. Copy the API key and add it to your .env.local:
ANTHROPIC_API_KEY=your_api_key_here

3. Local Setup (Optional)

For completely offline processing without external APIs.

Whisper (Local Speech-to-Text):

Install via Homebrew:

brew install whisper-cpp yt-dlp

Ollama (Local LLM):

Download from:

https://ollama.ai

Then pull a model:

ollama pull mistral

Configuration File

Edit .env.local in the project root to add your API keys. This file is gitignored and won't be committed to version control:

# YouTube Data API v3 YOUTUBE_API_KEY=your_youtube_api_key_here # Anthropic Claude API ANTHROPIC_API_KEY=your_anthropic_api_key_here # Database DATABASE_URL=file:./prisma/dev.db # Local Services (if running) WHISPER_ENABLED=false OLLAMA_ENABLED=false OLLAMA_BASE_URL=http://localhost:11434

Development Server

To run the development server with hot reload:

npm run dev

The server runs on:

http://localhost:3003

API Endpoints

  • POST /api/ingest - Ingest a YouTube video or playlist
    {
      "url": "https://youtube.com/watch?v=...",
      "playlistAsCategory": false
    }
  • POST /api/transcript - Extract or provide a transcript
    {
      "youtubeId": "dQw4w9WgXcQ",
      "manualTranscript": "..."
    }
  • GET /api/transcript - Retrieve a transcript
    /api/transcript?youtubeId=dQw4w9WgXcQ