A multiplayer Texas Hold'em poker platform built with modern web technologies.
- Backend: BunJS + Hono
- Database: PostgreSQL + Drizzle ORM
- Real-time: WebSocket (ws library)
- Frontend: React + Tailwind CSS + shadcn/ui
- Monorepo: Turborepo
poker/
├── apps/
│ ├── admin-frontend/ # Admin dashboard (React)
│ ├── user-frontend/ # Player interface (React)
│ ├── backend/ # REST API (Bun + Hono)
│ └── websocket/ # Game server (Bun + ws)
└── packages/
├── db/ # Database schema (Drizzle)
├── types/ # Shared TypeScript types
└── ui/ # Shared UI components
- Texas Hold'em No-Limit poker
- 2-9 players per table
- 30-second turn timer (auto-fold on timeout)
- Real-time gameplay via WebSockets
- Hand evaluation and pot distribution
- Create and configure rooms (blinds, buy-in limits)
- Manage room status (open/closed)
- User management (promote/demote admins)
- Registration with 50,000 chips signup bonus
- View and join active tables
- Minimum 3 big blinds required to join a table
- Buy-in selection when joining tables
- Bun >= 1.0
- PostgreSQL >= 14
-
Clone and install dependencies
cd poker bun install -
Set up environment variables
cp .env.example .env # Edit .env with your database credentials -
Create the database
createdb poker
-
Run database migrations
bun run db:push
-
Create an admin user
Register a user through the user frontend, then manually set
is_admin = truein the database:UPDATE users SET is_admin = true WHERE email = '[email protected]';
Run all services in development mode:
bun run devOr run individual services:
# Backend API (port 3000)
cd apps/backend && bun run dev
# WebSocket server (port 3001)
cd apps/websocket && bun run dev
# User frontend (port 5173)
cd apps/user-frontend && bun run dev
# Admin frontend (port 5174)
cd apps/admin-frontend && bun run dev- User Frontend: http://localhost:5173
- Admin Frontend: http://localhost:5174
- Backend API: http://localhost:3000
- WebSocket: ws://localhost:3001
POST /api/auth/register- Register new userPOST /api/auth/login- Login
GET /api/rooms- List active roomsGET /api/rooms/:id- Get room detailsPOST /api/rooms/:id/join- Join a room (requires auth)POST /api/rooms/:id/leave- Leave a room (requires auth)
GET /api/users/me- Get current user profileGET /api/users/transactions- Get transaction history
GET /api/admin/rooms- List all roomsPOST /api/admin/rooms- Create roomPATCH /api/admin/rooms/:id- Update room statusDELETE /api/admin/rooms/:id- Delete roomGET /api/admin/users- List all usersPATCH /api/admin/users/:id/admin- Toggle admin status
auth- Authenticate with JWT tokenjoin_room- Join a roomleave_room- Leave current roomplayer_action- Send game action (fold/check/call/raise/all-in)
auth_success- Authentication successfuljoined_room- Successfully joined roomgame_state- Current game statenew_round- New hand startedplayer_turn- It's a player's turnaction_result- Action was processedtimer_update- Turn timer updatehand_result- Hand finished with resultserror- Error message
- users - User accounts with balance
- rooms - Poker tables with configuration
- table_players - Players currently at tables
- transactions - Buy-in/cash-out/win records
- game_history - Completed hand records
MIT