A modern implementation of the classic Battleship game with drag-and-drop ship placement, random match mode, and the ability to play against your friend.
Built with React + TypeScript on the frontend and Node.js + WebSockets + Redis on the backend.
- ๐ฎ Drag & Drop Ships โ intuitive ship placement using React DnD logic.
- ๐ค Random Matchmaking โ quickly find a random opponent to start playing.
- ๐ฅ Play with a Friend โ share a room code and battle directly with a friend.
- โก Real-time Gameplay โ powered by WebSockets for instant move updates.
- ๐ง State Management โ Redis is used to handle multiplayer sessions and game state.
- ๐ฑ Responsive Design โ optimized for both desktop and mobile play.
Frontend
- React + TypeScript
- React Router
- Drag-and-Drop logic for ship placement
Backend
- Node.js + TypeScript
- WebSockets (real-time communication)
- Redis (session & game state storage)
Other
- Prisma + PostgreSQL (optional, for persistence if needed)
- Docker (for local development setup)
git clone https://github.com/yourusername/battleship.git
cd battleshipcd frontend
npm install
cd backend
npm installcd frontend
npm run dev
cd backend
docker-compose up --buildThis will start:
- Frontend (React) on http://localhost:5173
- Backend (Node.js + WebSockets + Redis for game state storage) on http://localhost:3000