A comprehensive YouTube content filtering system for children with parental controls. Built with React, Node.js, PostgreSQL, and Redis.
- ๐ PIN-Based Authentication - Secure parent dashboard with bcrypt-hashed PIN
- ๐บ Channel Management - Approve specific YouTube channels for kids
- ๐ซ Keyword Blocking - Filter videos containing inappropriate keywords
- ๐ Watch History - Track videos watched with duration statistics
- ๐ Video Requests - Kids request videos, parents approve/reject
- ๐ My Requests - Kids see request status with visual feedback
- ๐ API Management - Manage multiple YouTube API keys with rotation
- โฑ๏ธ Watch Time Tracking - Monitor total, daily, and weekly viewing time
- ๐พ Redis Caching - 12-hour cache for improved performance
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AUTHENTICATION LAYER โ
โ PIN-based (4-6 digits) - No user accounts โ
โ - Stored as bcrypt hash in PostgreSQL โ
โ - Kids view: No auth needed โ
โ - Parent dashboard: Requires PIN โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API QUOTA MANAGEMENT โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Redis Cache โ โ Database API Keysโ โ
โ โ - 12hr TTL โ โ - Multiple keys โ โ
โ โ - Search resultsโ โ - Auto rotation โ โ
โ โ - Video metadataโ โ - Fallback to ENVโ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโผโโโโโโโโโ โโโโโโโโโโโผโโโโโโโโโโโ
โ Kids Interface โ โ Parent Dashboard โ
โ (No Auth) โ โ (PIN Required) โ
โ โ โ โ
โ - Search videos โ โ - Approve channels โ
โ - Watch videos โ โ - Manage keywords โ
โ - Request videos โ โ - View history โ
โ - View requests โ โ - Manage requests โ
โโโโโโโโโโโโโโโโโโโโ โ - Configure API โ
โ - Change PIN โ
โโโโโโโโโโโโโโโโโโโโโโ
- Node.js - Runtime environment
- Express - Web framework
- PostgreSQL - Primary database
- Redis - Caching layer
- bcrypt - Password hashing
- JWT - Authentication tokens
- YouTube Data API v3 - Video data
- React 18 - UI framework
- Material-UI - Component library
- React Router - Navigation
- Axios - HTTP client
- React Player - Video playback
- Node.js >= 20.0.0
- PostgreSQL >= 14
- Redis >= 6.0
- YouTube Data API Key (Get one here)
git clone https://github.com/YOUR_USERNAME/kidstube-filter.git
cd kidstube-filtercd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env with your configuration
nano .env# Create PostgreSQL database
sudo -u postgres psql << 'EOF'
CREATE DATABASE kidstube_filter;
CREATE USER kidstube_admin WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE kidstube_filter TO kidstube_admin;
\q
EOF
# Create tables
sudo -u postgres psql -d kidstube_filter << 'EOF'
CREATE TABLE app_config (
id SERIAL PRIMARY KEY,
pin_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE api_keys (
id SERIAL PRIMARY KEY,
key_value TEXT NOT NULL,
is_active BOOLEAN DEFAULT true,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE approved_channels (
id SERIAL PRIMARY KEY,
channel_id VARCHAR(255) UNIQUE NOT NULL,
channel_name VARCHAR(255),
approved_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE blocked_keywords (
id SERIAL PRIMARY KEY,
keyword VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE video_history (
id SERIAL PRIMARY KEY,
video_id VARCHAR(255) NOT NULL,
title VARCHAR(500),
channel_id VARCHAR(255),
watched_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
duration_seconds INTEGER DEFAULT 0
);
CREATE TABLE video_requests (
id SERIAL PRIMARY KEY,
video_url TEXT NOT NULL,
status VARCHAR(50) DEFAULT 'pending',
requested_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
reviewed_at TIMESTAMP
);
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO kidstube_admin;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO kidstube_admin;
EOF# Start Redis
sudo systemctl start redis-server
sudo systemctl enable redis-server
# Verify Redis is running
redis-cli ping
# Should return: PONGcd ../frontend
# Install dependencies
npm install- Go to Google Cloud Console
- Create a new project
- Enable YouTube Data API v3
- Create credentials โ API Key
- Add the key to
backend/.envfile
You need two terminal windows:
Terminal 1 - Backend:
cd backend
npm run devTerminal 2 - Frontend:
cd frontend
npm startThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Open http://localhost:3000
- Create a parent PIN (4-6 digits)
- Go to Parent Dashboard โ API Settings
- Add your YouTube API key
- (Optional) Approve some channels for kids
-
Initial Setup
- Set up a 4-6 digit PIN
- Add YouTube API keys in API Settings
-
Channel Management
- Search for channels to approve
- Only approved channels will show in kids' search
-
Keyword Blocking
- Add keywords to block (e.g., "scary", "violence")
- Videos with these keywords won't appear
-
Monitor Usage
- View watch history with timestamps
- See total hours watched (today/week/total)
-
Handle Requests
- Approve or reject video requests from kids
- Kids will see the status in "My Requests"
-
Search Videos
- Search for videos (filtered by approved channels)
- Click to watch
-
Request Videos
- Found a video you want? Request it!
- Check "My Requests" to see status
-
My Requests
- โณ Waiting - Pending parent approval
- โ Approved - Click to watch!
- โ Not Allowed - Rejected by parent
See .env.example files for all configuration options.
Key configurations:
PORT- Backend server port (default: 5000)DB_*- PostgreSQL connection settingsREDIS_*- Redis connection settingsYOUTUBE_API_KEYS- Comma-separated API keysJWT_SECRET- Secret for JWT tokensPIN_SALT_ROUNDS- bcrypt salt rounds (default: 10)
app_config # PIN storage
api_keys # YouTube API keys
approved_channels # Allowed channels
blocked_keywords # Filtered keywords
video_history # Watch history with duration
video_requests # Kids' video requests(Add screenshots here)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- YouTube Data API v3
- Material-UI for beautiful components
- React Player for video playback
- The open-source community
For issues, questions, or suggestions, please open an issue on GitHub.
- Never commit
.envfiles - Keep your YouTube API keys private
- Use strong PINs for parent access
- Regularly update dependencies
- Multi-user support
- Mobile app (React Native)
- Screen time limits
- Email notifications for parents
- Export watch history reports
- Support for multiple video platforms
Made with โค๏ธ for safer internet for kids