Skip to content

Croupier

Distributed game operations control plane and agent collaboration platform

What is Croupier ​

Croupier is an operations control plane for one company with multiple games and environments. The Server owns governance, contracts, pages and routing. A sidecar connects game SDKs; capture, synthetics and devops Agents provide distinct capabilities. Analytics runs through a separate pipeline.

Current system architecture ​

The console uses HTTP/SSE. Agents establish outbound TCP sessions; SDKs connect to the sidecar gateway. Multi-instance deployments forward requests to the Server that owns the live Agent connection. The diagram separates processes, storage and optional deployment components.

Croupier current architecture: console, Server, four Agent roles, SDKs, shared state and separate analytics pipeline
Source review: 2026-10-30 · Open the full SVG

Runtime connections and lifecycles / 逐条连接与生命周期

Explore the current architecture, state ownership and limitations →

TLS is configuration-dependent and disabled in development templates. Cluster interconnect relies on trusted network isolation; production approval wiring still uses memory storage. HA routing does not imply HA for every business state.

Core Capabilities ​

Function management ​

  • OpenAPI-driven registration: register functions quickly via the OpenAPI specification
  • JSON Schema form rendering: fields and validation derived from the function contract; a JSON Schema form adapter uniformly renders call, query, create, edit and action forms
  • Resource/PageSpec orchestration: CRUD resources, standalone operations, paginated tables, reports and task pages are composed from strongly-typed PageSpecs binding multiple functions
  • Unified invocation path: the control plane routes calls through the Agent session; local access goes through the Agent gateway

Permissions and security ​

Authorization is based on a Casbin RBAC/ABAC hybrid model — beyond roles, requests can be allowed or denied by attributes. Policies are two-layer: YAML provides defaults, and database override policies tune them online. Operations carry low / medium / high / critical risk levels; high-risk operations automatically enter the approval flow, and dual-approval rules require multiple confirmations before release.

Scope model ​

  • Single company, multiple games: no SaaS multi-tenant abstraction; the standard business boundary is game_id
  • Multi-environment governance: env expresses logical environments such as dev/test/staging/prod
  • Ownership vs. deployment separated: scope expresses business ownership, target expresses runtime location

Observability ​

Audit follows execution paths and policy. Hash-chain validation covers hashed fields; it is not immutable storage or a guarantee that every operation is recorded. Execution logs, telemetry and audit serve different purposes, with masking rules applied by their respective paths.

Operations tooling ​

  • Ticketing: player issue ticket workflows
  • Feedback management: collect player feedback
  • Announcements: publish game announcements
  • Analytics: player behavior, retention, payment and other data analysis

Quick Start ​

Installation ​

bash
# Clone the repository
git clone https://github.com/cuihairu/croupier.git
cd croupier

# Download dependencies
go mod download

# Build the services
make build

Start the services ​

bash
# Start the Server
./bin/croupier-server --config configs/server.yaml

# Start the Agent (local dev: connect to localhost; docker-compose deployments use configs/agent.yaml instead)
./bin/croupier-agent --config configs/agent.local.yaml

Verify the installation ​

bash
# Check Server health
curl http://localhost:18780/healthz

# Inspect API meta information (version / capability declarations)
curl http://localhost:18780/api/v1/

Documentation Navigation ​

Organized by usage path:

PathEntryDescription
Quick StartGuide · GuideInstallation, configuration, Server + Agent startup, minimal loop
Page productFunction management · Page Studio · Resource CatalogRegister functions → pages generated automatically → publish via Proposal Inbox → controlled execution in Console
SDKSDK overviewProvider / Invoker / configuration / capability matrix, 6 languages
APIAPI referenceREST contracts, authentication, game/env scope, per-resource APIs
OperationsOperations · AnalyticsDeployment, monitoring, backup, analysis, troubleshooting
DevelopmentArchitectureArchitecture, code conventions, extension strategy, release rules

Historical design and migration documents live under Architecture — proposals and migrations (collapsed in the sidebar) and are not part of the main onboarding path.

Tech Stack ​

  • Backend: Go 1.27, Gin for HTTP, GORM for ORM (MySQL / PostgreSQL / SQLite / SQL Server)
  • Authorization: Casbin (RBAC/ABAC)
  • Internal transport: custom TCP session, length-prefixed framing with a protobuf envelope
  • Console: Umi Max + React + Ant Design Pro / ProComponents
  • Documentation site: VitePress

Roadmap ​

  • [x] Basic function registration and invocation
  • [x] RBAC permission control
  • [x] Approval workflow
  • [x] Audit log
  • [x] Two-layer policy architecture
  • [x] Dashboard vNext: function registration generates pages automatically (Proposal Inbox / Page Studio / Resource Catalog / Console dynamic menus)
  • [ ] Plugin marketplace
  • [ ] More SDK languages

License ​

Apache-2.0 License