Skip to content

jespernapp/ChatServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatServer

A real-time chat application built with ASP.NET Core SignalR and WPF, featuring a modern client-server architecture for instant messaging.

Overview

This project consists of two main components:

  • ChatServer: ASP.NET Core 8.0 web application with SignalR hub
  • ChatClient: WPF desktop application (.NET Framework 4.8) with a modern UI

Features

Server Features

  • Real-time bidirectional communication using SignalR
  • User registration and connection management
  • Thread-safe user tracking with ConcurrentDictionary
  • CORS enabled for cross-origin connections
  • Automatic reconnection support

Client Features

  • Modern, styled WPF interface with custom controls
  • Real-time message delivery with timestamps
  • User list showing all connected participants
  • Typing indicators (shows when other users are typing)
  • Audio notification on new messages
  • Username validation (prevents duplicate names)
  • Auto-scroll chat display
  • Enter key support for quick actions

Technology Stack

Server:

  • .NET 8.0
  • ASP.NET Core
  • SignalR
  • Swagger/OpenAPI

Client:

  • .NET Framework 4.8
  • WPF (Windows Presentation Foundation)
  • SignalR Client
  • Custom styled controls with rounded corners

Getting Started

Prerequisites

  • Visual Studio 2022 or later
  • .NET 8.0 SDK
  • .NET Framework 4.8 Developer Pack

Running the Application

  1. Start the Server:
    cd ChatServer
    dotnet run
    The server will start at https://localhost:7045
    
  2. Start the Client:
  • Open the solution in Visual Studio
  • Set ChatClient as startup project
  • Press F5 to run
  • Or build and run the executable from ChatClient/bin/Debug
  1. Using the Chat:
  • Enter a unique username in the name field
  • Click "Connect" or press Enter
  • Type messages in the message field
  • Click "Send" or press Enter to send messages
  • Watch the user list to see who's online
  • See typing indicators when others are typing

Project Structure

ChatServer/
├── ChatServer/           # ASP.NET Core server application
│   ├──        # SignalR hub implementation
│   ├──        # Server configuration and startup
│   └── appsettings.json # Server configuration
│
└── ChatClient/          # WPF desktop client
    ├──   # UI layout with custom styling
    ├──  # Client logic and SignalR connection
    └── Sounds/          # Notification sound files

License

This is a demonstration project for learning SignalR and real-time communication.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages