CloudLink is a comprehensive distributed cloud platform featuring two powerful systems:
- CloudNode - Enterprise-grade distributed storage with Raft consensus (Go)
- CloudLink-mini - AWS-powered personal cloud mesh network (Python)
Enterprise-grade distributed storage with automatic leader election and fault tolerance.
Key Features:
- 🗳️ Raft Consensus - Automatic leader election, prevents split-brain
- 🔄 Fault Tolerance - Seamless coordinator failover
- 📊 Real-time Monitoring - Web dashboard with cluster health metrics
- ⚖️ Load Balancing - Intelligent request routing
- 🔒 Security - Ed25519 signatures, TLS encryption
- 💾 Persistent Storage - SQLite backend with automatic backups
- 🎯 High Performance - Concurrent operations, connection pooling
- 🐳 Easy Deployment - Docker, systemd, cloud-ready
Tech Stack: Go, Raft, WebSocket, SQLite, Next.js
Turn any computer into a cloud node with P2P mesh networking and AWS control plane.
Key Features:
- ☁️ AWS Control Plane - API Gateway, Lambda, DynamoDB, S3
- 🕸️ P2P Mesh Network - WebRTC data channels with NAT traversal
- 📊 Live Metrics - CPU, RAM, disk, bandwidth monitoring
- 🎯 Task Execution - SHA256, image resize, custom jobs
- 🧠 Smart Routing - Lowest RTT neighbor selection
- 📱 Live Dashboard - React-based real-time monitoring
- 🔐 Secure - Pre-signed URLs, WebRTC encryption
Tech Stack: Python, AWS SAM, WebRTC, React, Vite, TypeScript
CloudLink/
├── agent/ # CloudNode: Core Go agent
│ ├── main.go # Dual coordinator/storage roles
│ ├── election/ # Raft consensus
│ ├── coordinator/ # Coordinator service
│ └── connect/ # WebSocket client
├── client/ # CloudNode: Go client CLI
├── backend/ # CloudNode: Legacy Node.js coordinator
├── dashboard/ # CloudNode: Next.js monitoring
├── deployment/ # CloudNode: Production deployment
├── monitoring/ # CloudNode: Health checks
├── loadbalancer/ # CloudNode: Load balancer
├── storage/ # CloudNode: SQLite backend
├── testing/ # CloudNode: Test suite
└── cloudlink-mini/ # CloudLink-mini: Complete AWS mesh system
├── agent/ # Python agent with WebRTC
├── backend/ # AWS SAM Lambda functions
├── dashboard/ # React dashboard
└── examples/ # Usage examples
cd agent/
# macOS
./build_mac.sh
# Linux
./build_linux.sh
# Windows
powershell .\build_win.ps1# Start with default config (becomes leader automatically)
./cloudnode-agent-macos# Node 1 (Bootstrap)
cat > agent_config.json <<EOF
{
"enable_election": true,
"node_id": "node1",
"raft_bind_addr": "192.168.1.10:7000",
"peers": [],
"coordinator_port": "8080"
}
EOF
./cloudnode-agent-linux
# Node 2 (Join cluster)
cat > agent_config.json <<EOF
{
"enable_election": true,
"node_id": "node2",
"raft_bind_addr": "192.168.1.11:7000",
"peers": ["192.168.1.10:7000"],
"coordinator_port": "8080"
}
EOF
./cloudnode-agent-linuxcd cloudlink-mini/backend
sam build
sam deploy --guided
# Note the API endpoint URLcd cloudlink-mini/agent
pip install -r requirements.txt
export API_URL="https://xxx.execute-api.region.amazonaws.com/prod"
python agent.pycd cloudlink-mini/dashboard
npm install
npm run dev
# Open http://localhost:5173Access at http://localhost:3000:
cd dashboard/
npm install
npm run devFeatures:
- 📊 Real-time cluster status
- 🖥️ Node health monitoring
- 💾 Storage metrics and usage
- ⚡ Performance analytics
- 📝 Live activity logs
Access at http://localhost:5173:
cd cloudlink-mini/dashboard/
npm install
npm run devFeatures:
- 🕸️ P2P mesh topology visualization
- 📊 Real-time node metrics
- 🎯 Task queue and execution status
- 🔗 WebRTC connection status
- 📈 Performance graphs
sudo ./deployment/deploy.shdocker build -t cloudnode:latest .
docker run -d \
--name cloudnode-node1 \
-p 8080:8080 \
-p 7000:7000 \
-v /opt/cloudnode:/data \
cloudnode:latestcd cloudlink-mini/backend
sam build
sam deploy --guidedcd cloudlink-mini/dashboard
npm run build
vercel deploySee cloudlink-mini/DEPLOYMENT_CHECKLIST.md for detailed AWS setup.
# Comprehensive test suite
python3 testing/cluster_test.py localhost:8080
# Multi-node cluster
python3 testing/cluster_test.py \
192.168.1.10:8080 \
192.168.1.11:8080 \
192.168.1.12:8080
# Manual testing
curl http://localhost:8080/cluster/status
curl http://localhost:8080/hosts
python3 test_push.pycd cloudlink-mini
# Test workflow
./test-workflow.sh
# Run multiple agents
./run-multiple-agents.sh
# Submit test task
python examples/submit-task.pyCore Settings (agent_config.json):
{
"enable_election": true,
"node_id": "unique-node-name",
"raft_bind_addr": "0.0.0.0:7000",
"raft_data_dir": "/opt/cloudnode/raft",
"peers": ["node2:7000", "node3:7000"],
"coordinator_port": "8080",
"enable_storage": true,
"chunk_dir": "/opt/cloudnode/chunks"
}See deployment/production_config.json for full production settings.
Agent Settings (.env):
API_URL=https://xxx.execute-api.region.amazonaws.com/prod
API_KEY=your-api-key
NODE_NAME=my-nodeBackend Settings (backend/samconfig.toml):
[default.deploy.parameters]
stack_name = "cloudlink-mini"
region = "us-east-1"See cloudlink-mini/.env.example for all options.
TLS Configuration:
openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -nodesFirewall:
sudo ufw allow 7000:7002/tcp comment "CloudNode Raft"
sudo ufw allow 8080/tcp comment "CloudNode HTTP"- ✅ API Gateway with API keys
- ✅ Pre-signed S3 URLs (5-min expiry)
- ✅ WebRTC DTLS/SRTP encryption
- ✅ Optional: Ed25519 node signatures
- ✅ Optional: Cognito user pool
Cluster Management:
GET /cluster/status- Cluster health and leadershipGET /cluster/leader- Current leader informationGET /hosts- Available storage hostsGET /metrics- Performance metrics
File Operations:
POST /push_chunk_direct- Upload file chunkGET /files/{id}- Download file metadataDELETE /files/{id}- Delete file
Node Management:
POST /register- Register new nodePOST /heartbeat- Update node metricsGET /list-nodes- Get all nodesPOST /get-peers- Get neighbor nodes
Task Management:
POST /create-task- Create new taskPOST /request-task- Request task assignmentPOST /complete-task- Mark task completeGET /list-tasks- Get all tasks
WebRTC Signaling:
POST /signal-offer- Send WebRTC offerPOST /signal-answer- Send WebRTC answerGET /signal-inbox- Get pending signals
Split Brain Prevention:
# Always use odd number of nodes (3, 5, 7)
journalctl -u cloudnode-agent | grep -i raftNetwork Connectivity:
telnet node2 7000
sudo ufw statusStorage Issues:
df -h /opt/cloudnode
ls -la /opt/cloudnode/chunksAgent Won't Connect:
# Check API URL
echo $API_URL
# Test endpoint
curl $API_URL/list-nodes
# Check logs
python agent.py --verboseWebRTC Connection Fails:
# Check STUN server
ping stun.l.google.com
# Verify NAT type
# Use TURN server if behind symmetric NATTask Execution Errors:
# Check task logs in agent output
# Verify S3 permissions
# Check pre-signed URL expiryHorizontal:
- Add nodes by including existing peers in configuration
- Cluster automatically rebalances data
- Zero-downtime scaling
Vertical:
- Increase memory/CPU on existing nodes
- Adjust connection limits and buffer sizes
Nodes:
- Unlimited nodes (DynamoDB auto-scales)
- Each node maintains K=3 neighbors
- Automatic peer discovery
Tasks:
- Queue via SQS for FIFO (optional)
- S3 standard or Glacier for storage
- Lambda concurrent execution limits
ARCHITECTURE.md- System architecture overviewPROJECT_SUMMARY.md- Project statistics and achievementsDEPLOYMENT_STATUS.md- Deployment guidedeployment/production_config.json- Production configuration
cloudlink-mini/README.md- Detailed project documentationcloudlink-mini/ARCHITECTURE.md- Architecture deep divecloudlink-mini/QUICKSTART.md- Quick start guidecloudlink-mini/DEPLOYMENT_CHECKLIST.md- AWS deployment stepscloudlink-mini/SHOWCASE.md- Feature showcasecloudlink-mini/WHAT_WE_BUILT.md- Build journey
- Enterprise file storage
- Distributed databases
- Content delivery networks
- Backup and archival systems
- Multi-datacenter replication
- Personal cloud storage
- Distributed computing tasks
- P2P file sharing
- Edge computing
- Home lab clusters
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
See cloudlink-mini/CONTRIBUTING.md for detailed guidelines.
MIT License - see the LICENSE file for details.
- HashiCorp Raft - Consensus algorithm
- Gorilla WebSocket - WebSocket library
- Next.js - Dashboard framework
CloudLink - Distributed cloud platform for the modern era. 🌐
Built with ❤️ for enterprise reliability and personal cloud freedom.