How siddharthmnn/rewindfs works
rewindfs monitors files and captures timestamped snapshots, then exposes snapshot history, lookup, comparison, statistics, restore, and deleted-file recovery through a REST server. SQLite persists snapshot metadata and content; hashing supports deduplication. The README describes a dashboard and its statistics/file-listing views, though its JavaScript behavior was not sampled. The watcher-to-snapshot call and several server/storage calls are visible in source; other feature links reflect README documentation.
Main entry points: server.go HTTP server · snapshots.go Snapshot creation · snapshot.go Snapshot model · sqlite.go SQLite storage
Components 15
Capture and versioning
- Application startup
main.go - Filesystem watcher
internal/vfs/watcher.go - Snapshot creation
internal/api/snapshots.go - Content hashing
internal/storage/hash.go - Snapshot model
internal/models/snapshot.go
REST API
- HTTP server
internal/api/server.go - Snapshot lookup
internal/api/lookup_handlers.go - History queries
internal/api/history_handlers.go - Stats and files
internal/api/stats_handlers.go - Snapshot loading
internal/api/storage.go
Persistence and comparison
- SQLite storage
internal/storage/sqlite.go - Snapshot comparison
internal/diff/diff.go
Dashboard
- Web dashboard
frontend/index.html
Other components
- Monitored files
- API client
Connections 23
- Application startup → Filesystem watcher: starts
- Application startup → HTTP server: starts
- Monitored files → Filesystem watcher: file changes
- Filesystem watcher → Snapshot creation: creates snapshot
- Snapshot creation → Content hashing: hashes content
- Snapshot creation → SQLite storage: persists snapshot
- Snapshot creation → Snapshot model: builds
- HTTP server → SQLite storage: initializes
- HTTP server → Snapshot loading: loads snapshots
- Snapshot loading → SQLite storage: reads snapshots
- HTTP server → Snapshot creation: creates snapshot
- HTTP server → SQLite storage: deletes snapshot
- HTTP server → Snapshot comparison: compares content
- HTTP server → Monitored files: restores or recovers
- HTTP server → Snapshot lookup: registers routes
- HTTP server → History queries: registers routes
- HTTP server → Stats and files: registers routes
- API client → HTTP server: HTTP requests
- HTTP server → Web dashboard: serves page
- Web dashboard → HTTP server: requests dashboard data
- Snapshot lookup → Snapshot model: returns snapshots
- History queries → Snapshot model: reads snapshot history
- Stats and files → Snapshot model: summarizes snapshots