This is a chat application written in C# .NET Core 2.0, using a ASP.NET Core Web Application implementing SignalR for realtime comunication and a Decoupled ChatBot Microservice that communicates with the WebApp using RabbitMQ.
- User Registration and Login using an email
- Chatroom for several users
- Stock Updates with command \stock=stock_symbol
ChatStockBot requires Visual Studio 2017 With .NET Core 2.0 Installed. It also needs RabbitMQs v3.7.17, RabbitMQ requires ERLang OTP v22.
ChatStockBot needs at least SQL Server Express for it's data persistence needs.
Nuget Package Manager will automatically restore all the dependencies required for each project when opening the project or atempting to compile it.
ChatStockBot uses .NET Core Entity Framework code first approach for it's Data Access Layer, currently I have the connection string configured to use SQL Server Express LocalDB
. The Connection string needs to be updated if a different version of SQL Server is used.
In order to execute the migration for the table creation, run the following command in the Package Manager Console, located at Tools > Nuget Package Manager > Package Manager Console
Make sure the Default Project is ChatLogicLayer
$ Update-Database
Migrations can also be run with the dotnet
cli command, preferably in a PowerShell
terminal
$ cd {ChatLogicLayer Project folder inside the Solution}
$ dotnet ef database update
In order to run the ChatBotBroker and the WebApp I recommend configuring the solution to run Multiple Startup Projects
in order to configure this right click the solution and go to Properties
inside the dialog select CommonProperties > Startup Project. Select Multiple startup projects and set ChatBotBroker and ChatLogicLayer action to Start
Tests can be run using the integrated Visual Studio tool or using the dotnet
cli tool in a PowerShell
terminal:
$ cd {test project folder}
$ dotnet test
Project | Description |
---|---|
ChatLogicLayer | Web Application |
ChatBotBroker | Console App with the Bot Broker Service |
ChatBotBroker.Test | xUnit Test Project |
ChatBot.Models | Class Library |
- Add Repository Pattern for the EF DbContext
- Add Signed SSL
- When moving to production RabbitMQ should have non-default username and password
- Find a way to have a single configuration file elegantly (I found a way but it's too hacky)