Prerequisites
Before starting, ensure you have:- Node.js version 14 or higher installed on both computers
- Both computers connected to the same local network (WiFi or Ethernet)
- Ports 3001 (Backend) and 5173 (Frontend) available
- Firewall configured to allow incoming connections on these ports
Host Server Configuration
The host player needs to run both the backend and frontend servers.Configure Environment Variables
Verify that the
Backend/.env file exists with the correct configuration:Backend/.env
For LAN play, using SQLite with
DB_DIALECT=sqlite is recommended for simplicity. You can also disable the database entirely by setting DB_ENABLED=false.Start the Backend Server
Launch the backend server:You should see:
The server binds to
0.0.0.0 which allows it to accept connections from other devices on the network.Get Your Local IP Address
You need to find the host computer’s local IP address.On Windows (PowerShell):Look for the “IPv4 Address” line in your active network adapter:On Linux/Mac:
Configure Firewall Rules
Ensure your firewall allows incoming connections on the required ports.Windows Firewall Configuration:Linux (ufw):
Connecting Players
Player 1 (Host)
Create a Room
From the main menu, select “Juego en Red (LAN)” (Network Game)Click “Crear Sala” (Create Room)
Player 2 (Guest)
Connect to Host
Open your browser and navigate to
http://[HOST_IP]:5173Example: http://192.168.1.100:5173Join Room
From the main menu, select “Juego en Red (LAN)” (Network Game)In the right panel, enter the 6-digit code shared by the hostClick “Unirse a Sala” (Join Room)
Game Turn System
- The host player always goes first
- Turns alternate automatically between players
- Each player has 12 seconds per turn
- All actions are synchronized in real-time via Socket.IO
Game States
| State | Description |
|---|---|
| Esperando jugador… | Room has only 1 player |
| Jugador conectado! | Both players are in the room |
| Tu turno | It’s your turn to play |
| Turno del oponente | Wait for opponent to finish their turn |
Game Controls
- Left click: Select card
- Drag card from hand to slot: Play card
- Click field card + click enemy card: Attack
- Click two own field cards: Fuse (same type and level)
Important Notes
Quick Start (Development)
For rapid development testing: Terminal 1 (Backend):Health Check
To verify the backend is running correctly, you can access the health check endpoint:The
/ping endpoint is defined in server.js:52 and is useful for verifying network connectivity.