This is a simple chat application for local network users using TCP connections. It allows users to send messages within private chats established between two clients, as well as communicating with many using group chats.
- Clone this repository.
- Open the solution in your IDE.
- Build and run the server and then client applications.
- .NET 7.0
- C# 11.0
- Entity Framework Core
- MSSQL Server
- Server: Console Application
- Listens for incoming connections using
TcpListener
. - Manages clients (adding new ones, updating online status).
- Manages the messages
- Listens for incoming connections using
- Client: WPF Application
- Connects to the server using
TcpClient
. - Always ready to receive a message
- Connects to the server using
- EfCore_Models: Class library
- Contains ef models, ChatDbContext and ChatDbContextFactory, as well as migration records
- ShareUtilities: Class library
- Contains extension methods for ef queries
- Helper classes like ClientModel and MessageModel, that help managing connected clients and sent messages
The application uses MSSQL Server to store all the data. You can configure the database connection adding your appSettings.json
.
Here are some of the basic actions a user can do within the chat app:
Before entering the chat, every user should login or register
- Login demo:
- And a demo for registration process:
-
Choose chat After you logged in, you can choose a private chat (marked with a @) to communicate with another user directly, or a group chat, where all the members will be able to see your message. To choose a chat you can click on one of the chat names from the list on the left side of the window:
-
Enter and send message When you you have chosen a chat, you can enter a text message in the input field at the bottom of the window, and then press the send button that is right next to the input field:
You can also create a new group chat, instead of communicating within existing ones. All the group chats within this app are public, and anyone can access them. But to appear as a member of the group chat, you need to send a message to the chat, unless you are the creator of the group. The process of creation of a new group looks like this:
After that, the new group is going to appear in the list of chats:
After you've done everything you needed within the chat app, you can easily disconnect, by pressing the disconnect button: