Untone 3ff469c8a1
Some checks failed
Deploy on push / deploy (push) Failing after 4s
connection-pool-fix
2025-09-22 01:23:16 +03:00
2025-09-02 09:09:34 +03:00
2025-08-12 15:59:51 +03:00
2025-09-22 01:15:35 +03:00
2025-09-03 10:21:17 +03:00
2025-09-22 01:23:16 +03:00
2025-09-22 01:23:16 +03:00
2025-09-01 22:52:33 +03:00
2025-08-12 15:59:51 +03:00
2025-09-22 01:15:35 +03:00
2025-09-22 01:15:35 +03:00
2025-09-22 01:23:16 +03:00
2025-09-02 14:00:54 +03:00
2025-08-02 00:18:09 +03:00
2025-09-02 14:00:54 +03:00

Quoter 🚀

Simple file upload proxy with quotas. Upload to S3, thumbnails via Vercel.

Focus: Upload + Storage. Thumbnails managed by Vercel Edge API for better performance.

What it does

  • 📤 Upload files to S3/Storj with user quotas
  • 🔐 JWT authentication with session management
  • 📦 File serving with caching and optimization
  • 🌐 CORS support for web apps

🚀 Quick Start

# Setup
cargo build
cp .env.example .env  # Configure environment
cargo run

# Test
curl http://localhost:8080/  # Health check

🔧 API

Method Endpoint Description
GET / Health check or user info (need auth token)
POST / Upload file (need auth token)
GET /{filename} Get file or thumbnail

Upload file

curl -X POST http://localhost:8080/ \
  -H "Authorization: Bearer your-token" \
  -F "file=@image.jpg"

Get thumbnail

# Legacy thumbnails (fallback only)
curl http://localhost:8080/image_300.jpg

# 💡 Recommended: Use Vercel Image API
https://yoursite.com/_next/image?url=https://files.dscrs.site/image.jpg&w=300&q=75

🏗️ Architecture & Setup

Simple 3-tier architecture:

  • Upload: Quoter (auth + quotas + S3 storage)
  • Download: Vercel Edge API (thumbnails + optimization)
  • Storage: S3/Storj (files) + Redis (quotas/cache)
Upload: Client → Quoter → S3/Storj
Download: Client → Vercel → Quoter (fallback)

💋 Simplified approach: Quoter handles uploads, Vercel handles thumbnails.

📋 Environment Setup

# Required
REDIS_URL=redis://localhost:6379
STORJ_ACCESS_KEY=your-key
STORJ_SECRET_KEY=your-secret  
JWT_SECRET=your-secret

# Optional
PORT=8080
RUST_LOG=info

🧪 Testing

cargo test  # 36 tests passing
./scripts/test-coverage.sh  # Coverage report

📚 Documentation

For detailed setup and deployment instructions, see the docs folder.

Description
quota guarded uploader and thumbs generator for progressive image load
Readme MIT 1.2 MiB
Languages
Rust 98.6%
Dockerfile 1.4%