# shahdamgadd992/distributed-project architecture

> Architecture diagram of the GitHub repository shahdamgadd992/distributed-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shahdamgadd992/distributed-project
- Repository: https://github.com/shahdamgadd992/distributed-project

## Overview

This is a Java RMI chat application: users send messages through a Swing client, the server fans messages out to registered remote clients, and callbacks update each client’s chat display. The server application publishes the chat service in an RMI registry; clients look up that service. The excerpts show message sending, fan-out, and callback display, but not the full client connection or registration flow, so those links are omitted.

Main entry points: [`ClientFrame.java`](https://github.com/shahdamgadd992/distributed-project/blob/main/ClientFrame.java) (Chat window), [`ChatServerImpl.java`](https://github.com/shahdamgadd992/distributed-project/blob/main/ChatServerImpl.java) (Message broker), [`ChatClientImpl.java`](https://github.com/shahdamgadd992/distributed-project/blob/main/ChatClientImpl.java) (Client callback), [`ServerApp.java`](https://github.com/shahdamgadd992/distributed-project/blob/main/ServerApp.java) (Server startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Chat client"]
  node_frame["Chat window<br/>[ClientFrame.java]"]
  node_callback["Client callback"]
end

subgraph group_service["RMI contracts"]
  node_client_contract["Client interface<br/>[ClientInt.java]"]
  node_server_contract["Chat interface<br/>[ChatServerInt.java]"]
end

subgraph group_server["Chat server"]
  node_server["Message broker"]
  node_server_app["Server startup<br/>[ServerApp.java]"]
end

node_user(("Chat user"))
node_registry[("RMI registry")]

node_user -->|"sends messages"| node_frame
node_frame -->|"sends message"| node_server
node_frame -->|"creates callback"| node_callback
node_callback -->|"implements"| node_client_contract
node_callback -->|"updates display"| node_frame
node_server -->|"calls receive"| node_client_contract
node_server -->|"implements"| node_server_contract
node_server_app -->|"creates service"| node_server
node_server_app -->|"binds service"| node_registry
node_frame -->|"looks up service"| node_registry

click node_frame "https://github.com/shahdamgadd992/distributed-project/blob/main/ClientFrame.java"
click node_callback "https://github.com/shahdamgadd992/distributed-project/blob/main/ChatClientImpl.java"
click node_client_contract "https://github.com/shahdamgadd992/distributed-project/blob/main/ClientInt.java"
click node_server_contract "https://github.com/shahdamgadd992/distributed-project/blob/main/ChatServerInt.java"
click node_server "https://github.com/shahdamgadd992/distributed-project/blob/main/ChatServerImpl.java"
click node_server_app "https://github.com/shahdamgadd992/distributed-project/blob/main/ServerApp.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frame,node_callback,node_user toneBlue
class node_client_contract,node_server_contract,node_registry toneAmber
class node_server,node_server_app toneMint
```

## Components

### Chat client

- [Chat window](https://github.com/shahdamgadd992/distributed-project/blob/main/ClientFrame.java): `ClientFrame.java`
- [Client callback](https://github.com/shahdamgadd992/distributed-project/blob/main/ChatClientImpl.java): `ChatClientImpl.java`

### RMI contracts

- [Client interface](https://github.com/shahdamgadd992/distributed-project/blob/main/ClientInt.java): `ClientInt.java`
- [Chat interface](https://github.com/shahdamgadd992/distributed-project/blob/main/ChatServerInt.java): `ChatServerInt.java`

### Chat server

- [Message broker](https://github.com/shahdamgadd992/distributed-project/blob/main/ChatServerImpl.java): `ChatServerImpl.java`
- [Server startup](https://github.com/shahdamgadd992/distributed-project/blob/main/ServerApp.java): `ServerApp.java`

### Other components

- **Chat user**
- **RMI registry**

## Connections

- Chat user → Chat window: sends messages
- Chat window → Message broker: sends message (evidence: `ClientFrame.java`)
- Chat window → Client callback: creates callback (evidence: `ClientFrame.java`)
- Client callback → Client interface: implements (evidence: `ChatClientImpl.java`)
- Client callback → Chat window: updates display (evidence: `ChatClientImpl.java`)
- Message broker → Client interface: calls receive (evidence: `ChatServerImpl.java`)
- Message broker → Chat interface: implements (evidence: `ChatServerImpl.java`)
- Server startup → Message broker: creates service (evidence: `ServerApp.java`)
- Server startup → RMI registry: binds service (evidence: `ServerApp.java`)
- Chat window → RMI registry: looks up service (evidence: `ClientFrame.java`)
