RetroHub is a browser-based retro gaming platform built with PHP, MySQL, and vanilla HTML/CSS/JS. It lets players browse classic-console libraries, launch games directly in the browser, and gives admins a dashboard to manage consoles, ROMs, users, and inbound messages.
- 🚀 Landing & marketing pages (
index.html,about.html,support.html) with CTA to browse/login. - 🕹️ Authenticated game library (
library.php+library.html) that lists consoles/games from MySQL. ▶️ In-browser play view (play.php) that loads ROMs via JS emulator (js/nds-emulator.js) with touch controls for mobile.- 🔐 User auth (
login.php,config/user_auth.php) with session-based access control and redirect-after-login. - 🛠️ Admin panel (
admin/*) for dashboards, games/consoles/users CRUD, ROM/image upload, newsletters, and contact-message triage. - 🗄️ MySQL schema & seed data (
database.sql) with default consoles and an admin user.
| Step | Action |
|---|---|
| 1️⃣ | Install PHP 8+, MySQL 5.7+/8+, and a web server (Apache via XAMPP/LAMP/WAMP). |
| 2️⃣ | Create database: CREATE DATABASE retrohub; then import database.sql. |
| 3️⃣ | Configure DB creds in config/database.php (defaults: host localhost, db retrohub, user root, pass empty). |
| 4️⃣ | Place the repo in your web root (e.g., htdocs/RT) and ensure PHP can write to uploads/ and uploads/covers/. |
| 5️⃣ | Browse to http://localhost/RT/index.html (public site) or http://localhost/RT/login.php (user login). |
| 6️⃣ | Admin portal: http://localhost/RT/admin/ (default login admin / admin123 from database.sql — change immediately). |
RT/
├─ admin/ # Admin dashboard (games, consoles, users, uploads, messages)
├─ config/ # DB connection + auth helpers
├─ css/, js/ # Front-end styling and behavior
├─ images/, uploads/ # Assets and uploaded covers/ROMs
├─ *.html / *.php # Public pages (home, about, support, library, play)
└─ database.sql # Schema + seed data (consoles, default admin)
- User login → library → play:
login.phpsets session →library.php(requires login) fetches consoles/games →play.phploads ROM (roms/<file>) into the JS emulator with keyboard + touch controls. - Admin management:
admin/index.php(login) →dashboard.phpshows stats, top/recent games, unread messages → navigate to games/consoles/users CRUD, ROM/image uploads (upload.php,upload_image.php), newsletter, and settings. - Contact/newsletter: Public forms post to
process_contact.php/process_newsletter.php; admins read/respond inadmin/messages.phpandadmin/newsletter.php.
consoles— catalog of supported systems (name, short_code, release_year, metadata).games— title, console_id, rom file path, cover, metadata (genre, region, rating, play_count, featured flag).users— auth table withis_adminandlast_login.game_saves— user save data blobs (per game).- Seeded data: 6 sample consoles + default admin (
admin / admin123, hashed in SQL).
- Update DB credentials in
config/database.php. - Session helpers:
- Admin:
config/auth.php(isAdmin(),requireAdmin(),logout()). - User:
config/user_auth.php(isLoggedIn(),requireLogin(), redirect preservation).
- Admin:
- ROMs/Covers:
- Default ROM fetch path in
play.php:roms/<rom_file>; ensure files exist and are web-readable. - Uploaded covers/ROMs land under
uploads/anduploads/covers/(ensure write perms).
- Default ROM fetch path in
- Copy repo to
C:\xampp\htdocs\RT. - Start Apache + MySQL in XAMPP.
- Import
database.sqlinto MySQL (e.g., via phpMyAdmin ormysql -u root retrohub < database.sql). - Visit
http://localhost/RT/index.html.
- 🔑 Change the default admin password immediately after import.
- 🔒 Set a strong MySQL user/password and update
config/database.php. - 🧹 Validate ROM uploads and limit allowed types/sizes in
admin/upload.phpand related handlers. - 🛡️ Serve over HTTPS; set secure cookies and sane session lifetimes for production.
- 📜 Respect licensing: only host ROMs you are legally permitted to distribute/use.
- Blank page / DB errors: Check credentials in
config/database.php; confirm DB is running andretrohubexists. - 404 on ROM load: Verify files under
roms/(oruploads/) match thegames.file_path/rom_filefields. - Permission denied on upload: Grant webserver write access to
uploads/anduploads/covers/. - Stuck redirect to login: Session may be missing; ensure cookies are enabled and PHP sessions are writable.
- Cloud/object storage for ROMs and covers.
- Role-based permissions (moderators vs. admins).
- Better game search/filtering + ratings/reviews.
- Multi-console emulator support beyond NDS/PS2/PSP/SNES.
- Built for educational purposes; honors the preservation spirit of retro gaming.
- Front-end styling uses Bootstrap 5 + Font Awesome; animations via AOS.