https://github.com/steellgold/blackjack
🃏 A blackjack game with NextJS and Socket.IO
https://github.com/steellgold/blackjack
blackjack card-game monorepo nextjs socket
Last synced: 6 months ago
JSON representation
🃏 A blackjack game with NextJS and Socket.IO
- Host: GitHub
- URL: https://github.com/steellgold/blackjack
- Owner: Steellgold
- License: mit
- Created: 2024-12-21T12:40:09.000Z (10 months ago)
- Default Branch: stable
- Last Pushed: 2025-01-06T07:53:35.000Z (9 months ago)
- Last Synced: 2025-04-23T11:57:43.917Z (6 months ago)
- Topics: blackjack, card-game, monorepo, nextjs, socket
- Language: TypeScript
- Homepage: https://blackjack.steellgold.fr/
- Size: 396 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🎰 Blackjack
A modern multiplayer Blackjack game built with Next.js, Socket.IO, and TypeScript. Play against the dealer or with friends in real-time!
## ✨ Features
- 🎮 Single-player and multiplayer modes
- 🌐 Real-time gameplay with WebSocket
- 💬 In-game chat system
- 🎨 Multiple table themes
- 🌍 Internationalization (English/French)
- 📱 Responsive design (Mobile, Tablet, Desktop)
- 🎲 Realistic card dealing animations
- 💰 Betting system with chips
- 🎯 Standard Blackjack rules implementation
- 👥 Support for up to 7 players per table## 🛠️ Tech Stack
- **Frontend:**
- Next.js 15
- React 19
- TypeScript
- Tailwind CSS
- shadcn/ui
- Socket.IO Client
- Zustand (State Management)
- Framer Motion (Animations)- **Backend:**
- Socket.IO
- Fastify
- TypeScript## 📁 Project Structure
```
apps/
├── socket/ # Socket.IO backend server
└── www/ # Next.js frontend application
packages/
├── game/ # Shared game logic and types
└── db/ # Database integration (Supabase) - Not used for now
```## 🚀 Getting Started
1. Clone the repository:
```bash
git clone https://github.com/Steellgold/blackjack.git
cd blackjack
```2. Install dependencies:
```bash
pnpm install
```3. Create a `.env` file in the `packages/www` directory:
```env
NEXT_PUBLIC_SOCKET_URL="http://localhost:3001/"
```4. Start the development servers:
```bash
pnpm dev
```5. Open `http://localhost:3000` in your browser to play!
## 🎮 Game Rules
- Each player starts with a defined balance
- Players can bet using various chip denominations
- The goal is to beat the dealer's hand without going over 21
- Players can "Hit" (take another card) or "Stand" (keep current hand)
- Dealer must hit on 16 and stand on 17
- Blackjack (Ace + 10-value card) pays 2.5x the bet
- Regular wins pay 2x the bet
- Push (tie) returns the original bet## 🌟 Features in Detail
### 🎲 Real-time Multiplayer
- Create private tables
- Join existing tables using table codes
- Watch other players' moves in real-time
- Synchronize game states across all players### 💬 Chat System
- Real-time chat with other players at the table
- Unread message notifications
- Player name and timestamp for each message### 🎨 Theme System
- Multiple table themes (Classic, Sky, Modern, Neon, Darkness)
- Theme persistence across sessions
- Smooth theme transitions### 🌍 Internationalization
- English and French language support
- Persistent language selection
- Complete translation coverage### 💰 Betting System
- Multiple chip denominations
- Visual chip stacking
- Bet placement animations
- Balance management### 📱 Responsive Design
- Optimized for mobile devices
- Tablet support
- Desktop-first experience
- Adaptive layouts## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.