uChat is a desktop client-server messenger built with C# and .NET. The project includes a TCP server, a WPF graphical client, and a console client.
The application supports user authentication, public and private messaging, chat rooms, message history, online users list, and file transfer.
- User registration and login
- Password hashing
- TCP client-server communication
- WPF desktop client
- Console client
- Public chat
- Private messages
- Chat rooms
- Message history
- Online users list
- Message editing and deletion
- File transfer between users
- SQLite storage on the server side
- C#
- .NET 8
- WPF
- TCP sockets
- SQLite
- Microsoft.Data.Sqlite
uchat/
├── uchat.sln
├── uchat/
│ ├── uchat_client.csproj
│ └── ...
├── uchat_gui/
│ ├── uchat_gui.csproj
│ └── ...
└── uchat_server/
├── uchat_server.csproj
└── ...
Before running the project, install:
- Windows OS
- .NET 8 SDK or newer
- Git Bash, PowerShell, Windows Terminal, or another terminal
An IDE such as Visual Studio 2022 can be used for development, but it is not required to run the project from the terminal.
Restore project dependencies:
dotnet restoreStart the server on port 5000:
dotnet run --project uchat_server/uchat_server.csproj -- 5000Keep this terminal window open. The server should display a message similar to:
[OK] Server is running on port 5000
[OK] Waiting for clients...
Open another terminal window and start the WPF client:
dotnet run --project uchat_gui/uchat_gui.csprojAlternatively, start the console client:
dotnet run --project uchat/uchat_client.csproj -- 127.0.0.1 5000The console client requires two arguments:
uchat_client <server_ip> <port>
Example:
127.0.0.1 5000
The server must be running before any client connects.
This project was created to practice:
- Client-server architecture
- TCP socket communication
- Desktop application development with WPF
- User authentication
- SQLite database integration
- Message handling
- File transfer logic
- Separation of client and server responsibilities