Dionisio ed433df2af perf(zip): eliminate N+1 queries with ltree bulk subtree fetch
Replace BFS traversal that issued 2 SQL queries per folder (list_files +
list_folders) with 2 total queries using PostgreSQL ltree <@ operator:

1. list_subtree_folders: single GiST-indexed scan for all folders
2. list_files_in_subtree: single GiST-indexed join for all files

Files are grouped by folder_id in a HashMap, then iterated in directory
order (folders pre-sorted by path from SQL).

Changes across 4 architecture layers:
- Domain: FolderRepository::list_subtree_folders (default impl)
- Application ports: FolderUseCase, FileRetrievalUseCase, FileReadPort
- Application services: FolderService, FileRetrievalService passthroughs
- Infrastructure: PG implementations + ZipService rewrite

Query count: O(N) → O(1). Latency for 100-folder tree: ~200 round-trips → 3.
2026-02-24 12:18:38 +01:00
2025-03-17 21:28:08 +01:00
2025-04-13 03:23:53 +02:00

OxiCloud

License: MIT Latest Release GitHub Stars GitHub Issues GitHub Forks Last Commit

A fast, simple alternative to NextCloud

NextCloud was too slow on my home server. So I built OxiCloud: a file storage system written in Rust that runs on minimal hardware and stays out of your way.

OxiCloud Dashboard

Why OxiCloud?

Feature What you get
Low resources Runs on 512MB RAM. No PHP, no bloat.
Fast Rust with LTO optimization. Sub-second responses.
Clean UI Works on desktop and mobile. No clutter.
Easy setup One binary, one database, done.
Multi-language English, Spanish and Persian out of the box.

Quick Start

You need Rust 1.70+, Cargo, and PostgreSQL 13+.

git clone https://github.com/DioCrafts/oxicloud.git
cd oxicloud

# Set up your database connection
echo "DATABASE_URL=postgres://username:password@localhost/oxicloud" > .env

# Build and run
cargo build --release
cargo run --bin migrate --features migrations
cargo run --release

Open http://localhost:8086 in your browser.

Docker (alternative)

# Copy example environment file and customize
cp example.env .env
# Edit .env with your settings (optional - defaults work for quick testing)

docker compose up -d

That's it. The app runs on port 8086.

Architecture

OxiCloud uses Clean Architecture with four layers:

┌─────────────────────────────────────────┐
│  Interfaces    │ API routes, handlers   │
├─────────────────────────────────────────┤
│  Application   │ Use cases, services    │
├─────────────────────────────────────────┤
│  Domain        │ Business logic         │
├─────────────────────────────────────────┤
│  Infrastructure│ Database, filesystem   │
└─────────────────────────────────────────┘

Each layer only talks to the one below it. You can swap out the database or add new API endpoints without touching business logic.

Development

cargo build                 # Build
cargo run                   # Run locally
cargo test                  # Run tests
cargo clippy                # Lint
cargo fmt                   # Format

# For debugging
RUST_LOG=debug cargo run

Current Features

  • File upload, download, and organization
  • Folder management with drag-and-drop
  • Trash bin with restore functionality
  • User authentication with JWT
  • Personal folders per user
  • File deduplication
  • Write-behind cache for fast uploads
  • Search across files and folders
  • Favorites and recent files
  • Responsive grid/list views

What's Next

I'm working on these when I have time:

  • File sharing via links
  • WebDAV for desktop sync
  • Basic versioning
  • Mobile app improvements

Check TODO-LIST.md for the full list.

Contributing

The project is early stage. There's plenty to improve.

Read CONTRIBUTING.md before submitting a PR. Follow the Code of Conduct.

License

MIT. See LICENSE.


Star History


Questions? Open an issue. Want to help? PRs welcome.

S
Description
No description provided
Readme MIT 52 MiB
Languages
Rust 63.5%
Hurl 10.2%
TypeScript 8.5%
Svelte 8.2%
Shell 3.8%
Other 5.6%