Fiat, platform coins, and game coins are isolated by layer; all amounts use bcmath.
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
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.
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
- 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
- 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
| Dimension | Open Source | Commercial |
|---|---|---|
| Coverage | 404 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/tickets | 439 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 |
| Security | JWT, ProviderAuth, SdkSessionAuth, RBAC, rate limiting, SecurityFilter, 2FA, 8 risk evaluators, audit, and field encryption | Same authentication, risk, audit, and encryption middleware and evaluators; no extra security modules found; changes are business and client focused |
| Performance and scale | webman resident processes, Redis, Elasticsearch, 7 workers, WebSocket chat-ws | Same stack; 8 workers (extra GroupSweepWorker); analytics run on MySQL aggregates |
| Data and search | MySQL 67 tables + Redis + Elasticsearch; games, providers, orders, and wallet data | MySQL 79 tables + Redis + Elasticsearch; adds coupon, tournament, group, achievement, reconciliation, and CDN data |
| Tests and quality | frontend/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 0 | frontend/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 ops | Docker Compose 8 services; health checks, Prometheus metrics, 7 processes | Same 8 services with health and metrics endpoints; 8 processes; CI adds an Angular build; same topology |
| Clients and i18n | React 19 + Flutter (separate admin and player clients); 13 languages | React 19 + Angular 21 + Flutter + HarmonyOS (separate admin and player clients); 13 languages |
| Extensibility | ProviderFactory/GameProvider/ThirdPartyProvider + GameSdk; versioned /api/provider, /api/game, /api/v1 APIs | Same provider/SDK/versioned APIs; adds tournament, group, coupon, reconciliation, and CDN APIs, a wider extension surface |
| License and support | Personal study/research; commercial use requires written authorization | Commercial license; delivery, support, and pricing: erik@erik.xyz |
| Use cases | Personal study, research, secondary development, small-scale self-hosted validation | Commercial deployment needing full marketing operations, multi-client delivery, reconciliation/settlement, and CDN |
Features built for real scenarios
Core capabilities of the current release; see the changelog for the full history.
18 payment gateways with callback signature checks, idempotency, and automatic crediting.
Real-time platform-to-game coin quotes, spread revenue, and VIP rate bonuses.
Withdrawal requests, approval, payout, tiered KYC limits, and fee control.
Provider onboarding with HMAC-SHA256 signatures and a settlement callback gateway.
Device fingerprints, IP reputation, account-link graphs, and a rules engine.
Leaderboards, coupons, VIP, achievements, check-in, and social referrals.
Four clients each for admin and players, with a unified 13-language experience.
← Swipe to explore →
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 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.
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 capabilities
Leaderboards, coupons, game categories, country settings, and ES search are complete.
DoneEcosystem expansion
Provider integration, tickets, VIP/achievement APIs, social, and the event bus are complete.
DoneEight release iterations
Reconciliation, deeper risk controls, a unified wallet, the activity engine, and anti-cheat are delivered.
DoneFund-safety hardening
Fail-closed payment callbacks, JWT validation, the event bus, and Apple verification are complete.
DoneReliability 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 progressObservability and experience
The HarmonyOS client is delivered; VIP/achievement client pages, frontend completion, and the WebSocket path are still in progress.
In progressStructure 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.
Four player clients and four admin clients call /api/v1 and /admin/v1 respectively.
Path-prefix routing with unified CORS, security scanning, and sliding-window rate limiting.
Two independently deployed services; providers and 18 payment gateways adapt business flows.
Shared models and services across both services, reusing BcMath, encryption, circuit breaking, and retries.
Transaction persistence, cache and sessions, MySQL aggregate analytics, and full-text search.
Security is not an afterthought
From boundaries and identity to data and failure, every layer is designed around zero trust.
18 security filters block XSS, SQL injection, CSRF, and path traversal.
Provider whitelist on callbacks, reject on signature failure, bccomp amount checks, and transactional crediting.
JWT dual tokens, RBAC permissions, concurrent-session limits, and click captcha.
AES-256-CBC in transit, AES-128-ECB at rest, and Hashids ID encoding.
Optimistic locks prevent concurrent debits and duplicate credits; every transaction is recorded.
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.
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.
Dual services, one source
admin and service deploy independently but share the packages layer, reducing drift between two copies.
Fail-closed callbacks
Payment callbacks are rejected when keys are missing, signatures fail, or amounts mismatch: better to miss a credit than credit wrongly.
Optimistic wallet locks
Balance changes use optimistic locks and transactional journals, sacrificing some concurrency for deterministic protection against duplicate credits and overdrafts.
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.
Clone the repository and enter the project directory.
git clone https://github.com/erikwang2013/game-platform-php && cd game-platform-phpRun the installation wizard with PHP's built-in server.
php -S 0.0.0.0:8888 -t install/Follow the prompts for environment checks, database, and administrator setup.
Install Composer dependencies for admin and service.
cd admin && composer install && cd ../service && composer installStart the admin and service processes in the background.
cd admin && php start.php start -d && cd ../service && php start.php start -dAfter 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.
Open the admin console and sign in with the account created during installation.
Create games, categories, and servers, and set exchange rates and spreads.
Enable payment gateways and configure callback whitelists and signature parameters.
Players sign up, choose a fiat currency and gateway, and platform coins are credited automatically.
Players exchange game coins to enter games; provider callbacks settle the results.
Admins review withdrawals, pay out via PayPal Payout, and sync batch status.
If this project helped you
Scan WeChat or Alipay to support the project. Click a QR code to enlarge.


Thank you for your support. The project will keep being maintained and improved.
Every iteration leaves a trace
Latest v1.3.58; releases keep coming.
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.
Maintenance update and bug fixes
fix(service): DB password fallback must not be the literal 'root' (CI hit 1045 on mysql:8.0.46)
fix(install): move ecosystem-extension seeds after CREATE TABLE (fixes 1146 on the empty-database CI path)
docs(all),fix(admin,service,install): reconcile six documentation families + fix dependency roots + line/path reference families
fix(admin,service,admin-apps): 17 admin audit defects + 5 new findings (including service test DB isolation)
feat(admin,admin-apps,service,ci): redesign both Angular trees + user wallet + frontend CI + /metrics scrape token + 17 real defects
feat(c-end-apps): align both client trees with client APIs (2FA self-service/tickets/social/KYC/upload/invite/campaign/export)
feat(admin,service,i18n): admin modules across four trees + permission tree/pagination + 13-language backend responses + list-header and repaint fixes