A lightweight cloud storage built with Go, Gin, and GORM.
- Go 1.23+
- MySQL
- Redis
- AWS S3
- Node.js 18+ (for frontend)
-
Setup Database
mysql -u root -p < setup_db.sql -
Install Dependencies
# Backend dependencies go mod tidy # Frontend dependencies cd frontend && npm install && cd ..
-
Configure Edit
configs/config.yamlor set environment variables:export AWSAccessKeyID=your-access-key export AWSSecretAccessKey=your-secret-key export S3Bucket=your-bucket-name export AWSRegion=us-east-1
-
Start All Services
./start.sh
This will start:
- Backend server (http://localhost:8888)
- Frontend dev server (http://localhost:3000)
- Stripe CLI webhook listener
-
Stop All Services
./stop.sh
Or press
Ctrl+Cin the terminal wherestart.shis running.
If you prefer to start services separately:
Backend:
go run ./cmd/cloud-dist/main.go -config configs/config.yamlFrontend:
cd frontend
npm run devStripe CLI (for webhook testing):
stripe listen --forward-to localhost:8888/api/storage/purchase/webhookVisit http://localhost:3000 to use the application.
- User authentication with JWT
- File upload/download with S3 storage
- File management (folders, rename, move, delete)
- File sharing and friend system
- Storage purchase with Stripe payment
- Backend: Go, Gin, GORM
- Frontend: React, JavaScript
- Storage: AWS S3
- Cache: Redis
- Payment: Stripe
The backend exposes Prometheus metrics at http://localhost:8888/metrics
(HTTP request rate / latency, Go runtime, upload-pipeline outcomes, S3
call duration). A pre-wired Prometheus + Grafana stack lives under
deploy/monitoring/:
cd deploy/monitoring && docker compose up -d- Grafana: http://localhost:3001 (admin / admin) — the Cloud Disk Overview dashboard is auto-loaded with four sections (HTTP, Upload pipeline, S3, Go runtime).
- Prometheus: http://localhost:9090 — scrape targets and ad-hoc PromQL.
The Prometheus scrape target is host.docker.internal:8888, which works
out of the box on Docker Desktop (Mac / Windows). On Linux, uncomment the
extra_hosts block in deploy/monitoring/docker-compose.yaml (or replace
the target in deploy/monitoring/prometheus/prometheus.yml with your
host's LAN IP).
To shut everything down: docker compose down (the named volumes keep
your Grafana state and Prometheus history across restarts; add -v to
wipe them).
MIT
