Rust File Backend (RFB) is a high-performance, enterprise-grade file management system combining the memory safety and speed of Rust with a modern React frontend. Built for cost-efficiency through content-addressable storage (deduplication) and scalability via parallel multipart uploads.
- Built on Axum web framework and Tokio async runtime
- Handles thousands of concurrent requests with minimal overhead
- 10Γ less memory usage compared to Node.js/Python equivalents
- SHA-256 Content Hashing eliminates duplicate storage
- Instant "uploads" for previously stored content
- Drastically reduced storage costs across all users
- ClamAV Integration: Real-time virus scanning
- Magic Byte Verification: File type validation beyond extensions
- Path Traversal Protection: Aggressive filename sanitization
- JWT Authentication: Secure token-based access control
- CAPTCHA Registration: Bot-resistant account creation
- S3-Compatible Storage: Encrypted transport layer
- Custom chunked upload engine with parallel workers
- Exponential backoff retry mechanism
- Multi-GB file support on unstable connections
- Configurable chunk sizes (default: 10MB)
- Public Share Links: Time-limited, token-based sharing with unique URLs
- Password Protection: Argon2-hashed passwords for sensitive shares
- Granular Permissions:
view(inline preview) ordownload(attachment) modes - Folder Sharing: Share entire folders with browsable file listings
- Access Logging: Track views, downloads, and password attempts with IP/User-Agent
- Public Share Page: Beautiful, responsive frontend for recipients
- Media Preview: Inline image, video, audio, and PDF preview on shared links
- WebP Format: Optimized thumbnails (256px) for minimal bandwidth
- Multi-Format Support: Images, PDFs (via
pdftocairo), and Videos (viaffmpeg) - Encrypted File Detection: Skips password-protected PDFs gracefully
- Dedicated Worker: Separate
thumbnail-workerprocess for asynchronous generation - Lazy Loading: Frontend loads thumbnails asynchronously with smooth animations
- Copy/Paste: Recursive folder duplication with deduplication
- Bulk Actions: Move, delete, and copy multiple items
- Archive Preview: Inspect ZIP, 7z, RAR, TAR without extraction
- Download Tickets: Time-limited shareable links
- PDF Preview: Inline document viewing
- Favorites: Star/unstar files and folders for quick access
- Share Links: Public or user-specific sharing with configurable permissions
- Password Protection: Argon2id-hashed passwords for secure access
- Expiration Control: Configurable expiry up to 1 year
- View/Download Modes: Inline display or attachment download
- Access Logging: Track views, downloads, and password attempts
- Public Share Page: Standalone viewer with media preview
- Full-Text Search: Real-time filename search with debouncing
- Fuzzy/Similarity Search: Find files even with typos
- Regex & Wildcard: Power-user search patterns
- Tag Filtering: Filter by user-defined tags
- Category Filtering: Filter by auto-detected file categories
- Date Range: Filter files by creation date
- Size Range: Filter files by size boundaries
- Favorites Filter: Show only starred items
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β React βββββββΆβ Axum API βββββββΆβ PostgreSQL β
β Frontend β β (Rust) β β Database β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
βββββββΆ S3/RustFS (File Storage)
βββββββΆ ClamAV (Virus Scanning)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Background Workers (separate processes) β
β βββ Worker: Virus scanning, cleanup, facts updates β
β βββ Thumbnail Worker: WebP thumbnail generation β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Technology Stack:
- Language: Rust 2024 Edition
- Web Framework: Axum 0.7
- ORM: SeaORM (PostgreSQL & SQLite)
- Storage: AWS SDK for Rust (S3-compatible)
- Security: JWT, Argon2, ClamAV, CAPTCHA
- Runtime: Tokio async
Key Modules:
api/handlers/β HTTP request handlers (auth, files, upload, captcha, users, settings, shares, health)services/β Business logic (file, upload, metadata, scanner, audit, facts, share, thumbnail, worker)entities/β Database models (SeaORM)infrastructure/β Storage, database, scanner adaptersutils/β Validation, auth, encryption helpers
Features:
- Chunked multipart uploads with resume capability
- Content-based deduplication (SHA-256)
- Background virus scanning queue
- Metadata extraction (EXIF, ID3, PDF, Office)
- Recursive folder operations
- Download ticket generation
- File sharing with password protection and access logs
- WebP thumbnail generation (images, PDFs, videos)
- Favorites and folder tree navigation
Technology Stack:
- Framework: React 18 + TypeScript
- Build Tool: Vite 5
- Runtime: Bun
- Styling: Tailwind CSS + Glassmorphism
- Icons: Lucide React
- Tables: TanStack Table v8
- State: React Context + Hooks
Key Components:
features/dashboard/β Main file manager interfacefeatures/auth/β Login, register, OIDCfeatures/share/β Public share page (password gate, media preview, folder browsing)lib/β Reusable file manager libraryservices/β API client (upload, file operations, sharing)components/β Modals, toasts, context menus, sidebar with shares
Features:
- Drag-and-drop file upload
- Real-time upload progress with parallel chunks
- Copy/Cut/Paste with keyboard shortcuts
- Bulk selection and operations
- File preview modals (images, PDF, archives)
- Archive content inspection
- Responsive grid/list views
- Thumbnail previews with lazy loading
- Share management (create, revoke, view logs)
- Public share page with media viewer
- Sidebar with active shares navigation
- Favorites toggle and filtering
- Rust 1.84+
- Bun 1.1+
- PostgreSQL 14+ (or SQLite for development)
- RustFS, MinIO, or AWS S3
- Redis (optional, for caching)
- ClamAV (optional, for scanning)
pdftocairo(optional, for PDF thumbnails)ffmpeg(optional, for video thumbnails)
- Clone Repository
git clone https://github.com/appsjuragan/rust-file-backend.git
cd rust-file-backend- Backend Setup
cd api
cp ../.env.sample .env
# Edit .env with your database and S3 credentials
# Run migrations
cargo run --bin rust-file-backend -- --mode migrate
# Start API server
cargo run --bin rust-file-backend -- --mode api
# Start background worker (separate terminal)
cargo run --bin rust-file-backend -- --mode worker
# Start thumbnail worker (separate terminal)
cargo run --bin rust-file-backend -- --mode thumbnail-worker- Frontend Setup
cd web
cp .env.example .env
# Edit .env to set VITE_API_URL=http://localhost:3000
bun install
bun run dev- Access Application
- Frontend: http://localhost:5173
- API Docs: http://localhost:3000/swagger-ui
- Health Check: http://localhost:3000/health
./run.bat# Backend
docker build -t rfb-api:latest ./api
# Frontend
docker build --build-arg VITE_API_URL=https://your-api-domain.com -t rfb-web:latest ./webOfficial images are available on GitHub Container Registry:
# Pull Backend (v9)
docker pull ghcr.io/appsjuragan/rust-file-backend-api:v9
# Pull Frontend (v9)
docker pull ghcr.io/appsjuragan/rust-file-backend-web:v9The compose stack includes:
- API server β Axum HTTP service
- Background worker β Virus scanning, cleanup, facts updates
- Thumbnail worker β WebP thumbnail generation (images, PDFs, videos)
- PostgreSQL β Primary database
- RustFS β S3-compatible object storage
- Web β Nginx-served React frontend
docker compose up -dPOST /registerβ Create new user (CAPTCHA-protected)POST /loginβ Authenticate and receive JWTPOST /captchaβ Generate CAPTCHA challengeGET /auth/oidc/loginβ OIDC authentication flowGET /auth/oidc/callbackβ OIDC callback handler
POST /uploadβ Single file uploadPOST /files/upload/initβ Initialize chunked uploadGET /files/upload/sessionsβ List pending upload sessionsPUT /files/upload/:id/chunk/:numβ Upload chunkPOST /files/upload/:id/completeβ Finalize uploadDELETE /files/upload/:idβ Abort chunked uploadGET /filesβ List files (with pagination, search, filters)GET /files/:idβ Download filePOST /files/:id/ticketβ Generate download ticketGET /download/:ticketβ Download via ticketDELETE /files/:idβ Delete file/folderPUT /files/:id/renameβ Rename or move itemPOST /files/:id/favoriteβ Toggle favorite statusGET /files/:id/thumbnailβ Get WebP thumbnail
POST /files/bulk-deleteβ Delete multiple itemsPOST /files/bulk-moveβ Move multiple itemsPOST /files/bulk-copyβ Copy multiple items (with recursion)
POST /foldersβ Create new folderGET /folders/treeβ Get full folder tree for navigationGET /files/:id/pathβ Get folder breadcrumb path
POST /sharesβ Create a share link (public/user, password, permissions)GET /sharesβ List user's shares (optionally filter by file)DELETE /shares/:idβ Revoke a share linkGET /shares/:id/logsβ Get share access logs
GET /share/:tokenβ Get shared item info (filename, type, permissions)POST /share/:token/verifyβ Verify share passwordGET /share/:token/downloadβ Download shared file (with optionalfile_idfor folder items)GET /share/:token/listβ List shared folder contents
POST /pre-checkβ Check if file exists (deduplication)POST /files/linkβ Link existing storage fileGET /files/:id/zip-contentsβ Preview archive contents
GET /users/meβ Get user profilePUT /users/meβ Update profileGET /users/avatar/:user_idβ Get public avatar imagePOST /users/me/avatarβ Upload personal avatarGET /users/me/factsβ Get storage statisticsGET /settingsβ Get user preferencesPUT /settingsβ Update preferences
GET /healthβ Health check (DB, storage, version)GET /system/validation-rulesβ Get file validation rules
Full API documentation available at /swagger-ui endpoint.
Import api/postman_collection.json for ready-to-use API requests with:
- Pre-configured authentication
- Example payloads for all endpoints including sharing
- Environment variables
- Postman test scripts for auto-setting tokens
cd api
cargo testcd web
bun test# Dependency audit
cargo audit# Backend
cd api && cargo fmt
# Frontend
cd web && bun run format# Backend
cd api && cargo clippy -- -D warnings
# Frontend
cd web && bun run lintAll code follows:
- Rust 2024 edition conventions
- ESLint + Prettier for TypeScript
- No unused imports or dead code
DATABASE_URL=postgresql://user:pass@localhost/rfb
JWT_SECRET=your-secret-key
# OIDC (optional)
OIDC_ISSUER_URL=https://accounts.google.com
OIDC_CLIENT_ID=your-client-id
OIDC_CLIENT_SECRET=your-client-secret
OIDC_REDIRECT_URL=http://localhost:3000/auth/oidc/callback
OIDC_SKIP_DISCOVERY=false
MINIO_ENDPOINT=http://localhost:9000
MINIO_BUCKET=file-storage
MINIO_ACCESS_KEY=rustfsadmin
MINIO_SECRET_KEY=rustfsadmin
MINIO_REGION=us-east-1
CHUNK_SIZE=10485760
MAX_FILE_SIZE=1073741824
CLAMAV_HOST=localhost
CLAMAV_PORT=3310
ENABLE_VIRUS_SCAN=true
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173See .env.sample in the project root for a complete reference.
VITE_API_URL=http://localhost:3000
VITE_CHUNK_SIZE=10485760- Upload Speed: 500MB/s on local network
- Concurrent Users: 10,000+ simultaneous connections
- Memory Usage: ~50MB base (API server)
- Deduplication Savings: Up to 80% storage reduction
- Chunk Upload Parallelism: 4 workers default
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
Licensed under the MIT License. See LICENSE file for details.
Created with β€οΈ by the AppsJuragan team.
- WebDAV support
- Real-time collaboration
- File versioning
-
Advanced search with filters - Mobile app (Capacitor)
- End-to-end encryption option
-
File sharing with public links -
Thumbnail generation -
Favorites system