Claude
Skills
Sign in
Back

regplatformm-multi-platform-registration

Included with Lifetime
$97 forever

```markdown

Writing & Docs

What this skill does

```markdown
---
name: regplatformm-multi-platform-registration
description: Multi-platform account batch registration system supporting OpenAI, Grok, Kiro, Gemini with task engine, HuggingFace worker nodes, Cloudflare routing, credits system, and admin management
triggers:
  - set up regplatform registration system
  - configure batch account registration
  - deploy HuggingFace worker spaces
  - set up OpenAI Grok Kiro account registration
  - configure Cloudflare worker routing for registration
  - manage HF space worker nodes
  - set up credits and user management for regplatform
  - integrate regplatform with external systems
---

# RegPlatformm — Multi-Platform Account Batch Registration System

> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.

RegPlatform is a production-ready multi-platform account batch registration system built in Go. It supports automated account registration for OpenAI, Grok, Kiro, and Gemini via a distributed worker architecture: a Go/Gin backend orchestrates tasks, HuggingFace Space nodes execute registrations, and a Cloudflare Worker handles load balancing and routing.

## Architecture

```
Browser → Nginx → Vue 3 SPA
                → Go Backend (:8000)
                      ├── TaskEngine (worker pool, scheduling)
                      ├── HFSpaceService (elastic node management)
                      ├── WebSocket (real-time logs)
                      └── PostgreSQL
                            ↓
                      CF Worker (path-prefix routing)
                      ├── /openai/* → HFNP pool
                      ├── /grok/*   → HFGS pool
                      ├── /kiro/*   → HFKR pool
                      └── /ts/*     → HFTS pool
```

## Tech Stack

- **Backend**: Go 1.25, Gin, GORM, PostgreSQL 16
- **Frontend**: Vue 3, Vite, Pinia, TailwindCSS
- **CI/CD**: GitHub Actions → GHCR Docker + GitHub Release
- **Deployment**: Docker Compose + HuggingFace Spaces (worker nodes)
- **Routing**: Cloudflare Worker (path-prefix load balancing)

## Installation & Setup

### Prerequisites

- Go 1.25+
- Node.js 18+
- PostgreSQL 16+
- Docker & Docker Compose
- HuggingFace account(s) with API tokens
- Cloudflare Worker account

### 1. Clone and Configure

```bash
git clone https://github.com/xiaolajiaoyyds/regplatformm.git
cd regplatformm
cp .env.example .env
```

### 2. Environment Variables (.env)

```env
# Required
DATABASE_URL=postgres://user:password@localhost:5432/regplatform
JWT_SECRET=your-secret-key-at-least-32-chars

# Optional
PORT=8000
GIN_MODE=release
DEV_MODE=false
ADMIN_USERNAME=your_admin_username
SSO_SECRET=optional_sso_secret
REDIS_URL=redis://localhost:6379
JWT_EXPIRE_HOURS=72
CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com
```

### 3. Local Development

```bash
# Backend
go mod tidy
go run cmd/server/main.go

# Frontend (separate terminal)
cd web
npm install
npm run dev
```

### 4. Production Docker Deployment

```bash
docker-compose -f docker-compose.prod.yml up -d
```

### 5. First-Time Setup

1. Visit `http://localhost:8000`
2. Register first account — **automatically becomes admin**
3. Go to admin panel → System Settings to configure services

## Project Structure

```
regplatformm/
├── cmd/
│   ├── server/              # Main server entrypoint
│   ├── openai-worker/       # OpenAI worker binary (→ HFNP)
│   ├── grok-worker/         # Grok worker binary (→ HFGS)
│   └── grpctest/            # gRPC-web debug tool
├── internal/
│   ├── config/              # Viper config loading
│   ├── model/               # GORM data models
│   ├── service/             # Business logic (TaskEngine, HFSpaceService)
│   ├── worker/              # Platform worker implementations
│   ├── handler/             # HTTP route handlers
│   ├── middleware/          # JWT auth, CORS, rate limiting
│   ├── dto/                 # Request/response structs
│   └── pkg/                 # Internal utilities
├── web/                     # Vue 3 frontend
├── services/
│   ├── aws-builder-id-reg/  # Kiro registration microservice
│   └── turnstile-solver/    # Turnstile solver microservice
├── cloudflare/              # CF Worker source
├── HFNP/                    # OpenAI HF Space template
├── HFGS/                    # Grok HF Space template
├── HFKR/                    # Kiro HF Space template
├── HFTS/                    # Turnstile HF Space template
├── Dockerfile
├── docker-compose.yml
└── docker-compose.prod.yml
```

