RustySync is a simple yet powerful file synchronisation tool written in Rust. It monitors a local folder and synchronises changes to a remote server like a lightweight Dropbox clone. Built to demonstrate efficient file I/O, concurrency, and network communication in Rust.
clap>= 4.5.32 (with derive features)notify>= 8.0.0blake3>= 1.6.1actix-web>= 4.10.2 (with rustls-0_23 features)actix-web-httpauth>= 0.8.2actix-multipart>= 0.7.2serde>= 1.0.219 (with derive features)serde_json>= 1.0.140tokio>= 1.45.1 (with macros, rt-multi-thread, fs features)rusqlite>= 0.36.0 (with bundled features)chrono>= 0.4.41 (with serde features)futures-util>= 0.3.31walkdir>= 2.5.0sanitize-filename>= 0.6.0jsonwebtoken>= 9.3.1argon2>= 0.5.3rustls>= 0.23.28rustls-pemfile>= 2.2.0dotenv>= 0.15.0directories-next>= 2.0.0reqwest>= 0.12.20 (with json, multipart, stream features)async-std>= 1.13.1
- Clone this repository
- Run
cargo build(orcargo build --releaseif you want release build)
.\target\[build variant]\RustySync.exe client [options]
set-url --url [url]: Sets the current API url to send requests too
login --username [username] --password [password]: Login to the server
register --username [username] --password [password]: Register an account with server
start --path [path]: Start the file watcher
To start the file watcher, you need to have set the API url as well as have logged in to the server to get an access token
.\target\[build variant]\RustySync.exe server --port [port]
JWT_SECRET = "VERY_STRONG_SECRET_HERE"
You can also run the server using HTTPS. This can be done by creating a certs folder that has the cert.pem and key.pem. You can use a tool like mkcert to create these files
-
File Watcher
- Watch a directory for file changes using
notify - Detect
create,modify, andremoveevents
- Watch a directory for file changes using
-
File Hashing
- Use
blake3to fingerprint file contents - Store hashes to detect if files are modified
- Use
-
Metadata Management
- Store file paths, hashes, and timestamps in SQLite via
rusqlite - Serialize metadata as JSON using
serde_json
- Store file paths, hashes, and timestamps in SQLite via
-
Startup Sync
- Sync new files at startup using
walkdir - Check hash and last modified time of existing files and update in DB
- Sync new files at startup using
-
HTTP Server (Actix-Web)
- Build a RESTful API to receive file uploads and metadata
- Save received files and update server-side SQLite metadata
- Securely authenticate users who wish to interact with the server
-
Sync Client
- Send file updates to the server when changes are detected
-
CLI Interface
- Use
clapto build a user-friendly CLI - Support flags like
--sync,--watch,--server, etc.
- Use
-
Cross-platform Support
- Test on Linux, macOS, and Windows
-
Build MVP releases
- For Linux, macOS, and Windows
- Sync client: Retry on failure, parallelize uploads if possible (future consideration)
- Web server: Track historical versions of files
- Sync server with client: Server listens for file changes on uploads and client requests new files/modifications if any