Beexoccer is a turn-based tactical mini soccer experience that blends arcade rebounds with lightweight strategy. Matches feel like a polished tabletop game: you drag circular tokens representing each player, bounce the ball off the walls, and race to score before the shot clock expires. The project ships with a Hardhat smart-contract workspace plus a React + TypeScript frontend styled after the metallic green Beexo identity.
- Field: bright top-down “Soccer de Plato” pitch with alternating green bands, sharp white lines, and stylized stands.
- UI: dark neutral base (#050607–#111) contrasted with Beexo metallic greens (#1E8F32 / #00B870), neon accents, and bold typography (Chakra Petch).
- Highlights: amber/orange halos indicate active turns; red signals alerts or forfeits.
- Drag-and-release disks to strike a shared ball with light physics and wall rebounds.
- Alternating 15-second turns; missed turns are skipped.
- Two modes at launch: fast bot scrimmage (off-chain) and wagered PvP via XO-CONNECT + Polygon escrow.
- Each match ends when a player reaches the configured goal count (2 / 3 / 5).
Beexoccer
├── README.md
├── .gitignore
├── package.json # Hardhat toolchain + scripts
├── tsconfig.json # Hardhat TypeScript settings
├── hardhat.config.ts # Polygon Amoy + local networks
├── contracts/MatchManager.sol
├── scripts/deploy.ts # Deploy helper for Polygon testnet
├── frontend/ # React + Vite UI
│ ├── package.json
│ ├── tsconfig*.json
│ ├── vite.config.ts
│ └── src/
│ ├── components/
│ ├── views/
│ ├── services/
│ ├── hooks/
│ ├── config/
│ └── styles/
└── .env.example
- Node.js 18+
- npm 9+
- Foundry or Hardhat-compatible wallet for contract interactions
- Polygon Amoy/Mumbai RPC URL + funded test account for deployments
- XO-CONNECT compatible Beexo Wallet for alias + signature flows
-
Clone and install root dependencies
git clone <repo> cd Beexoccer npm install
-
Install frontend
cd frontend npm install
-
Copy env templates
Copy-Item .env.example .env cd frontend Copy-Item .env.example .env.local
POLYGON_AMOY_RPC=
PRIVATE_KEY=
STABLE_TOKEN_ADDRESS=VITE_XO_CONNECT_PROJECT_ID=
VITE_POLYGON_AMOY_RPC=
VITE_MATCH_MANAGER_ADDRESS=cd frontend
npm run devThis spins up Vite with hot reload plus mock data for aliases/balances when XO-CONNECT is not yet available.
-
Install realtime server deps (one-time):
cd server npm install
-
Start the socket server (default :4000):
npm run dev
-
In another terminal, start the frontend with the realtime URL set (defaults to
http://localhost:4000):cd frontend $Env:VITE_REALTIME_URL="http://localhost:4000"; npm run dev
-
Open the app (default Vite port 5173) and play the demo match. The server emits snapshots/events; dragging a chip will move physics on the server and stream back to the UI. Use two browser tabs to see synchronized state.
-
Fund the deploying address with Amoy test MATIC.
-
Set RPC + private key inside
.env. -
Run Hardhat deploy script:
npx hardhat run scripts/deploy.ts --network polygonAmoy
-
Copy the emitted contract address into
frontend/.envasVITE_MATCH_MANAGER_ADDRESS.
frontend/src/services/xoConnectService.tsinitializes the SDK, fetches the user alias, and exposes provider/signer objects.- UI components call
useXoConnecthook to read alias, authenticated balance, and signature helpers. - When XO-CONNECT is unavailable (dev mode), the service falls back to deterministic mocks so screens remain testable.
MatchManager.sol handles creation, escrow, and settlement:
createMatch(goals, isFree, stakeAmount, stakeToken)registers lobbies.joinMatch(matchId)lets challengers lock stakes if required.reportResult(matchId, winner)distributes escrow and marks match ended.- All state transitions are thoroughly documented to simplify audits.
- Advanced Physics – Spin, multi-collision resolution, and spectator replay.
- Power Plays – One-off boosts purchased with Beexo credits.
- Season Pass – Ranked ladder and cosmetic unlocks.
- Cross-Platform – Capacitor mobile wrappers + haptics.
- Analytics – Match history, heat maps, rage-quit detection.
- Strong TypeScript typing for services, hooks, and match DTOs.
- Modular UI architecture: screens compose smaller controls (buttons, stat cards, field canvas).
- Environment-driven configuration with zero hard-coded RPC endpoints.
- Explicit TODO markers for future physics, matchmaking, AI, and blockchain enhancements.
- Exhaustive comments explaining gameplay, blockchain steps, and UX intentions.
- Fork
- Create a feature branch
- Add or update tests (smart contract unit tests or UI spec tests when applicable)
- Submit PR with screenshots or screen recordings for UI tweaks
-
Conectar repositorio a Vercel:
- Ve a vercel.com
- Importa tu repositorio de GitHub
- Configura:
- Root Directory:
frontend - Build Command:
npm run build - Output Directory:
dist
- Root Directory:
-
Variables de entorno en Vercel:
VITE_POLYGON_AMOY_RPC=https://polygon-amoy.drpc.org VITE_MATCH_MANAGER_ADDRESS=0x9197Aa4F607fC2e245411eb69ab2d72CDa02CC2b VITE_REALTIME_URL=https://tu-server.railway.app VITE_ENABLE_REALTIME=true -
Deploy: Vercel construirá automáticamente en cada push a main.
Vercel no soporta WebSockets persistentes. Usa Railway, Render, o Fly.io:
Railway:
- Ve a railway.app
- New Project → Deploy from GitHub repo
- Configura:
- Root Directory:
server - Start Command:
npm run build && npm start
- Root Directory:
- Variables de entorno:
PORT=4000 - Railway te dará una URL como
https://beexoccer-server.up.railway.app - Copia esa URL a
VITE_REALTIME_URLen Vercel
Render (alternativa):
- Ve a render.com
- New → Web Service → Connect repo
- Configura:
- Root Directory:
server - Build Command:
npm install && npm run build - Start Command:
npm start
- Root Directory:
- Render te dará una URL para usar en
VITE_REALTIME_URL
El contrato MatchManager está en Polygon Amoy:
0x9197Aa4F607fC2e245411eb69ab2d72CDa02CC2b
Para redesplegar:
npx hardhat run scripts/deploy.ts --network polygonAmoyMIT-style placeholder; update when product charter finalizes.