A decentralized file sharing web application built with Go (Gin) and React. Upload and share files via unique links with UCAN-based expiration and revocation, powered by Storacha Network and IPFS.
- Drag & Drop Uploads: Easy file uploads with react-dropzone
- Decentralized Storage: Files stored on IPFS via Storacha Network
- UCAN Authorization: Secure, capability-based access control
- Expirable Share Links: Create links that automatically expire
- Link Revocation: Revoke access anytime with UCAN revocations
- Access Limits: Set maximum number of accesses per link
- IPFS Gateway Preview: View files directly from IPFS gateways
- Go: 1.21 or higher
- Node.js: 22 or higher (with npm 7+)
- Storacha CLI: For generating DID and proofs
npm install -g @storacha/cli# Generate a DID key
storacha key create
# Output: did:key:z6Mk... and private key (save the private key!)
# Save the private key to a file
echo "MgCb+bRG..." > private.key
# Login to Storacha
storacha login [email protected]
# Create a space
storacha space create my-fileshare-space
# Delegate capabilities to your DID
storacha delegation create \
-c 'space/blob/add' \
-c 'space/index/add' \
-c 'upload/add' \
-c 'filecoin/offer' \
did:key:... -o proof.ucanCreate a .env file or set environment variables:
# Required
PRIVATE_KEY_PATH=./private.key
PROOF_PATH=./proof.ucan
SPACE_DID=did:key: # Your space DID
# Optional
PORT=8080
IPFS_GATEWAY=https://w3s.link/ipfs# Install dependencies
go mod tidy
# Run the server
go run .cd frontend
# Install dependencies
npm install
# Start development server
npm run dev-
Build the Go binary:
go build -o dec-filesharer . -
Set environment variables for production
-
Use a reverse proxy (nginx) for HTTPS
-
Consider using a database instead of in-memory storage
-
Build for production:
cd frontend npm run build -
Deploy the
distfolder to your static hosting
- Private Keys: Never commit
private.keyto version control - HTTPS: Always use HTTPS in production
- CORS: Update
AllowOriginsinmain.gofor production domains - Rate Limiting: Consider adding rate limiting for production
- Database: Use a proper database for file metadata in production