/three-card-poker-online

Online three card poker web game with ExpressJS & Socket.io

Primary LanguageTypeScript

Three Card Poker (Ba Cay) game with Node.js, Express.js, Socket.io, and React

This is a simple Three Card Poker online game website built using Node.js, Express.js, Socket.io, and React. It allows players to join a game room and play Ba Cây with other players in real-time.

Getting Started

To get started, clone this repository to your local machine and run the following commands:

Build the Docker image:

$ docker build -t three-card-poker .

or use my docker Image from Docker Hub

$ docker pull dipperpinees/three-card-poker
$ docker tag dipperpinees/three-card-poker three-card-poker

Run the application in a Docker container:

$ docker run -d --name three-card-poker-online -p 7001:7001 three-card-poker

Open http://localhost:7001 to view it in the browser.

Development

Run api in development mode:

$ npm run dev:api

Run frontend in development mode:

$ npm run dev:web

Functionality overview

General functionality:

  • Join the game with up to 12 players
  • Deal a random poker hand from a standard card deck
  • Bet money on other players
  • Contribute cash together

How it Works

This website uses Socket.io to establish real-time communication between the client and the server. When a player joins a game room, they are assigned a unique ID, which is used to communicate with other players in the same game room.

The server-side code is built using Node.js and Express.js. It handles HTTP requests and serves the client-side code and static files. The client-side code is built using React and communicates with the server using Socket.io.

Acknowledgments

This project was inspired by the popular Ba Cay game, which is a traditional Vietnamese card game. Special thanks to the contributors of the following libraries and frameworks: