This project is a client-server based multiplayer typing game written in Java.
Players can register, log in, team up, and compete by typing a given text accurately and quickly.
The server manages multiple clients simultaneously using multithreading and maintains a leaderboard of the best teams.
- Register and Log In system
 - Team Formation (2 players per team)
 - Real-time Typing Race based on speed and accuracy
 - Leaderboard tracking the best team times
 - Multithreaded Server supporting multiple players
 - Client-Server Communication over TCP sockets
 
- Java SE
 - TCP Sockets (ServerSocket, Socket)
 - Multithreading (Thread, Runnable)
 - Object Streams for sending objects across network
 
- Compile the server code:
javac ThreadHandler.java ClientHandler.java Db.java Player.java Team.java
 - Run the server:
java Thread_Handler
 
The server will start and listen for client connections on
port 1234.
- Compile the client code:
javac Main.java
 - Run the client:
java Client
 
The client will connect to
localhostonport 1234.
Make sure the server is running before starting the client.
| File | Purpose | 
|---|---|
ThreadHandler.java | 
Main server entry point, manages incoming clients | 
ClientHandler.java | 
Handles each client's actions on the server | 
Db.java | 
Manages user registration, login, and leaderboard data | 
Player.java | 
Represents a player | 
Team.java | 
Manages team creation and readiness | 
Main.java | 
Client-side logic for connecting and playing | 
- This project uses local IP (127.0.0.1) — for remote play, replace it with your server’s public IP.
 - If you want multiple clients, open several terminals and run the client in each.
 - Passwords are stored in memory only (no database integration).
 
This project is for educational purposes.
Feel free to modify and expand it!