A distributed messaging system implementing a simple request-reply protocol. This project enables users to create accounts, send and receive messages, and manage their inboxes using a client-server architecture.
- Account Management: Create and view user accounts.
- Messaging: Send and receive messages between users.
- Inbox Management: View, read, and delete messages.
- Authentication: Secure user requests with unique tokens.
- Language: Java
- Communication: Socket-based protocol or Remote Method Invocation (RMI)
- Concurrency: Multithreading for handling multiple clients simultaneously
- Listens for incoming client requests.
- Manages user accounts and their associated messages.
- Spawns threads to handle concurrent client requests.
- Acts as the user interface for interacting with the server.
- Supports commands for creating accounts, sending messages, and managing the inbox.
- Message: Represents individual messages with attributes like sender, receiver, body, and read status.
- Account: Represents user accounts with details such as username, authentication token, and inbox.
- Clone the repository:
git clone https://github.com/mpamposd/Server-Client.git cd Server-Client
Run the server with the following command:
java -jar jars/Server.jar <port_number>Example:
java -jar jars/Server.jar 5000Use the client to interact with the server:
java -jar jars/client.jar <server_ip> <port> <function_id> <arguments>Example for creating a new account:
java -jar jars/client.jar localhost 5000 1 new_user| Function ID | Command Example | Description |
|---|---|---|
1 |
java -jarclient.jar localhost 5000 1 username |
Creates a new user account. |
2 |
java -jar client.jar localhost 5000 2 authToken |
Lists all existing user accounts. |
3 |
java -jar client.jar localhost 5000 3 authToken recipient body |
Sends a message to another user. |
4 |
java -jar client.jar localhost 5000 4 authToken |
Displays the user's inbox. |
5 |
java -jar client.jar localhost 5000 5 authToken message_id |
Reads a specific message. |
6 |
java -jar client.jar localhost 5000 6 authToken message_id |
Deletes a specific message. |
messaging-app/
│
├── src/ # Source code
│ ├── Server.java
│ ├── client.java
│
├── jars/ # Compiled JAR files
│ ├── Server.jar
│ └── client.jar
│
└── README.md # Project documentation
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Open a pull request.
For questions or support, please contact:
- Name: Dimitrios Bampos
- Email: [email protected]