# gopi-2006-cse/chatapplication architecture

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

- Interactive diagram: https://gitdiagram.com/gopi-2006-cse/chatapplication
- Repository: https://github.com/gopi-2006-cse/chatapplication

## Overview

This is a small Java terminal chat application. A user enters a server IP in ChatClient, which connects to ChatServer on port 5000; the server creates a ClientHandler for each accepted socket. Each handler prompts for a username, reads messages, and broadcasts chat and join/leave notices to connected clients. The excerpts show this core workflow; there is no README documenting additional capabilities.

Main entry points: [`ChatClient.java`](https://github.com/gopi-2006-cse/chatapplication/blob/main/ChatClient.java) (Chat client), [`ChatServer.java`](https://github.com/gopi-2006-cse/chatapplication/blob/main/ChatServer.java) (Chat server), [`ClientHandler.java`](https://github.com/gopi-2006-cse/chatapplication/blob/main/ClientHandler.java) (Client handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Chat user"))
node_client["Chat client<br/>[ChatClient.java]"]
node_server["Chat server<br/>[ChatServer.java]"]
node_handler["Client handler<br/>[ClientHandler.java]"]

node_user -->|"enters messages"| node_client
node_client -->|"connects by socket"| node_server
node_server -->|"starts handler"| node_handler
node_handler -->|"broadcasts messages"| node_client

click node_client "https://github.com/gopi-2006-cse/chatapplication/blob/main/ChatClient.java"
click node_server "https://github.com/gopi-2006-cse/chatapplication/blob/main/ChatServer.java"
click node_handler "https://github.com/gopi-2006-cse/chatapplication/blob/main/ClientHandler.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_user,node_client,node_handler toneBlue
class node_server toneMint
```

## Components

### Other components

- **Chat user**
- [Chat client](https://github.com/gopi-2006-cse/chatapplication/blob/main/ChatClient.java): `ChatClient.java`
- [Chat server](https://github.com/gopi-2006-cse/chatapplication/blob/main/ChatServer.java): `ChatServer.java`
- [Client handler](https://github.com/gopi-2006-cse/chatapplication/blob/main/ClientHandler.java): `ClientHandler.java`

## Connections

- Chat user → Chat client: enters messages (evidence: `ChatClient.java`)
- Chat client → Chat server: connects by socket (evidence: `ChatClient.java`)
- Chat server → Client handler: starts handler (evidence: `ChatServer.java`)
- Client handler → Chat client: broadcasts messages (evidence: `ClientHandler.java`)
