Skip to content

CoJaques/Saloon

Repository files navigation

SALOON

Dive into the Wild West with Saloon!

git-last-commit GitHub commit activity GitHub top language

📖 Table of Contents


🚀 Saloon: Overview

Saloon is a chat application that provides a platform for real-time communication. The project is divided into two main components: the server and the client.

🌐 Server Component

The server acts as the central hub for message distribution. It is designed to handle client connections using UDP (User Datagram Protocol) for efficient, low-latency communication. Key features include:

  • Listening for client connections and managing their session.
  • Handling unicast messages from clients and broadcasting them to other connected clients using multicast.
  • Supporting private messages between clients, routed through the server.
  • Maintaining a list of all connected users for retrieval.

💻 Client Component

The client interface offers a user-friendly environment for interaction within the Saloon network. Features include:

  • Connecting to the server with a unique username.
  • Sending messages to the server in unicast, which are then broadcasted to other clients.
  • Private messaging capabilities, allowing direct communication with selected users.
  • Ability to request and view a list of all connected users.

🌟 Special Features

  • Docker Support: Both the server and client components are Dockerized, enabling easy deployment and scalability. The application is tested to work flawlessly in Docker environments, with special consideration for network configurations and inter-container communication.

📚 Protocol Definition

For a detailed understanding of the communication protocol used in Saloon, please refer to the protocol definition available at: Saloon Protocol Definition

🚀 Getting started

🔧 Packaging

You can package the jar file directly by using the maven wrapper packaged into the project. If you use Intellij IDE, the packaging configuration is embedded into the project.

  1. Clone the Pongly repository:
git clone https://github.com/CoJaques/Saloon
  1. Change to the project directory:
cd Saloon
  1. Build the client and the server:
# Download the dependencies
./mvnw dependency:resolve clean compile

# Package the application
./mvnw package

Once the Jar are generated, you can build the docker images.

  1. Server Image:

    • Navigate to the server's directory.
    • Build the image using the Docker build command.
      docker build -t ghcr.io/cojaques/saloon_server:v1.0.0 .
  2. Client Image:

    • Navigate to the client's directory.
    • Build the image similarly.
      docker build -t ghcr.io/cojaques/saloon_client:v1.0.0 .

be sure to adapt the version number as needed.

Publishing to GitHub

After building the images, you can publish them to github. Be sure to be logged and have right to publish image.

Once done, you can publish it to github by using :

docker push ghcr.io/cojaques/saloon_client:v1.0.0
docker push ghcr.io/cojaques/saloon_server:v1.0.0

📖 Run it with docker compose

  1. Running with Docker Compose:

    • In the directory containing your docker-compose.yml, start the services.
      docker-compose up
    • This will pull the images from github and start the server and clients.
  2. Interacting with the Application:

    Once the containers are running, interact with the client as you normally would in a local setup. You can connect to the client/server terminal by using

    docker attach <docker ID>

    Once connected, you must connect yourself to the server by using

    /connect <your username>

    From here, you can chat with everybody by simply sending simple message. You can get a list of who's connected by sending

    /who

    You can send private message by using

    /mp <target username> your message

    Finally you can quit the application by simply sending

    /quit
  3. Shutting Down the Application:

    • To stop the application, use:
      docker-compose down

Run it directly via Docker

To run the application without docker compose follow the guide :

First you must pull the image.

docker pull ghcr.io/cojaques/saloon_client:v1.0.0
docker pull ghcr.io/cojaques/saloon_server:v1.0.0

Client

Running the Client Directly via Docker

To run the Saloon client using Docker, execute the following command with the desired options:

docker run ghcr.io/cojaques/saloon_client:v1.0.0 [options]
Command-Line Arguments for Client
  • -UP, --UniPort : The unicast port of the server to connect to. Default is set as per 1312.
  • -MP, --MultiPort : The multicast port of the server for group communications. Default is set as per 1313.
  • -H, --DefaultHost : The server host address to connect to. Default is 192.168.23.23.
  • -M, --MultiCastAddress : The multicast address of the server. Default is 239.1.1.1.
  • -A, --Adapter : Define the network adapter to use for the multicast.

Server

Running the Server Directly via Docker

To run the Saloon server using Docker, execute the following command with the necessary options:

docker run ghcr.io/cojaques/saloon_server:v1.0.0 [options]
Command-Line Arguments for Server
  • -UP, --UniPort : The unicast port of the server for receiving client messages. Default is set as per 1312.
  • -MP, --MultiPort : The multicast port of the server for broadcasting messages. Default is set as per 1313.
  • -M, --MultiCastAddress : The multicast address used by the server. Default is 239.1.1.1.
  • -A, --Adapter : Specify the network adapter to use for handling multicast traffic.

This readme was, in part, generated by an AI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •