Adam Bandel


YTDB - YouTube Database

Aug 2024
Type: web-app
Code: 12k lines
Files: 131
Active: Aug 2024 — Aug 2024
Stack:
JavaScriptReactNode.jsExpressMongoDBYouTube Data API
Tags:
datadeveloper-toolsautomation

Overview

YTDB (YouTube Database) is a full-stack web application that transforms how users discover and evaluate YouTube content. Instead of relying solely on YouTube’s algorithm-driven recommendations, YTDB provides a community-curated database where users can rate, review, and organize videos by categories and tags.

The platform features a trust-weighted rating system that gives more influence to established contributors, ensuring that video ratings reflect the opinions of engaged community members rather than drive-by ratings.

Screenshots

Homepage

Video Page

Search Interface

Problem

YouTube’s native search and recommendation systems prioritize engagement metrics (watch time, clicks) over content quality. Users seeking high-quality educational content, tutorials, or niche topics often struggle to filter through low-quality or clickbait videos. Additionally, YouTube’s rating system (likes/dislikes) provides limited granularity and no weighted credibility.

YTDB addresses this by creating a parallel curation layer where:

Approach

Stack

Challenges

// Trust-weighted rating calculation
for (const review of reviews) {
  const weight = review.userId.trustScore;
  weightedSum += review.rating * weight;
  weightSum += weight;
}
const weightedRating = weightSum > 0 ? weightedSum / weightSum : 0;

Outcomes

The application successfully demonstrates a production-ready content curation platform with:

Key learnings included the complexity of building fair reputation systems, the importance of database indexing for video discovery queries, and effective patterns for optional authentication middleware.

Implementation Notes

Database Schema Design

The schema uses MongoDB’s document model with strategic denormalization:

// Video model with comprehensive metadata
const videoSchema = new mongoose.Schema({
  youtubeId: { type: String, required: true, unique: true },
  weightedRating: { type: Number, default: 0 },
  trendingScore: { type: Number, default: 0 },
  viewCountGrowth24h: { type: Number, default: 0 },
  // Compound indexes for common queries
});
videoSchema.index({ category: 1, weightedRating: -1 });
videoSchema.index({ tags: 1, publishedAt: -1 });

Trust Score System

The trust scoring uses weighted actions to reward quality contributions:

Action Weight
Add Video +3
Submit Review Text +2
Receive Review Like +0.5
Account Age (per day) +0.05
Delete Own Review -2

API Architecture

Routes are modularized with consistent patterns:

View on GitHub →


Related Posts