Arkeo Racing is a real-time multiplayer browser game that visualizes Arkeo infrastructure performance as a racing simulation. This repo is an MVP bootstrap with a Node.js + TypeScript API, a React + Vite web UI, and Postgres persistence.
Important rules:
- Play token only (no real money, no withdrawals)
- House must never lose: total payouts per race <= 90% of total intake
apps/
api/ Express + ws + Prisma race orchestrator
web/ Vite + React + Tailwind UI
infra/
docker-compose.yml
.env
env.example
config/postgres-data/ (persistent Postgres data)
config/subscriber-data/ (subscriber snapshot data)
docs/
PRD_TRD_ADDENDUM.md
From repo root:
cd infra
# Edit .env (copy from env.example if needed)
mkdir -p config/postgres-data
mkdir -p config/subscriber-data
docker compose up --build
Stop:
cd infra
docker compose down
Reset data (destructive):
cd infra
docker compose down
rm -rf config/postgres-data/*
- API: http://localhost:8081
- Web: http://localhost:8081
- WS: ws://localhost:8081/ws?raceId=
GET /api/healthGET /api/meGET /api/me/walletPOST /api/me/walletPOST /api/me/wallet/disconnectPOST /api/me/nicknameGET /api/me/wallet/balanceGET /api/bankGET /api/me/tickets?raceId=GET /api/me/payouts?raceId=GET /api/races/currentGET /api/races?limit=GET /api/races/:raceIdGET /api/races/:raceId/providersGET /api/races/:raceId/resultsPOST /api/races/:raceId/ticketsPOST /api/races/:raceId/picksPOST /api/admin/races/create-nowPOST /api/admin/races/start-nowPOST /api/admin/races/end-nowGET /api/subscriber/services
- Lobby: picks and ticket purchase
- Race: live SVG track + WS updates
- Results: placements + payouts
- Live mode is the default (
RACING_MODE=live) and uses subscriber discovery + allowlisted probes. - Subscriber probe endpoint default:
SUBSCRIBER_PROBE_PATH=/api/probe. - Subscriber snapshots are refreshed per race and written to
SUBSCRIBER_SNAPSHOT_DIR(default/app/data/subscriber), includinglisteners.json. - Postgres data persists under
infra/config/postgres-data. - Keplr wallet linking stores the address + nickname and reads the ARKEO balance from LCD.
- Ticket entry requires an on-chain payment to the bank address; paste the tx hash in the UI.
- Stake amounts are configured with
ENTRY_FEE_UARKEOandPICK3_FEE_UARKEOininfra/.env. - Keplr stake sends use
VITE_ARKEO_GAS_PRICEandVITE_ARKEO_GAS_LIMITfrominfra/.env. - Hot wallet files are stored inside the container; the mnemonic is written to
infra/.envon first creation whenARKEOD_MNEMONICis empty. - Source builds are enabled by default (
ARKEOD_BUILD_FROM_SOURCE=1) to support arm64;ARKEOD_SOURCE_REF=masterby default (pin to a tag for reproducibility).
- Ticket cost:
ENTRY_FEEfor both single and pick-3. payout_budget = floor(intake * 0.90).placement_budget = payout_budget * 0.60,jackpot_budget = payout_budget * 0.40.- Single payouts split by placement budget: 1st 50%, 2nd 30%, 3rd 20%.
- Pick-3 jackpot splits
jackpot_budgetequally among winners; if no winners, jackpot pays out 0.