Skip to content

KalnaiWin/poker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

66 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‚ก Poker Game (MERN Stack + Socket.io)

A real-time multiplayer poker game built with the MERN stack.
Players can create public or private rooms, join matches, play poker in real-time using WebSockets, and track match history.

image

๐ŸŒ Live Demo

Deploy: https://poker-frontend-znxb.onrender.com
Video Demo: https://www.facebook.com/reel/889751763401124

๐Ÿง  Challenges & What I Learned

  • Handling real-time synchronization between multiple players
  • Preventing invalid game actions from the client
  • Managing game state securely on the server
  • Optimizing Socket.io event handling

๐Ÿš€ Features

  • ๐Ÿ” JWT Authentication (Register / Login)
  • ๐Ÿ  Create public or private game rooms
  • ๐Ÿ‘ฅ Join and manage poker rooms
  • โ™ ๏ธ Real-time multiplayer gameplay using Socket.io
  • ๐Ÿง  Server-side poker logic validation
  • ๐Ÿ“œ Match history tracking (stored in MongoDB)
  • ๐Ÿ’ฌ In-room comments / chat

๐Ÿ›  Tech Stack

Frontend

  • React
  • Zustand
  • Tailwind CSS
  • Axios

Backend

  • Node.js
  • Express
  • MongoDB
  • Mongoose

Other

  • JWT (authentication)
  • Socket.io ( Real-time )
  • Arcjet (Rate limiting & bot protection)

Test

  • Postman

๐Ÿ— Architecture

  • REST API handles authentication and room management
  • Socket.io handles real-time gameplay communication
  • MongoDB stores users, rooms, and match history
  • Frontend state managed with Zustand

๐Ÿ“ฆ Installation

1. Clone the repository

git clone https://github.com/KalnaiWin/poker.git

2. Install dependencies

Backend: cd backend npm install

Frontend: cd frontend npm install

๐Ÿ”‘ Environment Variables

Create a .env file in /backend:

PORT=3000
MONGO_URI=your_mongodb_url
JWT_SECRET=your_secret ARCJECT_SECRET=...

4. Run the project

Backend + Frontend: npm run dev

๐Ÿ“ธ Screenshots

๐Ÿ” Login & Register Page

Group 2 (1)

๐Ÿ“Š Dashboard โ†’ Displays Match History

image

๐Ÿ  Create Room โ†’ Room Management

image

๐ŸŽฎ Join Room โ†’ Play with Other Players

image

๐Ÿ’ฌ In-Room Chat System

image

โ™ ๏ธ Gameplay

image image

๐Ÿ‘จโ€๐Ÿ’ป Author

NHBP GitHub: https://github.com/KalnaiWin

About

Poker game made by MERN stack and socket.io

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages