Skip to content

Mystic Numbers — Realm-Based Routing

Mystic Numbers uses a realm-based multi-server architecture where each realm operates as an independent game world with its own dedicated stack. Realms are accessed via subdomains (global1.mystic.tribewarez.com, global2.mystic.tribewarez.com, ...) and are managed by an external proxy that routes players to their assigned realm.

Architecture

Player Browser
       |
global-N.mystic.tribewarez.com
       |
External Proxy (185.163.116.53:80/443)
  - TLS termination
  - Realm routing (N → specific server stack)
  - Rate limiting per realm
       |
nginx-proxy (Docker internal)
       |
  +---------+---------+---------+---------+
  |         |         |         |         |
app:3000  api:80   ws:8081   mercure:80
Next.js   Symfony  Socket.IO   SSE Hub
          PHP-FPM

Realm Subdomains

SubdomainPurpose
mystic.tribewarez.comLanding page — leaderboards, stats, marketplace
global1.mystic.tribewarez.comRealm 1 game world
global2.mystic.tribewarez.comRealm 2 game world
globalN.mystic.tribewarez.comAdditional realms on demand
api.mystic.tribewarez.comSymfony REST API (shared or per-realm)
ws.mystic.tribewarez.comWebSocket server for real-time chat

Landing Page (mystic.tribewarez.com)

The main landing page serves as the game hub with three primary sections:

Leaderboards

Real-time rankings showing:

  • Top players by score across all realms
  • Top guilds by total shards
  • Weekly/monthly/all-time leaderboards
  • Per-realm leaderboard filters

Statistics

Aggregate game metrics:

  • Active players online (total and per realm)
  • Total games played
  • Tokens earned and spent
  • Realm population distribution
  • Challenge completion rates

Marketplace

Player-to-player trading:

  • Listed items with prices (NMTC/PTtC)
  • Purchase history and volume charts
  • Featured listings
  • Buy orders and sell orders
  • Recent transactions feed

Realm Assignment

Players are assigned to a realm on first login:

  1. Player authenticates via Google OAuth
  2. Backend checks realm capacity (players online, CPU/memory usage)
  3. Player is assigned to the least-loaded realm
  4. Subsequent logins route to the same realm (sticky session via cookie or DB)

Realms can be added dynamically by provisioning a new server stack and registering the globalN.mystic.tribewarez.com subdomain.

Cross-Realm Features

FeatureCross-Realm Support
LeaderboardsAggregated across all realms
ChatPer-realm only (WebSocket is realm-local)
MarketplaceShared database, same listings across realms
Token balancesShared Solana on-chain wallet (not per-realm)

Technical Stack Per Realm

Each realm runs the full Mystic Numbers stack:

ComponentStackInternal Port
Web AppNext.js 163000
REST APISymfony (PHP)9000 (PHP-FPM)
WebSocketNode.js, Socket.IO8081
SSE HubMercure80
DatabaseMariaDB3306

Configuration

Realm routing is configured through the external proxy (haproxy/nginx on the v-server) and the Docker nginx-proxy. Adding a realm requires:

  1. Provisioning a new server stack (Docker Compose with realm-specific env vars)
  2. Adding the globalN.mystic.tribewarez.com DNS record
  3. Configuring the external proxy to route globalN to the new stack's nginx-proxy

TribeWarez Blockchain Ecosystem