A real-time desktop Group Chat application built with C#, .NET, and WPF. It enables users to host TCP chat servers and connect as client instances for multi-user chat room communication using a custom asynchronous JSON messaging protocol.
In this application, you can:
- Host your own chat server: Set up a custom server with your preferred IP address, port, admin nickname, and password.
- Monitor server activity: View real-time logs of server events, incoming connections, and user messages in the server dashboard.
- Manage connected users: See who is currently connected to the server and kick any user directly from the admin panel.
- Broadcast admin messages: Send official server announcements to all connected clients at once.
- Connect to chat rooms: Join any active server by entering its IP, port, nickname, and password.
- Chat in real time: Send and receive messages instantly in a clean chat interface with formatted time labels.
- Run multiple instances: Quickly launch extra client or server windows directly from the top menu bar to test multi-user conversations on a single machine.
The application uses asynchronous TCP sockets (TcpListener, TcpClient, NetworkStream) paired with System.Text.Json for serialization.
┌──────────────────┐ TCP / JSON ┌──────────────────┐
│ Client App │ ────────────── Auth / JSON ───────────> │ Server Window │
│ (MainWindow) │ <────────── Messages / Events ───────── │ (Server) │
└──────────────────┘ └──────────────────┘
authorization/authorizationOK— Handshake and authentication validation.messageGot— Message broadcast packet carrying content and author details.otherUserConnected/otherUserDisconnected— Presence notification events.iKicked/otherUserKicked— User moderation notification events.serverClosed— Server shutdown signal notifying active clients.
- .NET 8.0 SDK or higher
- Windows OS (WPF framework requirement)
- Visual Studio 2022 / JetBrains Rider / VS Code (with C# extension)
-
Clone the repository:
git clone https://github.com/uasuna2022/GroupChat.git cd GroupChat
-
Build the solution:
dotnet build "Group Chat/Group Chat.sln" -
Run the application:
dotnet run --project "Group Chat/Group Chat/Group Chat.csproj"
- Start the application.
- Host a Server: Click New -> Add new server in the menu bar, enter server credentials (IP, Port, Admin Username, Password), and click Start.
- Connect Clients:
- Click File -> Connect on the client window.
- Enter the server IP, Port, Username, and Password to join.
- Click New -> Add new user to open additional client windows and test multi-user messaging.
