# BeyondHere PHP demo

This version uses PHP 8.2+, PDO sessions, and a relational SQL database. SQLite is the zero-configuration local default; a MySQL-compatible schema is included for conventional hosting.

## Test locally with the installed XAMPP PHP

1. Seed or refresh the demo data:
   `C:\xampp\php\php.exe scripts\seed-demo.php`
2. Start the site:
   `C:\xampp\php\php.exe -S 127.0.0.1:8787 -t public public\router.php`
3. Open `http://127.0.0.1:8787/login`.
4. Credentials are stored locally in `storage/demo-credentials.json`, which is excluded from Git.

Run the seed command with `--reset-passwords` only when you intentionally want all eight passwords replaced.

## MySQL hosting

1. Create an empty database and set `DATABASE_DSN` to a PDO DSN such as `mysql:host=127.0.0.1;dbname=beyondhere;charset=utf8mb4`.
2. Set `DATABASE_USER` and `DATABASE_PASSWORD`.
3. Run `php scripts/seed-demo.php` once from the project directory.
4. Configure the web root as `public/`; Apache rewriting is included in `public/.htaccess`.

The dashboard never accepts a user ID from the browser. It uses the authenticated PHP session and parameterized SQL queries to load only the signed-in user's records.