## API Reference

### Authentication Endpoints (Public)

```go
// Register — rate limited 3/min per IP
POST /api/auth/register
// Body: { "username": "user", "password": "Password1" }
// Password: min 8 chars, uppercase + lowercase + digit required
// First registered user auto-assigned admin (Role=100, IsAdmin=true)

// Login — rate limited 10/min per IP
POST /api/auth/login
// Body: { "username": "user", "password": "Password1" }
// Returns: JWT token

// SSO (optional, requires SSO_SECRET env var)
GET /api/auth/sso

// Dev login (DEV_MODE=true only)
GET /api/auth/dev-login
```

### Auth Token Passing

JWT token can be passed three ways:
```
Cookie: token=<jwt>
Header: X-Auth-Token: <jwt>
Header: Authorization: Bearer <jwt>
```

### User Endpoints (Authenticated)

```go
GET  /api/auth/me                    // Current user info
GET  /api/init                       // Batch initialization load
POST /api/tasks                      // Create registration task
POST /api/tasks/:id/start            // Start task
POST /api/tasks/:id/stop             // Stop task
GET  /api/tasks/current              // Current running task
GET  /api/results                    // Registration results list
GET  /api/results/:taskId/export     // Export results
GET  /api/credits/balance            // Credit balance
POST /api/credits/redeem             // Redeem credit code
GET  /api/proxies                    // List proxies
POST /api/proxies                    // Add proxy
PUT  /api/proxies/:id                // Update proxy
DELETE /api/proxies/:id              // Delete proxy
```

### Admin Endpoints (Admin Role Required)

```go
GET  /api/admin/users                // User list
POST /api/admin/credits/recharge     // Recharge user credits
GET  /api/admin/settings             // Get system settings
POST /api/admin/settings             // Update system settings
GET  /api/admin/hf/overview          // HF Space overview
POST /api/admin/hf/spaces/deploy     // Batch deploy spaces
POST /api/admin/hf/spaces/health     // Health check
POST /api/admin/hf/autoscale         // Elastic scaling
POST /api/admin/hf/sync-cf           // Sync CF Worker env vars
```

### Real-Time Endpoints

```go
GET /ws/logs/:taskId/stream   // SSE real-time logs
GET /ws/logs/:taskId          // WebSocket logs
```

## Configuration: Admin System Settings

Configure in the admin panel (persisted to DB):

| Key | Description |
|-----|-------------|
| `yydsmail_base_url` | YYDS Mail temp email API URL |
| `gptmail_api_key` | GPTMail API Key |
| `gptmail_base_url` | GPTMail service URL |
| `turnstile_solver_url` | Turnstile solver service URL |
| `cf_bypass_solver_url` | CF Bypass solver URL |
| `yescaptcha_key` | YesCaptcha API Key |
| `openai_reg_url` | OpenAI registration service URL |
| `grok_reg_url` | Grok registration service URL |
| `kiro_reg_url` | Kiro registration service URL |
| `default_proxy` | Default proxy address |
| `new_user_bonus` | Credits granted to new users |
| `max_threads_per_user` | Max concurrent threads per user |
| `max_target_per_task` | Max targets per task |

## Supported Platforms

| Platform | Method | HF Space | Release Tag |
|----------|--------|----------|-------------|
| OpenAI | Go HTTP (Sentinel PoW + PKCE OAuth + Auth0) | HFNP | `inference-runtime-latest` |
| Grok | Go HTTP (gRPC-web + Turnstile + Server Actions) | HFGS | `stream-worker-latest` |
| Kiro | Python (AWS Cognito + Camoufox) | HFKR | `browser-agent-latest` |
| Gemini | Python (Camoufox browser automation) | HFGM | `gemini-agent-latest` |
| Tur

Related in Writing & Docs