Skip to content

mpamposd/Server-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Request-Reply Messaging App

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.


Features

  • 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.

Technologies Used

  • Language: Java
  • Communication: Socket-based protocol or Remote Method Invocation (RMI)
  • Concurrency: Multithreading for handling multiple clients simultaneously

System Architecture

Server

  • Listens for incoming client requests.
  • Manages user accounts and their associated messages.
  • Spawns threads to handle concurrent client requests.

client

  • Acts as the user interface for interacting with the server.
  • Supports commands for creating accounts, sending messages, and managing the inbox.

Core Components

  • 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.

Installation

  1. Clone the repository:
    git clone https://github.com/mpamposd/Server-Client.git
    cd Server-Client

Usage

Start the Server

Run the server with the following command:

java -jar jars/Server.jar <port_number>

Example:

java -jar jars/Server.jar 5000

Run the Client

Use 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

Commands

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.

Directory Structure

messaging-app/
│
├── src/                # Source code
│   ├── Server.java
│   ├── client.java
│
├── jars/               # Compiled JAR files
│   ├── Server.jar
│   └── client.jar
│
└── README.md           # Project documentation

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Open a pull request.

License


Contact

For questions or support, please contact:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages