Back to Documentation

Architecture

Understanding CapaCloud's system architecture

System Overview

CapaCloud is built on a decentralized architecture leveraging Solana blockchain for payments and authentication, with a centralized backend for coordination and metadata.

Components

Frontend (Next.js)

Next.js 16 with React 19
Solana Wallet Adapter for wallet integration
TypeScript for type safety
Tailwind CSS for styling

Backend (Next.js API Routes)

RESTful API endpoints
User authentication via wallet signatures
Machine and rental management
Balance and transaction tracking

Database (MongoDB)

User accounts and settings
Machine metadata and status
Rental sessions and history
Transaction records

GPU Workers

Python-based worker script
Docker container management
NVIDIA GPU access via Container Toolkit
SSH server for user access
Heartbeat system for monitoring

Data Flow

User Rental Flow

  1. User connects wallet and tops up balance
  2. User selects and rents a GPU
  3. Backend creates rental record and updates machine status
  4. User receives SSH connection details
  5. Worker creates Docker container with GPU access
  6. Hourly billing automatically deducted

Provider Setup Flow

  1. Provider installs GPU worker with Account ID
  2. Worker registers with backend and sends heartbeats
  3. Machine appears as "pending" in registration page
  4. Provider completes registration (IP, SSH port, pricing)
  5. Machine becomes available for rent

Security

Wallet-based authentication (no passwords)
Message signing for authentication
SSH key-based access for GPU containers
Isolated Docker containers per rental
Encrypted communication (TLS/HTTPS)