A YouTube-style video platform built with PHP and MySQL. It includes user accounts, channels, video watching with likes and threaded comments, subscriptions, search, a personalized subscription feed, and a live SQL query console for exploring the database directly from the browser.
- Accounts — sign up / sign in (
login.html+login.php), with server-side validation (username format, password length, unique username/email) - Feed — personalized homepage (
feed.html+feed.php) showing recent uploads from subscribed channels, with popularity badges (New / Trending / Popular) based on view count - Watch page — video playback, like/unlike, subscribe/unsubscribe, and threaded (nested) comments (
watch.php) - Channels — channel pages with owner info, subscriber actions, and a list of the channel's videos (
channel.html+channel.php) - Search — search across videos and channels with All / Videos / Channels filters (
search.html+search.php) - SQL console — a built-in query tool (
sql.html+sql.php) that runsSELECT/INSERT/UPDATE/DELETEstatements typed by the user against the live database and renders the results, with friendly error messages for common MySQL errors - Synthetic data generator —
generate_data.phpbuilds a large, realistic seed dataset from the included.txtword lists (names, bios, video titles, categories, etc.)
ER Diagram.pdf— entity-relationship diagram for the six-table schema (users, channels, videos, subscriptions, comments, likes) and how they relate.ActionFlow.pdf— flowchart of the full application flow, from initializing the database through login, navigation, watching/searching/commenting, and the SQL console.
Six tables, created and seeded by install.php:
| Table | Purpose |
|---|---|
USERS |
Accounts: credentials, profile info, bio |
CHANNELS |
One channel per owning user, with category and description |
VIDEOS |
Belongs to a channel; title, description, URL, duration, view/like counts |
SUBSCRIPTIONS |
Many-to-many: users subscribed to channels |
COMMENTS |
Comments on videos, with parent_comment_id for threaded replies |
LIKES |
Which users liked which videos |
All foreign keys cascade on delete (e.g. deleting a user removes their channel, videos, comments, likes, and subscriptions).
- PHP with the
mysqliextension - MySQL / MariaDB
- A local web server capable of running PHP (e.g. PHP's built-in server, Apache, or XAMPP/MAMP)
- Make sure MySQL is running locally, and that a
rootuser exists with passwordmysql— this is the hardcoded connection used throughout the project (localhost/root/mysql). Update the credentials in each.phpfile if your local setup differs. - (Optional) Regenerate the seed data:
This reads the
php generate_data.php
.txtfiles in the project folder and writes a freshseed.sql. Aseed.sqlis already included, so this step is only needed if you want different/regenerated sample data. - Initialize the database — this drops and recreates the
ece_duzgecdatabase, creates all six tables, and loadsseed.sql:Or visitphp install.php
install.phpin the browser via your local web server. - Serve the project and open
index.htmlas the entry point:Then visitphp -S localhost:8000
http://localhost:8000/index.html.
The generated dataset includes:
- 100 users, 50 channels, 200 videos
- 600 subscriptions, 250 comments, 100 likes (approximate — see
generate_data.phpfor exact record counts per table)
Generated user passwords follow a predictable pattern (uppercase letters of the first name + reversed 2-digit index + !) so you can log in as any seeded user — see generate_data.php for the exact scheme, or just sign up a fresh account via login.html.
.
├── ActionFlow.pdf # Application flowchart (see Documentation)
├── ER Diagram.pdf # Database entity-relationship diagram (see Documentation)
├── LICENSE
├── README.md
└── MiniTube/
├── index.html # Landing/entry page
├── login.html / .php # Sign in & sign up
├── feed.html / .php # Subscription feed / homepage
├── watch.php # Video watch page (likes, comments, subscribe)
├── channel.html / .php # Channel pages
├── search.html / .php # Search
├── sql.html / .php # In-browser SQL query console
├── install.php # Creates & seeds the database
├── generate_data.php # Builds seed.sql from the .txt data files
├── seed.sql # Pre-generated seed data
├── *.txt # Source word lists used by generate_data.php
└── *.jpg / *.avif / *.png # Static background images used by the pages
This project is licensed under the MIT License. See LICENSE for details.