git clone https://github.com/codybmenefee/rabbit npm run dev npm run build # Build for production
Minimal YouTube analytics dashboard built with Next.js.
npm install
npm run devOpen http://localhost:4000.
app/,components/,lib/,public/– core appconvex/– backend queries/schema (optional)meta/– documentation, guides, tests
For detailed docs, see the files under meta/.
- Navigate to
/uploadto access the secure upload workflow. - Drag and drop or browse for your Google Takeout
watch-history.htmlfile. - Set
BLOB_READ_WRITE_TOKENin.env.localso the API route can authenticate with Vercel Blob Storage. - We store the file in Vercel Blob storage and return the blob URL, path, timestamp, and size.
Blob access defaults to private. The ingestion pipeline automatically processes uploaded files, extracting:
- Video Details: Title, YouTube ID, full URL
- Channel Info: Title, URL, and stable channel ID (when available from
/channel/links) - Timestamps: Watched-at times parsed to ISO 8601 UTC, handling common timezone abbreviations (CDT, PST, etc.)
- Raw Data: Original HTML snippets preserved for auditability
Files are processed asynchronously by a Convex cron job, upserting videos, channels, and watch events with proper uniqueness constraints.
- Background jobs (Convex): Use
internalQuery/internalMutationfor cron/processing. Call them throughinternal.*from actions. Keep user-facing mutations (uploads.create,watch_events.create) authenticated. - Manual processing: Use
processing:processPendingUploadsto process queued uploads andprocessing:resetFailedUploadsto requeue failures. - Parser robustness: Normalize NBSP (U+00A0), handle "Watched at …" + date combos, map timezone abbreviations (CDT/PDT/etc.), and preserve the original timestamp string in
raw. - Data fidelity: Always pass through
videoUrl/channelUrland store source fields inrawto allow schema evolution without data loss. - Servers: Run
npx convex devandnpm run dev. If new Convex functions don’t appear, restart or run with--push. - Tests: Add small HTML fixtures to
test/fixtures/and unit tests underlib/__tests__/. Validate timezone parsing and NBSP handling.