stefan.pauwels.ch
cuuks.com revived
cuuks.com is a 20 years-old project of mine and Jonas Frei (see also another one, sousvidecelsius.com) and has been slowly losing touch with progress, until it no longer worked with modern PHP requirements on various hosting providers.
## Cook like Cuuks!
cuuks.com is crowd-sourced food ingredient combination machine. You can combine ingredients while getting ingredient recommendations based on your and other users combinations. The recommendations are also based on tags.
## Bringing an old page to 2026
So Claude, what did we do to make cuuks.com work again?
> ### **The core problem: why it was dead**
>
> The app is a **~2009-era** codebase (SVN history predates 2010) and hadn’t run since early 2025. It was built on PHP’s original mysql_* functions, which PHP **removed in 7.0** — so on the host’s PHP 8.3, every database call was a fatal error. Login was also bolted onto an old **phpBB 3.0.5 forum** we wanted to drop, and other features it relied on (like __autoload) were gone too.
>
> The guiding decision: **“revive now, rebuild later”** — get it running on PHP 8.3 with minimal risk, _without touching the valuable combination-calc logic_.
>
> ### What we did
>
> 1. **Rescued and consolidated the data.** Imported the backups into **one** database (the old app used three: app, forum, and a “repository” DB). Modernized on the way in — MyISAM → InnoDB, utf8 → utf8mb4, dead tables dropped. Verified nothing was lost: **41,000 compositions, ~1.16M ingredient** **relationships, 701 real users** , all authors matched to accounts. Turns out the site was live until Jan 2025.
> 2. **Replaced the DB layer with PDO.** Rewrote the two files that funnel _all_ DB access to use **PDO** — but kept the exact same method signatures, so the combination calc (CIngredient.php, UserComposition.php) never had to change. For ~14 other files with stray mysql_* calls, a small **compatibility shim** re-implements the old functions on PDO instead of rewriting each one.
> 3. **Cut out phpBB, built native accounts.** Dropped the forum, kept phpbb_users as the identity store. Wrote a native auth layer that reads the old phpBB password hashes so **existing users still log in** — and silently upgrades each to **bcrypt** on next login. Added a native **password-reset flow** , login by email or username, and proper email validation.
> 4. **Fixed the PHP 8.3 breakages.** Swapped __autoload for spl_autoload_register; cleared warnings and deprecations; and fixed a nasty one — the old **BBCode parser broke under PHP 8 and was wiping user** **comments and bios**.
> 5. **Hardened security.** Closed **SQL-injection and XSS** holes and locked down the **avatar upload**.
> 6. **Modern dev + deploy setup.** Centralized **configuration** (CConfig), replacing the fragile server-path detection that broke on Hostpoint. Added a **Docker dev stack** (php:8.3-apache + MariaDB) mirroring production, plus a **GitHub Actions deploy** pipeline.
> 7. **Polish.** With the app alive, recent work is cosmetic: a warm-editorial **redesign** , five stylesheets consolidated into one, responsive/iOS fixes, and **Open Graph share cards**.
>
>
> ### **The through-line**
>
> The whole revival was **surgical around one asset** : the ingredient-combination calculator. Keeping PDO signatures identical, using a shim instead of a sweep, consolidating the DBs — all so that ~1.16M rows of relationship data and the algorithm on top **never had to be rewritten**. A **~15-year-old** PHP-5/phpBB app now runs on **PHP 8.3** with a modern DB layer, native auth, real config, Docker dev, and CI deploy — with zero data loss.
## The future
With cuuks.com not only back up and running but simplified and modernised it will be fun to work on more improvements in the future, maybe even some new features 🙂