SignalR Chat demo with authorization using Identity Server. Written in ASP.NET Core 3.1, MVC and JS. Based on Tutorial: Get started with ASP.NET Core SignalR and extended with user management and private messages.
Clone this repository, and open solution using Visual Studio 2019 or later. Then Build and Run the SignalR project.
- Visual Studio 2019
- ASP.NET Core 3.1
Projects:
- ChatCore - Complete chat logic
- SignalR - Website presentation
All chat logic has moved to ChatCore project. This way is simpler to change Presentation Layer (Website). It`s bit more complicated, but all methods and classes are documented.
Still uses simplest in memory storage methods for users.
Interesting paths:
~/Startup.cs
~/Hubs/ChatHub.cs
~/Services/ChatService.cs
~/Services/MessageHandlers
Website is simple MVC template with In-application Authorization.
To use chat log-in as user, then Chat tab will appear at main menu. Navigate to Chat view and send messages.
It's probably better to have multiple clients connected, you can use privacy mode or other browsers.
Interesting files:
~/Startup.cs
~/wwwroot/js/chat.js
~/wwwroot/lib/microsoft/signalr
~/Views/Home/Chat.cshtml
- User accounts
- SignalR chat
- Private messages
/pm: username message
- User list
/users
- Connect messages
- Private messages
- ASP.NET Core 3.1 - Framework
- Visual Studio 2019 - IDE
- SignalR - Real-time communication lib
- Identity Server - Authorization, authentification and account management
This project is licensed under the MIT License - see the LICENSE.txt file for details
Found this project useful or want to buy me a 🍺, ☕, 🍵. Consider donating using buttons bellow.