PROJECT FILE · 2026 · GAME PLATFORM PHP

Global Game Platform

Three-tier settlement across fiat, platform coins, and game coins

Global Game Platform serves international players. After signing up and depositing,…

AboutGlobal Game Platform

WHO IT'S FOR

International gamersGame operations teamsGlobal publishersPayments and risk teams
PHP 8.3webman v2MySQL 8.0RedisElasticsearchFlutter WebReact 19Angular 21HarmonyOS ArkTS

Global Game Platform serves international players. After signing up and depositing, players convert fiat into platform coins, then into per-game coins, earn or spend them in games, and convert balances back to the wallet for withdrawal. The admin side covers games, withdrawal review, users, and payments.

It uses two webman services, admin and service, sharing a packages layer. Fiat, platform coin, and game coin settlements all use bcmath; 18 payment gateway adapters, HMAC-signed provider integration, risk and anti-cheat controls, and reconciliation form the platform foundation.

The typical player journey is to sign up, deposit fiat for platform coins, exchange them at the game's rate into game coins, and enter the game. Game providers settle wins and losses through HMAC-signed settle callbacks; players convert balances back to platform coins, request a withdrawal, and receive payment via PayPal Payout after KYC limits and admin review.

Splitting admin and service into two webman services that share the packages layer lets the admin and player surfaces scale independently while staying in sync. Mandatory bcmath arithmetic, fail-closed payment callbacks, and optimistic wallet locks trade concurrency and reconciliation risk for deterministic constraints.

79Tables
18Payment gateways
13Product languages
275API routes
51Shared models
7Platform OAuth

Same codebase, two editions

Both editions share one codebase. The open-source edition keeps the core capabilities of a standalone game aggregation platform; the commercial edition adds marketing operations, reconciliation and settlement, CDN management, and Angular/HarmonyOS client delivery.

OPEN SOURCE

Open Source

  • Game aggregation and provider integration
  • Wallet/payment
  • Risk control/anti-cheat and audit
  • Activity engine, VIP, and tickets
  • React 19 + Flutter clients
  • RBAC and 13 languages
COMMERCIAL

Commercial

  • Coupon claim, redemption, and statistics
  • Tournaments and championships
  • Team and guild system
  • Achievement system
  • Reconciliation/settlement (batches/bills/variance)
  • Five-vendor CDN management
  • Angular 21 admin and player clients
  • HarmonyOS admin and player clients
DimensionOpen SourceCommercial
Coverage404 PHP files / 75 controllers / 55 models / 243 route declarations (admin 146 + service 97; excluding 3 Route::resource; 246 including resource) / 67 tables (2026-10-28 snapshot); shared foundation: 18 payment gateways, 8 risk evaluators, JWT/RBAC/2FA/OAuth, three-tier wallet with bcmath, provider HMAC/GameSdk, MySQL aggregates + Redis + Elasticsearch (no ClickHouse runtime); aggregation, provider integration, wallet/payment, risk/anti-cheat, activities, VIP/tickets439 PHP files / 82 controllers / 67 models / 275 route declarations (admin 164 + service 111; excluding 3 Route::resource; 278 including resource) / 79 tables (2026-10-28 snapshot); same shared foundation; commercial-only: coupons, tournaments, teams/guilds, achievements, reconciliation/settlement (batch/statement/diff, 3 tables), five CDN vendors (Cloudflare / CloudFront / Alibaba Cloud / Tencent Cloud / Huawei Cloud), C-end VIP/achievement APIs; 7 controllers / 12 models / 12 tables / 32 routes (admin 18 / service 14); extra GroupSweepWorker process; 4 feature flags (OSS 2; tournament and achievements are commercial-only, default off); 4 clients each for admin and players (OSS 2 each); 13 product languages, docs in Chinese and English only; zero OSS-only controllers/models/routes/services, commercial is the code-level superset; commercial includes uncommitted working-tree fixes, OSS is an independent snapshot
SecurityJWT, ProviderAuth, SdkSessionAuth, RBAC, rate limiting, SecurityFilter, 2FA, 8 risk evaluators, audit, and field encryptionSame authentication, risk, audit, and encryption middleware and evaluators; no extra security modules found; changes are business and client focused
Performance and scalewebman resident processes, Redis, Elasticsearch, 7 workers, WebSocket chat-wsSame stack; 8 workers (extra GroupSweepWorker); analytics run on MySQL aggregates
Data and searchMySQL 67 tables + Redis + Elasticsearch; games, providers, orders, and wallet dataMySQL 79 tables + Redis + Elasticsearch; adds coupon, tournament, group, achievement, reconciliation, and CDN data
Tests and qualityfrontend/application test files 74 (including the mini-game; 41 admin/apps + 15 Flutter + 12 React + 6 game); plus 4 tests/api scripts + 2 phpunit.xml; PHPUnit test classes 0frontend/application test files 132 (including the mini-game; current 70 admin/apps + 29 Angular + 15 Flutter + 12 React + 6 game); plus 4 tests/api scripts + 2 phpunit.xml; PHPUnit test classes 0; CI adds frontend-angular
Deployment and opsDocker Compose 8 services; health checks, Prometheus metrics, 7 processesSame 8 services with health and metrics endpoints; 8 processes; CI adds an Angular build; same topology
Clients and i18nReact 19 + Flutter (separate admin and player clients); 13 languagesReact 19 + Angular 21 + Flutter + HarmonyOS (separate admin and player clients); 13 languages
ExtensibilityProviderFactory/GameProvider/ThirdPartyProvider + GameSdk; versioned /api/provider, /api/game, /api/v1 APIsSame provider/SDK/versioned APIs; adds tournament, group, coupon, reconciliation, and CDN APIs, a wider extension surface
License and supportPersonal study/research; commercial use requires written authorizationCommercial license; delivery, support, and pricing: erik@erik.xyz
Use casesPersonal study, research, secondary development, small-scale self-hosted validationCommercial deployment needing full marketing operations, multi-client delivery, reconciliation/settlement, and CDN
Open-source GitHub repository ↗

