Every change has a sound. EchoDB is a polished PHP 8.3 demo that turns database mutations into living visuals, stats, and audio. It shows how a lightweight stack can deliver Change Data Capture (CDC) vibes with Server-Sent Events, tasteful UX, and clean architecture.
🛠️ Built with pure PHP, PDO, Monolog, and Dotenv — no heavy frameworks, no bundlers.
                   ┌────────┐     insert/update/delete     ┌──────────┐
Browser UI ◀───────┤ stream │◀─────────────────────────────┤ EventStore│
   ▲   ▲           └────────┘                               └─────┬────┘
   │   │                   ▲                                       │
   │   └──── AJAX / REST ──┘                                       │
   │                                                               │
Visualizer · Timeline · Sound                                 ┌────▼─────┐
   │                                                         │ Database │
   └───────────── Server-Sent Events pulses ─────────────────┤  (MySQL) │
                                                             └──────────┘
composer install
cp config/.env.example .env
# edit DB credentials & APP_URL
mysql -u <user> -p -e "CREATE DATABASE echodb DEFAULT CHARACTER SET utf8mb4;"
mysql -u <user> -p echodb < sql/init.sql
php -S localhost:8080 -t public
http://localhost:8080 and start crafting database ripples.Base URL: /api
| Method | Endpoint | Description | 
|---|---|---|
| GET | /api/index | 
      Health info + app version. | 
| GET | /api/events | 
      List recent events (limit, after_id). | 
    
| POST | /api/events | 
      Emulate mutation + emit CDC event. | 
| GET | /api/stream | 
      Server-Sent Events (Last-Event-ID aware). | 
| GET | /api/stats | 
      Counts per type/table + events per min. | 
Sample mutation
curl -X POST \
     -H "Content-Type: application/json" \
     -d '{"table":"orders","row_id":1,"type":"update","changes":{"status":"shipped"},"actor":"demo"}' \
     http://localhost:8080/api/events
SSE stream from the terminal:
curl -N http://localhost:8080/api/stream
users  (id, name, email)
orders (id, user_id, status ENUM, amount DECIMAL, updated_at TIMESTAMP)
events (id BIGINT, type ENUM, table_name, row_id, diff JSON, actor, created_at)
Example events.diff snapshot:
{
  "status": {"old": "pending", "new": "shipped"},
  "amount": {"old": 24.9, "new": 24.9}
}
phpcs with PSR-12 rules (phpcs.xml).phpstan level 6 (phpstan.neon).logs/app.log (auto-created)./tmp.public/.htaccess rewrite.server {
    listen 80;
    server_name example.com;
    root /var/www/echodb/public;
    location / {
        try_files $uri /index.php$is_args$args;
    }
    location /api/ {
        try_files $uri /api/index.php$is_args$args;
    }
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}
logs/ for Monolog.public/assets/ contains the logo. Add your own GIFs/screenshots showcasing the animations.See tests/smoke.md for curl snippets and manual verification steps.
Released under the MIT License. See LICENSE.