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