Features built for real scenarios

Core capabilities of the current release; see the changelog for the full history.

01SmileThree-tier currency settlement

Fiat, platform coins, and game coins are isolated by layer; all amounts use bcmath.

02JoyMulti-gateway deposits

18 payment gateways with callback signature checks, idempotency, and automatic crediting.

03CryGame coin exchange

Real-time platform-to-game coin quotes, spread revenue, and VIP rate bonuses.

04DepressedWithdrawals and KYC

Withdrawal requests, approval, payout, tiered KYC limits, and fee control.

05TerrifiedGame integration

Provider onboarding with HMAC-SHA256 signatures and a settlement callback gateway.

06AngryRisk and anti-cheat

Device fingerprints, IP reputation, account-link graphs, and a rules engine.

07CoquettishGrowth operations

Leaderboards, coupons, VIP, achievements, check-in, and social referrals.

08CuteMulti-client i18n

Four clients each for admin and players, with a unified 13-language experience.

← Swipe to explore →

Feature overview
README FigureFeature overview

One system, two perspectives

The admin console runs operations and governance; the client delivers the user experience. Both share the same business and permission boundaries.

ADMIN

Admin Console

  • User management

    Search users, change status, and inspect linked accounts.

  • Game management

    Create games, categories, and servers; configure providers and callbacks.

  • Deposit orders

    Search deposit orders, gateway transactions, and manual recovery.

  • Withdrawal review

    Review withdrawal requests, payout batches, and dual-approval switches.

  • Risk dashboard

    IP blacklist, large-amount alerts, device fingerprints, and rules engine.

  • Reconciliation

    Daily reconciliation batches, variance details, and platform revenue statistics.

  • Operations config

    Coupons, campaigns, VIP, leaderboards, and country-specific settings.

  • Audit logs

    Operation trails, source-client detection, and audit export.

CLIENT

Player Client

  • Sign-up and login

    Username and password, 7-platform OAuth, 2FA, and click captcha.

  • Wallet and deposits

    Fiat deposits, platform coin balance, and wallet transaction history.

  • Game lobby

    Game categories, search, details, servers, and leaderboards.

  • Exchange game coins

    Real-time quotes, spread display, and separate game coin wallets.

  • Withdrawal request

    KYC limits, withdrawal requests, and payout progress tracking.

  • Social center

    Friends, WebSocket messaging, groups, and share referrals.

  • Activity center

    Check-in, tasks, coupons, VIP, and achievement progress.

From the current release to the next

Delivered, in-progress and planned milestones, based on the real development stages.

Full release

Full release capabilities

Leaderboards, coupons, game categories, country settings, and ES search are complete.

Done
Ecosystem v2.0

Ecosystem expansion

Provider integration, tickets, VIP/achievement APIs, social, and the event bus are complete.

Done
v1.3.15-22

Eight release iterations

Reconciliation, deeper risk controls, a unified wallet, the activity engine, and anti-cheat are delivered.

Done
P0 Fund safety

Fund-safety hardening

Fail-closed payment callbacks, JWT validation, the event bus, and Apple verification are complete.

Done
P1 Reliability

Reliability and consistency

The shared layer and fallback wrappers are partly done; event dedup and ChatWebSocket backoff are in place, queues are confirmed unused, and ClickHouse dependency claims are removed.

In progress
P2 Observability

Observability and experience

The HarmonyOS client is delivered; VIP/achievement client pages, frontend completion, and the WebSocket path are still in progress.

In progress

Structure determines how far it can go

The platform is split into admin and service webman services that share models and services in a packages layer. Nginx routes by path prefix; MySQL stores transactions, Redis handles cache, sessions, and the event bus; analytics run on MySQL aggregates, and Elasticsearch provides search.

L01
Client LayerFlutter · React · Angular · HarmonyOS

Four player clients and four admin clients call /api/v1 and /admin/v1 respectively.

L02
Access LayerNginx · CORS · Security Filter · Rate Limit

Path-prefix routing with unified CORS, security scanning, and sliding-window rate limiting.

L03
Application Layeradmin:8789 · service:8792 · Provider

Two independently deployed services; providers and 18 payment gateways adapt business flows.

L04
Shared LayerShared packages · 51 models · 12 services

Shared models and services across both services, reusing BcMath, encryption, circuit breaking, and retries.

L05
Data LayerMySQL 8.0 · Redis · ES

Transaction persistence, cache and sessions, MySQL aggregate analytics, and full-text search.

Global Game Platform system architecture
View full size ↗ · System Architecture
Backend
PHP 8.3webman v2JWTRBAC
Data
MySQL 8.0RedisElasticsearch
Clients
Flutter WebReact 19Angular 21HarmonyOS ArkTS
Infrastructure
Docker ComposeNginxWebSocket
MODULE MAP
Users and authenticationWalletDepositsExchangeWithdrawals and KYCGame managementSearch and leaderboardsMarketing and VIPRisk and anti-cheatReconciliation and settlementSocial and tournamentsMulti-client and i18n

Security is not an afterthought

From boundaries and identity to data and failure, every layer is designed around zero trust.

Defense in depth

18 security filters block XSS, SQL injection, CSRF, and path traversal.

Payment security

Provider whitelist on callbacks, reject on signature failure, bccomp amount checks, and transactional crediting.

Authentication and authorization

JWT dual tokens, RBAC permissions, concurrent-session limits, and click captcha.

Data encryption

AES-256-CBC in transit, AES-128-ECB at rest, and Hashids ID encoding.

Wallet concurrency

Optimistic locks prevent concurrent debits and duplicate credits; every transaction is recorded.

Risk audit

IP blacklist, large-amount alerts, device fingerprints, operation logs, and account lockout.

Zero trust · Least privilege · Auditable end to end

Trade-offs before code

From business boundaries to code boundaries, these are the principles this project keeps returning to.

01

Three-tier isolation

Fiat, platform coins, and game coins each have a separate ledger; exchange spreads are booked explicitly so cross-tier balances cannot be rewritten directly.

02

Dual services, one source

admin and service deploy independently but share the packages layer, reducing drift between two copies.

03

Fail-closed callbacks

Payment callbacks are rejected when keys are missing, signatures fail, or amounts mismatch: better to miss a credit than credit wrongly.

04

Optimistic wallet locks

Balance changes use optimistic locks and transactional journals, sacrificing some concurrency for deterministic protection against duplicate credits and overdrafts.

Dicey expression Smile

Dicey

A purple die holding a gold coin; the die stands for games and probability, while the coin echoes deposits and multi-tier currencies.

Get it running

A condensed path from the README to a minimal working environment.

PHP 8.1+MySQL 8.0+Redis 6.0+Composer 2.xFlutter SDK 3.x (optional)
01
Get the code

Clone the repository and enter the project directory.

git clone https://github.com/erikwang2013/game-platform-php && cd game-platform-php
02
Start the installer

Run the installation wizard with PHP's built-in server.

php -S 0.0.0.0:8888 -t install/
03
Complete the wizard

Follow the prompts for environment checks, database, and administrator setup.

04
Install dependencies

Install Composer dependencies for admin and service.

cd admin && composer install && cd ../service && composer install
05
Start services

Start the admin and service processes in the background.

cd admin && php start.php start -d && cd ../service && php start.php start -d
06
Remove the installer

After installation, delete the install directory to avoid exposure.

rm -rf install/

From first login to a full run

A minimal operating path covering admin setup, client usage and key APIs.

01Admin login

Open the admin console and sign in with the account created during installation.

02Configure games

Create games, categories, and servers, and set exchange rates and spreads.

03Configure gateways

Enable payment gateways and configure callback whitelists and signature parameters.

04Player deposit

Players sign up, choose a fiat currency and gateway, and platform coins are credited automatically.

05Exchange and settlement

Players exchange game coins to enter games; provider callbacks settle the results.

06Withdrawal review

Admins review withdrawals, pay out via PayPal Payout, and sync batch status.

Every iteration leaves a trace

Latest v1.3.58; releases keep coming.

v1.3.58

C-end VIP/achievement APIs, event deduplication, ChatWebSocket Redis backoff, and ClickHouse/queue claim cleanup; docs now Chinese/English only and the open-source/commercial comparison is refreshed.

v1.3.57

Maintenance update and bug fixes

v1.3.56

fix(service): DB password fallback must not be the literal 'root' (CI hit 1045 on mysql:8.0.46)

v1.3.55

fix(install): move ecosystem-extension seeds after CREATE TABLE (fixes 1146 on the empty-database CI path)

v1.3.54

docs(all),fix(admin,service,install): reconcile six documentation families + fix dependency roots + line/path reference families

v1.3.53

fix(admin,service,admin-apps): 17 admin audit defects + 5 new findings (including service test DB isolation)

v1.3.52

feat(admin,admin-apps,service,ci): redesign both Angular trees + user wallet + frontend CI + /metrics scrape token + 17 real defects

v1.3.51

feat(c-end-apps): align both client trees with client APIs (2FA self-service/tickets/social/KYC/upload/invite/campaign/export)

v1.3.50

feat(admin,service,i18n): admin modules across four trees + permission tree/pagination + 13-language backend responses + list-header and repaint fixes