A multiplayer space colonization game built with Next.js, featuring real-time gameplay and WebSocket communication.
- 🚀 Real-time multiplayer gameplay
- 🎮 Host or join game sessions
- 🌌 Space colonization theme
- 📱 Responsive design with Tailwind CSS
- ⚡ Built with Next.js and Turbopack
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, Radix UI components
- Real-time: WebSocket (ws)
- Testing: Playwright for end-to-end testing
- Development: Turbopack for fast builds
- Node.js 18+
- npm, yarn, pnpm, or bun
- Clone the repository
- Install dependencies:
npm installStart the development server:
npm run devOr run the full application with WebSocket server:
npm run dev:fullOpen http://localhost:3000 to see the application.
npm run dev- Start Next.js development servernpm run build- Build the application for productionnpm run start- Start the production servernpm run lint- Run ESLintnpm run server- Start the WebSocket servernpm run dev:full- Start both WebSocket server and Next.js dev servernpm test- Run Playwright testsnpm run test:ui- Run tests with interactive UInpm run test:debug- Debug tests
This project uses Playwright for end-to-end testing. Tests cover:
- Homepage functionality (player name input, game navigation)
- Game flow (hosting/joining games)
- UI components (responsiveness, interactions)
Run tests:
# Run all tests
npm test
# Run with UI mode for debugging
npm run test:ui
# Debug specific tests
npm run test:debug├── app/ # Next.js app directory
├── components/ # React components
│ └── ui/ # Reusable UI components
├── lib/ # Utility functions
├── tests/ # Playwright test files
├── server.js # WebSocket server
└── playwright.config.ts # Playwright configuration
- Player Setup: Enter your name on the homepage
- Host Game: Create a new game session with a random game code
- Join Game: Enter a game code to join an existing session
- Play: Engage in real-time space colonization gameplay
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
npm test - Run linting:
npm run lint - Submit a pull request