An open-source, ultra-lightweight web application and CLI daemon designed to track and instantly rewind a corrupted or modified SQLite database file back to any previous state (e.g. 3 minutes ago) during local development β just like scrubbing a video.
πΉπ· TΓΌrkΓ§e DokΓΌmantasyon: TΓΌrkΓ§e rehber iΓ§in lΓΌtfen README.tr.md dosyasΔ±na bakΔ±n.
β
βStrictly for Local Development: This tool is designed to be a zero-dependency, plug-and-play visual scrubber for single-user debugging. It uses a raw POSIX file copy/rename mechanism to achieve instant “time travel” without requiring specific PHP extensions or complex .backup commands.
βBecause a local debugging environment does not experience concurrent writes, race conditions, or active traffic, this file-copy method is perfectly safe here.
βDo not use this tool or its file-copy logic in a production environment, especially if your SQLite database uses WAL (Write-Ahead Logging) mode, as copying live database files during active transactions will lead to data corruption.
π Features
- β‘ Zero Dependencies: Built with pure PHP 8+ and Vanilla JS. Requires no heavy frameworks or npm packages.
- π Full i18n / Multi-Language: Translation files are completely decoupled in
lang/. Switch languages dynamically from the UI (e.g., πΉπ· Turkish, π¬π§ English). Easily contribute by adding or updatinglang/xx.jsonfiles. - πΎ SQLite WAL Mode Aware: Seamlessly backs up and restores
.sqlite-waland.sqlite-shmfiles for databases runningPRAGMA journal_mode=WAL;. - π Visual Data & Table Diff Viewer: Compare row counts and table changes (
+3 rows in live) between any historic snapshot and your current live database before restoring. - π Snapshot Pinning & Tagging: Pin important snapshots with one click to protect them from auto-cleanup.
- π₯ One-Click Snapshot Export: Download any historic database state directly as a
.sqlitefile. - β¨οΈ Keyboard Navigation Shortcuts: Navigate through the timeline smoothly using Left Arrow (β¬ οΈ) and Right Arrow (β‘οΈ) keys.
- π Automatic Instant Snapshots (Watcher Daemon): Background CLI script (
watcher.php) listens for modifications indatabase.sqliteand automatically creates timestamped snapshots (backups/1715000000_database.sqlite). - π§Ή Automatic Cleanup: Maintains up to 50 backups, purging older unpinned snapshots to prevent disk clutter.
π Project Layout

time-travel/
βββ index.html # Chrono Console UI (Tailwind CSS + Vanilla JS + i18n Engine)
βββ api.php # Snapshot listing, restoration, diff, export, and i18n API
βββ watcher.php # CLI background listener daemon script (WAL & signal aware)
βββ lang.php # Multi-language (i18n) helper class
βββ lang/ # JSON language files directory
β βββ tr.json # Turkish language file
β βββ en.json # English language file
βββ database.sqlite # Target SQLite database file (created automatically)
βββ backups/ # Timestamped backups directory (created automatically)
βββ README.md # Primary English documentation
βββ README.tr.md # Turkish documentation & guide
π Translation Guide: Adding & Updating Language Files
1. Adding a New Language
Create a JSON file inside lang/ matching the ISO code (e.g., lang/es.json, lang/de.json):
{
"code": "es",
"name": "EspaΓ±ol",
"flag": "πͺπΈ",
"cli": { ... },
"api": { ... },
"ui": { ... }
}
2. Updating Existing Translations
Open any file in lang/*.json and edit strings. Changes reflect immediately on the Web UI and CLI without restarting the server.
π» Installation & Usage
1. Start the Watcher Daemon (Terminal 1)
To specify custom language or database file:
php watcher.php database.sqlite en
2. Start Local Web Server (Terminal 2)

3. Open Web Interface
Open your browser and navigate to: http://127.0.0.1:8000
π§ͺ How to Test
- Open the web interface.
- Click “βοΈ Add Test Data (DB Write)”.
- Observe terminal output from
watcher.php:
[+] Created snapshot: 1715000000_database.sqlite - Drag the timeline slider or use β¬ οΈ / β‘οΈ arrow keys.
- Click “π Compare Diff” to inspect table row changes.
- Click “β‘ Restore To This State” to rewind your database!
π File Permissions (Linux / Unix)
Make sure you are inside the tool’s directory, then run:
(Note: This grants the necessary read/write permissions for both your CLI and Web Server to manage the SQLite and backup files locally without friction.)
π License
This project is open-source under the MIT license.







