A real-time multiplayer game where players compete to identify world flags as quickly as possible!
- Create a Room: Enter your name and click "Create Room" to start a new game room. You'll receive a room code to share with friends.
- Join a Room: Enter your name and the room code shared by a friend, then click "Join Room".
- Each room can have a maximum of 10 players
- The game consists of 10 rounds
- Each round, a random world flag is displayed
- Players have 20 seconds to guess the country
- Use the autocomplete search to select your answer from the list of countries
- Scoring:
- ๐ฅ First correct answer: 10 points
- ๐ฅ Second correct answer: 9 points
- ๐ฅ Third correct answer: 8 points
- And so on... (11 - position = points)
- โ Wrong answer or no answer: 0 points
- The player with the highest score at the end wins!
- Be quick! Speed matters as much as accuracy
- Use the autocomplete feature to quickly find countries
- Watch out for similar-looking flags!
- Node.js (v18 or higher recommended)
- npm (comes with Node.js)
-
Clone the repository
git clone <repository-url> cd flag-game
-
Install dependencies
npm install
-
Start the development server
npm run dev
This will start both the backend server and the frontend client concurrently:
- Frontend: http://localhost:5173
- Backend: http://localhost:3001
| Command | Description |
|---|---|
npm run dev |
Start both server and client in development mode |
npm run client |
Start only the Vite frontend |
npm run server |
Start only the backend server |
npm run build |
Build the project for production |
npm run preview |
Preview the production build |
npm run lint |
Run ESLint to check for code issues |
- Frontend: React 19, TypeScript, Vite
- Backend: Express.js, Socket.IO
- Real-time Communication: Socket.IO
- Styling: CSS
flag-game/
โโโ server/ # Backend server code
โ โโโ index.ts # Socket.IO server & game logic
โโโ src/ # Frontend React application
โ โโโ components/ # React components
โ โ โโโ Game/ # Game-related components
โ โ โโโ Lobby/ # Lobby component
โ โ โโโ shared/ # Shared/reusable components
โ โโโ context/ # React context for game state
โ โโโ data/ # Static data (countries list)
โ โโโ services/ # Socket.IO client service
โ โโโ types/ # TypeScript type definitions
โโโ public/ # Static assets
- Real-time multiplayer gameplay
- Room-based matchmaking with shareable codes
- Autocomplete country search
- Live score updates
- Round-by-round results
- Final leaderboard
Have fun playing! ๐๐