The Arena — RPS Royale : jeu multijoueur Pierre-Feuille-Ciseaux avec paris blockchain
Find a file
Ubuntu 419ed6eef0 fix(web): correct Phaser rendering and Socket.io API URL for Docker
- Rewrite /play page to use direct dynamic import inside useEffect
  instead of next/dynamic (fixes BAILOUT_TO_CLIENT_SIDE_RENDERING)
- Fix Phaser 3.86 particle API: use direct property assignment
  instead of setFrequency/setLifespan
- Add AI match detection and skip blockchain calls for AI opponents
- Pass NEXT_PUBLIC_* build args via Dockerfile/docker-compose
  so the built client points to the correct API endpoint
- Remove obsolete PlayClient.tsx

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 04:40:39 +00:00
.forgejo/workflows Phase 0: docs, CI/CD, Tailwind config, and Forgejo workflow 2026-05-24 02:19:01 +00:00
apps fix(web): correct Phaser rendering and Socket.io API URL for Docker 2026-05-24 04:40:39 +00:00
docs feat: integrate blockchain commit-reveal + on-chain match creation 2026-05-24 03:27:51 +00:00
packages/shared feat: integrate blockchain commit-reveal + on-chain match creation 2026-05-24 03:27:51 +00:00
.dockerignore Fix Docker builds: pnpm workspaces, OpenSSL, and Next.js standalone 2026-05-24 02:48:20 +00:00
.env.example Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00
.gitignore Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00
CLAUDE.md Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00
docker-compose.prod.yml Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00
docker-compose.yml fix(web): correct Phaser rendering and Socket.io API URL for Docker 2026-05-24 04:40:39 +00:00
package.json Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00
pnpm-lock.yaml Fix build errors: Phaser SSR, TypeScript types, and ArenaScene logic 2026-05-24 02:29:32 +00:00
pnpm-workspace.yaml Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00
README.md Initial commit: monorepo structure, smart contract, server, and Phaser frontend 2026-05-24 02:14:42 +00:00

The Arena — RPS Royale

Un jeu multijoueur Pierre-Feuille-Ciseaux en 2D premium avec paris sur la blockchain (pattern commit-reveal anti-triche), animations cinématiques et musique adaptive.

Démo en ligne

Stack technique

Couche Technologie
Moteur 2D Phaser 3 (WebGL)
Frontend Next.js 15 + Tailwind CSS
Temps réel Node.js + Socket.io
API & DB Express + Prisma ORM + PostgreSQL 17
Cache Redis
Blockchain Hardhat + Solidity + Ethers.js v6
Audio Howler.js
CI/CD Forgejo Actions
Reverse Proxy Nginx Proxy Manager

Structure du monorepo

rps-royale/
├── apps/
│   ├── web/         # Next.js + Phaser (jeu)
│   ├── server/      # Node.js + Socket.io + API
│   └── contracts/   # Hardhat + Solidity
├── packages/
│   └── shared/      # Types et constantes partagés
└── docker-compose.yml

Développement local

Prérequis

  • Node.js 20+
  • pnpm 9+
  • Docker & Docker Compose

Installation

# À la racine du monorepo
pnpm install

# Démarrer la base de données et Redis
docker-compose up -d rps-db rps-redis hardhat-node

# Générer les types Prisma et migrer la DB
pnpm db:generate
pnpm db:migrate

# Compiler et déployer le contrat en local
pnpm contract:compile
pnpm contract:deploy:local

# Lancer le serveur et le frontend (dans deux terminaux)
pnpm --filter server dev
pnpm --filter web dev

Déploiement production

Le déploiement est entièrement automatisé via Forgejo Actions. Un push sur la branche main déclenche :

  1. Build des images Docker
  2. Déploiement sur le VPS via SSH + docker-compose

Voir docs/DEPLOYMENT.md pour les détails.

Game Design

Le jeu repose sur un pattern commit-reveal blockchain pour garantir l'intégrité :

  1. Commit : chaque joueur envoie le hash de son choix + nonce secret
  2. Suspense : phase cinématique avec musique et particules
  3. Reveal : les joueurs dévoilent leur nonce et choix
  4. Résultat : le smart contract vérifie les hashes et distribue le pot

Voir docs/GAME_DESIGN.md pour la documentation complète.

Licence

MIT