Skip to content

nandcello/radstream

Repository files navigation

Radstream

Full-stack Bun + React app with a YouTube OAuth flow and minimal APIs.

Prerequisites

  • Bun 1.2+
  • A Google Cloud project with OAuth consent screen configured

Google OAuth setup

  1. Go to Google Cloud Console → APIs & Services → Credentials → Create Credentials → OAuth client ID
  2. Choose Web application
  3. Authorized redirect URI: http://localhost:3000/api/oauth/google/callback (or your host)
  4. Copy Client ID and Client Secret
  5. Enable YouTube Data API v3 in APIs & Services → Library

Environment variables

Bun loads .env automatically. Create a .env file in the repo root with:

GOOGLE_OAUTH_CLIENT_ID=your_client_id
GOOGLE_OAUTH_CLIENT_SECRET=your_client_secret
# Optional: override when not using localhost:3000
# GOOGLE_OAUTH_REDIRECT_URI=http://localhost:3000/api/oauth/google/callback

# Where to store the token JSON (optional)
# YT_TOKEN_PATH=.yt-oauth-token.json

Install & run

bun install
bun dev

App will be at http://localhost:3000

Using the YouTube flow

  1. Open the app in your browser
  2. Click "Connect YouTube" → complete Google consent
  3. Back on the app, click "Get Stream Key" to fetch (and create if needed) a reusable stream key

Livestream data fetching (client-side)

Previously, livestream status and stream key were proxied through server routes under /api/livestream/*. These proxy endpoints have been removed. The client now calls the YouTube Data API directly using the authenticated access token via React Query hooks:

  • useLivestreamStreamKey – retrieves the current stream key (cdn.ingestionInfo.streamName)
  • useLivestreamStatus – polls the livestream status and normalizes it (e.g. activestreaming)

See src/hooks/useLivestream.tsx for implementation. This mirrors the existing useBroadcast pattern and reduces server surface area.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published