This is a code bundle for Game Crypto Casino Website. The original project is available at https://www.figma.com/design/GRQFOvqHBIhvipViMHynCY/Game-Crypto-Casino-Website.
Run npm i to install the dependencies.
Run npm run dev to start the development server.
The project now includes server API routes to manage player wallets and payouts.
Create .env.local in the project root with:
SUPABASE_URLSUPABASE_SERVICE_ROLE_KEYSUPABASE_PLAYER_WALLETS_TABLE(optional, default:player_wallets)SUPABASE_GAME_REPORTS_TABLE(optional, default:game_reports)INTERNAL_API_KEY(required, protects all/api/*routes)OXAPAY_MERCHANT_API_KEYOXAPAY_PAYOUT_API_KEYOXAPAY_CALLBACK_URL(optional fallback callback URL)OXAPAY_BASE_URL(optional, default:https://api.oxapay.com/v1)
Run SQL from supabase/player_wallets.sql and supabase/game_reports.sql in your Supabase SQL editor.
-
POST /api/player-wallets- Creates an OxaPay static wallet for a player and stores
track_id+ address in Supabase.
- Creates an OxaPay static wallet for a player and stores
-
POST /api/payout/internal- Pays out to the player's stored static address.
-
POST /api/payout/external- Pays out to any external wallet address.
-
GET /api/player-wallets/:playerId/balance- Looks up the player's
track_idand returns OxaPay payment/wallet info.
- Looks up the player's
-
POST /api/game-reports- Stores game round results posted by your game server in Supabase.
- Accepts either one report object or a
reportsarray. - Uses
reportIdas an idempotent unique key for retries.
All API endpoints require one private key via header:
x-api-key: YOUR_INTERNAL_API_KEY- or
Authorization: Bearer YOUR_INTERNAL_API_KEY
Open /docs in your app to view endpoint and payload documentation.