Skip to content

krish-1010/dynamic-board-game

Repository files navigation

Real-Time Dynamic Co-op Board Game 🎲

A real-time, 2-player board game built using Next.js 14 with React, zustand, postgres, docker, zustand and Auth.js authentication.

🌐 Tech Stack

  • Frontend: Next.js 14, React, Tailwind CSS
  • Authentication: Auth.js (NextAuth v5)
  • Backend (Real-time): Node.js
  • Hosting: Vercel (Frontend) + Hostinger VPS (Backend)
  • State Management: Zustand + useState
  • Database (Optional for history/sessions): PostgreSQL / MongoDB

🧠 Features

  • 🎮 Real-time multiplayer gameplay
  • 🚀 Dynamic board layouts + jump logic
  • 🔒 Authenticated sessions using Auth.js
  • 🔁 Turn-based game flow
  • 📱 Responsive design

🚧 Project Structure

/pages
  ├── api        # API routes
  └── index.tsx  # Main game board
/components
  ├── Board.tsx
  ├── Dice.tsx
  ├── PlayerPiece.tsx
/lib
  ├── socket.ts  # WebSocket client logic
  └── auth.ts    # Auth.js integration

🛠️ Getting Started

1. Clone the repo

git clone https://github.com/krish-1010/dynamic-board-game.git
cd dynamic-board-game

2. Install dependencies

npm install

3. Setup environment variables

Create a .env.local file:

AUTH_SECRET=your_auth_secret
NEXTAUTH_URL=http://localhost:3000

4. Run the development server

npm run dev

5. Start the backend WebSocket server

Deploy or run locally using Node.js + Socket.IO


📦 Deployment

  • Frontend: Deploy on Vercel or Netlify
  • Backend: Host Node.js WebSocket server on Hostinger VPS (Ubuntu + Nginx recommended)

🤝 Contributing

Pull requests are welcome! For major changes, open an issue first to discuss what you’d like to change.


📜 License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published