A fully decentralized Texas Hold'em poker game built on Avalanche blockchain with AI opponents, real money stakes, and Supabase backend for persistent game history and leaderboards.
- 3-Player Texas Hold'em - Play against 2 AI opponents
- AI Personalities - AGGRESSIVE, TIGHT, LOOSE, CONSERVATIVE personalities
- Smart Hand Evaluation - pokersolver library for accurate hand rankings
- Real Betting - Chip stacks, bet sliders, all-in mechanics
- Game Stages - PreFlop, Flop, Turn, River, Showdown
- Real Money Poker - Entry fees in AVAX, winner payouts from smart contract
- Wallet Support - MetaMask & Core Wallet
- Avalanche Fuji - Testnet for development (~$0.06 per game)
- Smart Contract - Solidity escrow (joinGame, payWinner, setEntryFee)
- On-Chain Transparency - All transactions logged on blockchain
- Supabase PostgreSQL - Persistent game history
- Player Profiles - Wallet-based identification
- Nodepoints Loyalty - Earn points for wins (50 base + 10รprofit)
- Leaderboard - Top 10 rankings by nodepoints
- Game Analytics - W/L record, ROI, win streaks
- Beautiful Dark Theme - Modern gradient design
- Smooth Animations - Framer Motion transitions
- Responsive Design - Works on desktop & tablet
- Real-Time Logging - Game ledger with transaction hashes
- Settings Panel - Contract address configuration
- Node.js 16+
- MetaMask or Core Wallet
- Test AVAX from Avalanche Faucet (free)
-
Clone & Install
git clone <your-repo> cd web3-poker npm install
-
Setup Environment Variables
cp .env.example .env.local # Add your Supabase credentials if desired # (Optional - game works without backend)
-
Run Locally
npm run dev # Opens at http://localhost:3000 -
Deploy Smart Contract (Optional - for real stakes)
- Go to https://remix.ethereum.org/
- Copy
PokerGame.sol - Deploy to Avalanche Fuji
- Update contract address in Settings panel
| Layer | Technology |
|---|---|
| Frontend | React 19 + TypeScript + Vite |
| Styling | Tailwind CSS + Motion animations |
| Blockchain | ethers.js v6 + Solidity + Avalanche |
| Backend | Supabase (PostgreSQL) |
| Game Logic | pokersolver + custom AI |
| Wallets | MetaMask + Core Wallet |
web3-poker/
โโโ src/
โ โโโ lib/
โ โ โโโ gameLogic.ts # Poker rules & AI
โ โ โโโ web3.ts # Blockchain integration
โ โ โโโ supabaseClient.ts # Database operations
โ โโโ components/
โ โ โโโ PokerGame.tsx # Main game component
โ โ โโโ ui/ # shadcn components
โ โโโ App.tsx
โ โโโ main.tsx
โโโ PokerGame.sol # Smart contract
โโโ .env.example # Environment template
โโโ vite.config.ts # Build config
โโโ tsconfig.json # TypeScript config
โโโ package.json
Follows standard poker hand rankings (High Card โ Royal Flush)
- Starting chips: 1000
- Minimum bet: 10
- No limit (pot-style betting)
- All-in allowed
- PreFlop - 2 hole cards, first betting round
- Flop - 3 community cards, betting round
- Turn - 4th community card, betting round
- River - 5th community card, final betting round
- Showdown - Best 5-card hand wins pot
| Type | Playstyle | Aggression |
|---|---|---|
| AGGRESSIVE | Bluffs often, raises frequently | 90% |
| TIGHT | Plays premium hands only | 50% |
| LOOSE | Plays many hands, loose calls | 70% |
| CONSERVATIVE | Folding-heavy, risk-averse | 30% |
Game works perfectly without Supabase, but with setup you get persistent stats!
See SUPABASE_SETUP_GUIDE.md for detailed instructions.
Quick version:
- Create free account at https://supabase.com
- Get URL + Anon Key from Settings โ API
- Update
.env.localwith credentials - Run SQL schema in Supabase editor
- Game automatically syncs player stats
Deploy PokerGame.sol on Avalanche Fuji:
contract PokerGame {
function joinGame() payable public // Pay entry fee
function payWinner(address winner) onlyOwner // Payout winner
function setEntryFee(uint256 fee) onlyOwner // Admin control
}See REMIX_INTEGRATION_GUIDE.md for step-by-step deployment.
npm run dev # Start dev server
npm run build # Compile for production
npm run preview # Test production build locally
npm run lint # Check TypeScript- Gas Cost: ~$0.06 per game on Avalanche Fuji
- Block Time: 2-3 seconds
- UI Load Time: <2 seconds
- Hand Evaluation: Instant (<100ms)
- Private keys never leave your wallet
- Smart contract handles fund escrow
- Supabase auth via wallet signature (EIP-191)
- RLS policies restrict database access
- Contract is NOT audited (development version)
User Wallet (MetaMask/Core)
โ
ethers.js (Web3 Library)
โ
PokerGame.sol (Avalanche Blockchain)
โ
Game Logic + AI (Client-side)
โ
Supabase (Optional: Game History & Stats)
โ
React UI (Tailwind + shadcn)
- PROJECT_STATUS.md - Complete project overview
- SUPABASE_SETUP_GUIDE.md - Backend configuration
- REMIX_INTEGRATION_GUIDE.md - Smart contract deployment
- AVALANCHE_CORE_SETUP.md - Network + wallet setup
- ON_CHAIN_DEPLOYMENT.md - 5-minute quickstart
- Deploy smart contract on Remix (free)
- Set up Supabase (free tier)
- Run
npm run build - Deploy to Vercel/Netlify
- Deploy contract on Avalanche C-Chain
- Use mainnet Supabase project
- Add security policies (RLS)
- Audit smart contract before real funds
See ON_CHAIN_DEPLOYMENT.md for instructions.
- Fork the repo
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push branch (
git push origin feature/amazing) - Open Pull Request
MIT License - see LICENSE file
npm run dev
# Connect wallet โ Play game โ Earn AVAX + nodepoints!Built with โค๏ธ using Web3 technologies. Have fun and play responsibly!