GG.deals clone: CodeIgniter 4 + MongoDB game price tracker
- Full gg.deals-style UI: deal feed with filters, game pages with price history charts, rankings, vouchers, news, prepaids, subscriptions, bundles, franchises, wishlist, API docs - Real data crawlers: * gg:crawl (Steam Store API + GOG Catalog + Epic free games) * gg:catalog (252K game slugs from gg.deals sitemaps) * gg:ggdeals (per-game prices via FlareSolverr session, JSON-LD parsing) * gg:seed / gg:crawl-covers (demo seed + Steam CDN cover art) - 24/7 self-updating scheduler (scripts/scheduler_loop.php, lockfile-protected) - Tailwind v4 dark/light theme, Alpine.js, Chart.js
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Libraries\Mongo;
|
||||
use App\Models\GameModel;
|
||||
use App\Models\StoreModel;
|
||||
use CodeIgniter\Controller;
|
||||
|
||||
class Game extends Controller
|
||||
{
|
||||
public function show(string $slug): string
|
||||
{
|
||||
$model = new GameModel();
|
||||
|
||||
$game = $model->findBySlug($slug);
|
||||
if ($game === null) {
|
||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$deals = $model->dealsFor($slug);
|
||||
$history = $model->historyFor($slug);
|
||||
$similar = $model->similar($game, 8);
|
||||
$bundles = $model->bundlesFor($slug);
|
||||
$franchises = $model->franchisesFor($slug);
|
||||
$subscriptions = Mongo::collection('subscriptions')->find([], ['sort' => ['price' => 1]])->toArray();
|
||||
|
||||
$data = [
|
||||
'pageTitle' => $game['title'] . ' — best deals — GG.deals',
|
||||
'game' => $game,
|
||||
'deals' => $deals,
|
||||
'history' => $history,
|
||||
'stores' => (new StoreModel())->map(),
|
||||
'similar' => $similar,
|
||||
'bundles' => $bundles,
|
||||
'franchises' => $franchises,
|
||||
'subscriptions' => $subscriptions,
|
||||
];
|
||||
|
||||
return view('game', $data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user