🚧 Work in Progress
rewindfs is a Git-inspired virtual filesystem project focused on snapshot-based file versioning, rollback, recovery, history tracking, deduplication, and persistent storage.
The project explores how modern version-control systems and snapshot-oriented filesystems manage historical file state through automatic snapshot creation, content hashing, recovery workflows, REST APIs, and persistent metadata storage.
- Track file changes over time
- Create snapshots automatically
- Persist snapshots across application restarts
- Restore previous versions of files
- Recover deleted files
- Compare changes between snapshots
- Reduce duplicate storage using content hashing
- Explore filesystem and storage design concepts
- Build maintainable backend architecture
- Implement automated testing and CI/CD
- Build a web dashboard for snapshot visualization
- Repository setup
- Filesystem watcher
- Automatic snapshot generation
- Snapshot persistence
- Migration from JSON storage to SQLite
- SQLite database initialization
- Snapshot timestamps
- Snapshot lookup API
- Snapshot restore API
- Snapshot delete API
- Snapshot statistics API
- Deleted file recovery API
- Latest snapshot lookup API
- Oldest snapshot lookup API
- File history API
- Full snapshot history API
- Snapshot count API
- File existence API
- Snapshot comparison API
- SHA256 content hashing
- Duplicate snapshot prevention
- Automated unit tests
- GitHub Actions CI pipeline
- API route modularization
- SQLite persistence tests
- Frontend dashboard
- Dashboard statistics panel
- Dashboard file listing
- Snapshot history dashboard
- Snapshot restore dashboard actions
- Snapshot delete dashboard actions
- Metadata indexing
- CLI interface
- Recovery testing
- Folder rollback
- Snapshot search
- Multi-directory monitoring
- Automatic file monitoring using fsnotify
- Snapshot creation on file modification
- Persistent snapshot storage using SQLite
- Timestamped snapshots
- Snapshot listing
- Snapshot lookup by ID
- Latest snapshot retrieval
- Oldest snapshot retrieval
- Snapshot deletion
- Snapshot counting per file
- File existence checks
- File history tracking
- Restore a file from a specific snapshot
- Recover deleted files using the latest snapshot
- File rollback infrastructure
- Compare two snapshots
- View snapshot history metadata
- View complete snapshot history
- Track historical versions of files
- Retrieve first and latest snapshot IDs
- SHA256 content hashing
- Hash-based snapshot identification
- Duplicate snapshot prevention
- Unique hash statistics
- Content-based deduplication
- SQLite indexes for faster lookup
- Unit tests for hashing
- Unit tests for snapshot management
- Unit tests for deduplication
- Unit tests for diff functionality
- Unit tests for SQLite persistence
- GitHub Actions automated test execution
- Automated validation on every push
- Route modularization
- Dedicated stats handler module
- Dedicated history handler module
- Dedicated lookup handler module
- Reduced server.go complexity
- Incremental backend refactoring
- RESTful API organization
- Statistics dashboard
- Total snapshot count
- Tracked file count
- Unique hash count
- File listing panel
- Automatic data refresh
GET /GET /healthGET /stats
GET /snapshotsGET /snapshot/:idGET /snapshot-count/:fileGET /snapshots/file/:namePOST /snapshotDELETE /snapshot/:id
GET /latest/:fileGET /snapshot-oldest/:fileGET /history/:fileGET /history-full/:fileGET /snapshot-latest-id/:fileGET /snapshot-first-id/:file
POST /restore/:idPOST /recover/:file
GET /filesGET /files/:name/existsGET /diff/:id1/:id2
Snapshots are stored in SQLite instead of JSON files.
CREATE TABLE snapshots (
id INTEGER PRIMARY KEY AUTOINCREMENT,
file TEXT NOT NULL,
content TEXT NOT NULL,
hash TEXT NOT NULL,
created_at DATETIME NOT NULL
);CREATE INDEX idx_snapshots_file
ON snapshots(file);
CREATE INDEX idx_snapshots_hash
ON snapshots(hash);- id
- file
- content
- hash
- created_at
curl -X POST http://localhost:8080/snapshot \
-H "Content-Type: application/json" \
-d '{
"file":"test.txt",
"content":"hello world"
}'curl http://localhost:8080/snapshotscurl -X POST http://localhost:8080/restore/1curl -X POST http://localhost:8080/recover/test.txtrewindfs/
├── frontend/
│ └── index.html
├── internal/
│ ├── api/
│ │ ├── server.go
│ │ ├── history_handlers.go
│ │ ├── lookup_handlers.go
│ │ ├── snapshots.go
│ │ └── stats_handlers.go
│ ├── diff/
│ ├── models/
│ ├── storage/
│ │ ├── sqlite.go
│ │ ├── sqlite_test.go
│ │ ├── hash.go
│ │ └── hash_test.go
│ └── vfs/
│ └── watcher.go
├── rewindfs.db
├── main.go
├── go.mod
├── go.sum
└── README.md
- Snapshot history dashboard
- Snapshot restore buttons
- Snapshot delete buttons
- Metadata indexing
- Command-line interface
- Folder rollback
- Recovery logging
- Storage optimization metrics
- Snapshot export/import
- Snapshot search
- Multi-directory monitoring
This project is being built to gain practical experience with:
- Filesystem architecture
- Version control concepts
- Snapshot-based storage systems
- Database-backed persistence
- Recovery and rollback mechanisms
- Metadata management
- Content hashing
- Deduplication techniques
- Backend API development
- REST API design
- Automated testing
- CI/CD workflows
- Systems programming in Go
- Go
- Gin
- SQLite
- fsnotify
- SHA256
- REST APIs
- HTML
- CSS
- JavaScript
- GitHub Actions
- Linux
- File I/O
- Git
Currently under active development.
- Automatic snapshot watcher integration
- SHA256 hashing implementation
- Duplicate snapshot prevention
- Snapshot comparison API
- Recovery and restore functionality
- Automated test suite
- GitHub Actions CI pipeline
- API route modularization
- Server architecture cleanup
- Migration from JSON storage to SQLite
- SQLite persistence testing
- Dashboard statistics and file listing
- Snapshot management APIs
- Recovery APIs
- Statistics endpoints
- History and lookup endpoints
- Snapshot comparison APIs
- Deduplication implementation
- SQLite integration
- SQLite persistence testing
- Frontend dashboard
- Automated testing
- GitHub Actions integration
- API refactoring and modularization
- Snapshot engine
- Filesystem watcher
- Core snapshot infrastructure
- Persistence architecture
- Storage design
- Hashing integration
- Snapshot automation
- File monitoring workflows