A documentary streaming website inspired by Amazon Prime Video.
Built with PHP, MySQL, Bootstrap 5 β a complete BCA-level project.
documentaryhub/
βββ index.php β Homepage (hero, trending, new, popular)
βββ watch.php β Documentary detail + YouTube player
βββ search.php β Search + filter by category
βββ categories.php β Browse all categories
βββ login.php β User login
βββ register.php β User registration
βββ dashboard.php β User dashboard (history, watchlist, profile)
βββ logout.php β Logout
βββ ajax.php β AJAX: favorites & view tracking
βββ cron.php β YouTube auto-fetch cron script
βββ schema.sql β MySQL database schema + sample data
β
βββ includes/
β βββ config.php β DB config, helpers, session
β βββ header.php β Navbar + HTML head
β βββ footer.php β Footer + scripts
β βββ card.php β Reusable documentary card component
β
βββ assets/
β βββ css/style.css β Custom dark theme stylesheet
β βββ js/main.js β JavaScript (favorites, toast, lazy load)
β
βββ admin/
β βββ login.php β Admin login page
β βββ index.php β Admin dashboard with statistics
β βββ documentaries.php β List / search documentaries
β βββ add-documentary.php β Add new documentary
β βββ edit-documentary.phpβ Edit existing documentary
β βββ categories.php β Add / edit / delete categories
β βββ users.php β View / suspend / delete users
β βββ delete.php β Delete handler (docs, categories, users)
β βββ auth.php β Admin authentication guard
β βββ header.php β Admin layout header + sidebar
β βββ footer.php β Admin layout footer
β
βββ uploads/
βββ thumbnails/ β (optional) local thumbnail storage
- PHP 7.4+ (PHP 8.x recommended)
- MySQL 5.7+ or MariaDB 10.3+
- Apache/Nginx with mod_rewrite (for XAMPP/WAMP/Laragon)
- A web browser
Place the documentaryhub/ folder inside your web root:
- XAMPP:
C:/xampp/htdocs/documentaryhub/ - WAMP:
C:/wamp64/www/documentaryhub/ - Linux:
/var/www/html/documentaryhub/
- Open phpMyAdmin β
http://localhost/phpmyadmin - Click "New" β name it
documentaryhubβ Create - Click the database β Import tab
- Select
schema.sqlβ Click Go
Or via terminal:
mysql -u root -p -e "CREATE DATABASE documentaryhub;"
mysql -u root -p documentaryhub < schema.sqlOpen includes/config.php and update:
define('DB_HOST', 'localhost');
define('DB_NAME', 'documentaryhub');
define('DB_USER', 'root'); // β your MySQL username
define('DB_PASS', ''); // β your MySQL password
define('SITE_URL', 'http://localhost/documentaryhub');| URL | Description |
|---|---|
http://localhost/documentaryhub/ |
Homepage |
http://localhost/documentaryhub/login.php |
User Login |
http://localhost/documentaryhub/register.php |
Register |
http://localhost/documentaryhub/admin/ |
Admin Panel |
http://localhost/documentaryhub/admin/login.php |
Admin Login |
β οΈ Change these immediately in a real deployment!
| Field | Value |
|---|---|
admin@documentaryhub.com |
|
| Password | password |
| Field | Value |
|---|---|
john@example.com |
|
| Password | password |
- Go to Google Cloud Console
- Create a new project β Enable YouTube Data API v3
- Create credentials β API Key
- Paste it in
includes/config.php:define('YOUTUBE_API_KEY', 'AIza...');
php /var/www/html/documentaryhub/cron.phpcrontab -eAdd this line to run daily at 6 AM:
0 6 * * * php /var/www/html/documentaryhub/cron.php >> /var/log/dh_cron.log 2>&1
Channels monitored:
- DW Documentary
- Free Documentary
- BBC Earth
- National Geographic
- PBS
- Absolute History
| Table | Description |
|---|---|
users |
Registered users (id, username, email, password_hash, role) |
categories |
Documentary categories (id, name, slug, icon) |
documentaries |
All documentaries (id, title, youtube_video_id, views, ...) |
favorites |
User watchlist entries |
watch_history |
User watch events with progress |
- Amazon Prime Video-inspired dark UI (#0F171E)
- Hero carousel with featured documentaries
- Trending / New / Popular sections
- Horizontal scroll rows (Netflix-style)
- Responsive grid (mobile, tablet, desktop)
- Category browsing + filtering
- Full-text search with sort options
- YouTube iframe embed player
- Related documentaries sidebar
- Lazy-loaded thumbnails
- Dark mode by default
- Register / Login / Logout
- Watch history (auto-tracked after 5s)
- Continue watching with progress bar
- Favorites / Watchlist (AJAX toggle)
- User dashboard with tabs
- Profile editing
- Dashboard statistics (docs, users, views)
- Add / Edit / Delete documentaries
- YouTube thumbnail auto-preview
- Manage categories with icons
- User management (suspend / delete)
- Featured & Trending content management
- PDO with prepared statements
- password_hash() for passwords
- XSS protection (htmlspecialchars)
- Session-based authentication
- AJAX for favorite toggling
- YouTube auto-fetch cron script
This is a BCA/learning project, not production-ready. For real deployment:
- Change all default passwords
- Add CSRF tokens to all forms
- Use HTTPS
- Set proper file permissions (755 dirs, 644 files)
- Add rate limiting on login
- Move
includes/config.phpoutside web root - Restrict direct access to
includes/andadmin/
| Variable | Value | Usage |
|---|---|---|
--bg-primary |
#0F171E |
Page background |
--bg-secondary |
#1A242F |
Cards, panels |
--bg-tertiary |
#253345 |
Hover states |
--accent |
#00A8E1 |
Buttons, links, highlights |
--gold |
#F5A623 |
Ratings, featured badge |
| Layer | Technology |
|---|---|
| Frontend | HTML5, CSS3, Bootstrap 5.3, Bootstrap Icons |
| Fonts | Bebas Neue (headings), Inter (body) |
| Backend | PHP 8.x |
| Database | MySQL / MariaDB |
| ORM | PDO with prepared statements |
| Video | YouTube Data API v3 (iFrame embed) |
| Auth | PHP Sessions + password_hash |
Built as a BCA-level project. Not for commercial use.