Skip to content

Steellgold/blackjack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฐ 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:
git clone https://github.com/Steellgold/blackjack.git
cd blackjack
  1. Install dependencies:
pnpm install
  1. Create a .env file in the packages/www directory:
NEXT_PUBLIC_SOCKET_URL="http://localhost:3001/"
  1. Start the development servers:
pnpm dev
  1. 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 file for details.

About

๐Ÿƒ A blackjack game with NextJS and Socket.IO

Topics

Resources

License

Stars

Watchers

Forks

Languages