{"id":21458998,"url":"https://github.com/raedaddala/randomchat-in-java","last_synced_at":"2026-03-07T00:02:03.812Z","repository":{"id":163103141,"uuid":"638498808","full_name":"RaedAddala/RandomChat-in-Java","owner":"RaedAddala","description":"A Random Chatting Platform made using Java RMI and Java Swing. Inspired by our distributed computing course and Omegle Website. ","archived":false,"fork":false,"pushed_at":"2023-05-09T15:42:33.000Z","size":70,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-15T04:16:48.797Z","etag":null,"topics":["chat-application","chatroom","java","javarmi","random","rmi","swing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RaedAddala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-09T13:40:33.000Z","updated_at":"2025-06-29T20:21:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd0b0d70-80d0-44d5-9866-bc9b10ee27d2","html_url":"https://github.com/RaedAddala/RandomChat-in-Java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RaedAddala/RandomChat-in-Java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaedAddala%2FRandomChat-in-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaedAddala%2FRandomChat-in-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaedAddala%2FRandomChat-in-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaedAddala%2FRandomChat-in-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaedAddala","download_url":"https://codeload.github.com/RaedAddala/RandomChat-in-Java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaedAddala%2FRandomChat-in-Java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30204109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat-application","chatroom","java","javarmi","random","rmi","swing"],"created_at":"2024-11-23T06:26:07.492Z","updated_at":"2026-03-07T00:02:03.794Z","avatar_url":"https://github.com/RaedAddala.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Random Chatting Platform\n\n**Done by:**\n\n- **Mohamed Zouaghi : https://github.com/zouaghista**\n- **Addala Raed [ ME ] : https://github.com/RaedAddala**\n\n**Inspired By: Omegle.**\n\n1. [**General Description.**](#1--general-description)\n1. [**How To Use It.**](#2-how-to-use-it)\n1. [**General Documentation.**](#3-general-documentation)\n1. [**Contributing And Feedback.**](#contributing-and-feedback)\n\n\n## 1.  **General Description:**\n\nThis project is a chatting platform that utilizes a random matching system to connect clients and manages their interactions, including the pairing of two clients and handling various events related to these functionalities. \n\nThe architecture of the project is **Event-Driven**, which means that the logic is primarily handled by an Event Emitter (**Manager** class) responsible for sending messages, an Event Listener (**ConversationListener** class) responsible for receiving notifications and messages, and supporting classes such as **Logger** and **QueueManager** for server connection and client pairing.\n\nThe client program features a graphical user interface (GUI) consisting of two windows.\n\n**Technologies Used: *Java RMI*, *Java Swing* and *Java Threads*.**\n\n\n## 2. **How to Use It:**\n\nThis Project uses Java RMI technology so in order to use it first you have to:\n1. **Have Java Installed and bin file added to the PATH Variable**\n    ```\n    # Test it using this\n    java -version\n    ```\n\n1. **Start the RMI Registry:**\n    ```\n    # this should be done on its own terminal instance\n    # In Windows:\n    start rmiregistry\n    # In Linux and Unix-based OS:\n    rmiregistry \u0026\n    ```\n1. **Run the Server:**\n    ```\n    # Go To binaries/Server folder and run this command:\n    java ChatServer\n    ```\n1. **Run the Clients ( as many as you need to: )**\n    ```\n    # Go To binaries/Client folder and run this command:\n    java ChatClient\n    ```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 3. **General Documentation:**\n### **QueueManager :**\n\nThe QueueManager is a crucial component of the server **responsible for managing waiting queues and matching clients with each other**.\n\nIt runs on its own thread to handle concurrent operations efficiently.\n\nThe QueueManager effectively handles scenarios where a client exits a room or requests to be matched with another client. \n\nTo ensure **a single instance is used throughout the server's lifecycle**, the QueueManager follows the **Singleton pattern**.\n\n### **ITextReceiver : *INTERFACE* :**\n\nThe ITextReceiver interface establishes the requirements for classes responsible for **receiving messages**, **handling connections**, **matching** **and** **partner quitting notifications**.\n\n### **ILogger: *INTERFACE* :**\n\nEnsures that the class must handle **logging to the chat server.**\n\n### **ITexter : *INTERFACE* :**\n\nEnsures that the class must handle **entering** and **exiting a chat**, **sending messages** and **quitting the server.**\n\n### **ChatServer:**\n\nThe ChatServer component includes a **graphical user interface** (**GUI**) that provides a visual representation of the current pairings using the **RoomTable** class.\n\nIt creates an **instance** of the **Logger** class to initiate the client matching process.\n\n### **ChatClient [ GUI ]:**\n\nThe ChatClient is the client-side component that features a user-friendly GUI. \n\nThe GUI consists of a **WelcomePanel**, responsible for initializing the listener and emitter, and a **ChatBox**, which displays sent and received messages.\n\n### **ConversationListener ( ITextReceiver ) :**\n\nThe ConversationListener implements the ITextReceiver interface. \n\nIt handles **notifications regarding entering or quitting the queue** and **receiving messages**. \n\nIt contains an **instance** of **ITexter** responsible for sending messages and **a reference to the GUI instance** for displaying notifications and received messages.\n\n### **Logger ( ILogger ):**\nEnsures Connection between two clients.\n\nUses a **Manager** and receives an **ITextReceiver** instance reference as a listener which is then published within the manager and bound to the name registry.\n\n### **Manager ( ITexter ):**\n\nThe Manager class is a critical component that implements the ITexter interface.\n\n*Contains two classes’ instances:*\n\n- **ConversationManager**\n- **QueueManager (**shared by all **Manager** instances**)**\n- Uses the ConversationManager instance to send a message and handle its exceptions.\n- Adds a client to chat queue and pair it with another client using the **QueueManager.**\n- Handles quitting the chat/app event. \n\n### **RoomTable [ GUI ]:** \n\nThe RoomTable component provides a GUI display on the server, showcasing all client connections and pairings in real-time.\n\n###  **OnDisplayListener [ GUI-related Event Handler ]:**\n\nThe OnDisplayListener is responsible for handling window-related events in the GUI. \n\nIt ensures a smooth quitting process without crashing the server or causing excessive blocking time for other clients.\n\nAlso, it ensures **joining** **a queue** first time the window is created.\n\n###  **ConversationManager:**\n Responsible of handling all messaging operations within the chat platform.\n\nHas **another ConversationManager instance reference** to match to and chat with.\n\nThe ConversationManager listens for incoming messages through an **ITextReceiver**.\n\nHas a static variable **count,** used to generate unique IDs.\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Contributing and Feedback\n\nI am a Student and I am still in the process of learning. So, I appreciate your interest in contributing to this project and value your feedback. If you have any suggestions, improvements, or notice any areas that could be enhanced, please feel free to let me know. Your input is highly valuable to me.\n\nHere are some ways you can contribute and provide feedback:\n\n- **Report issues**: If you come across any issues or bugs, please submit an issue with a detailed description. Include steps to reproduce the problem, expected behavior, and any relevant screenshots.\n\n- **Feature requests**: If you have any ideas for new features or improvements, open an issue and describe your suggestion. Provide as much detail as possible, including use cases and potential implementation strategies.\n\n- **General feedback**: If you have any other feedback, questions, or comments, please reach out to me. I am open to discussions and happy to address any concerns.\n\n### Thank you for taking the time to contribute and provide feedback\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraedaddala%2Frandomchat-in-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraedaddala%2Frandomchat-in-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraedaddala%2Frandomchat-in-java/lists"}