1.5 KiB
1.5 KiB
S3 Mover
A small web app with a Go backend and React frontend for listing, uploading, downloading, and deleting files in an S3 bucket.
Structure
backend: Go HTTP API for S3 operationsfrontend: React + Vite client
Backend configuration
Set these environment variables before starting the API:
AWS_REGION: AWS region for the bucketS3_BUCKET: target bucket nameS3_PREFIX: optional folder prefix inside the bucketFRONTEND_ORIGIN: allowed browser origin for CORS, for examplehttp://localhost:5173SERVER_ADDR: HTTP bind address, default:8080AWS_ENDPOINT_URL: optional custom S3-compatible endpointAWS_USE_PATH_STYLE: set totruefor MinIO and some S3-compatible providersAWS_ACCESS_KEY_ID: access key for S3-compatible storageAWS_SECRET_ACCESS_KEY: secret key for S3-compatible storage
Standard AWS credentials are supported through the normal SDK chain. You can also set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.
For DigitalOcean Spaces, a typical configuration looks like:
AWS_REGION=nyc3
S3_BUCKET=your-space-name
AWS_ENDPOINT_URL=https://nyc3.digitaloceanspaces.com
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_USE_PATH_STYLE=false
FRONTEND_ORIGIN=http://localhost:5173
Run locally
Backend:
cd backend
go mod tidy
go run .
Frontend:
cd frontend
npm install
VITE_API_BASE_URL=http://localhost:8080 npm run dev
Then open http://localhost:5173.