How mazino2d/socket-chat works
This project is a Java-based socket chat system that implements a client-server architecture for a computer networks course assignment at HCMUT. The application is divided into two main parts—the client and the server—with a shared protocol layer that handles data encoding/decoding and message structures. The project also includes graphical user interfaces (GUIs) for chatting, file browsing/sending, login, menus, and server control.
Main Components
• Client Application: Contains all the GUI components (ChatGUI, LoginGUI, MenuGUI, etc.) and the core chat functionalities (Chat, Menu) that interact with users.
• Server Application: Includes the server logic (Server, ServerGUI) that handles connections, message broadcast, and file transfers.
• Protocol Layer: Found in the “protocol” package, this layer is responsible for the encoding, decoding, and structuring of messages and file data (classes like Decode, Encode, FileData, Peer, and Tags).
• Testing Infrastructure: Although not part of the production flow, note that test classes are included (under src/test/java/kraken) to validate the protocol and possibly other system functionality.
• CI/CD & Deployment: Elements like the Dockerfile, Maven build files (pom.xml, client.xml, server.xml) as well as GitHub workflow configurations indicate an environment for continuous integration and container-based builds.
Relationships and Interactions
• How both client and server rely on the shared Protocol Layer to encode/decode messages.
• Annotations showing the communication flow to illustrate actions such as login, file transfer, and chat messaging.
• Testing Infrastructure as an environment used during development and CI/CD pipelines, even if it is auxiliary to the live system.
Important Architectural Patterns and Technologies
• Client-Server Communication: Emphasize that this is a real-time socket-based communication system.
• Layered Architecture: Represent the separation between the User Interface (GUI components) and the backend business logic.
• Use of Maven: Reflect how the build and dependency management is handled.
• Docker & CI/CD: Indicate that a Docker container can be built and that GitHub workflows are configured to support automated builds (pointed by the Dockerfile and the .github directory).