Iarly's Chat is a cloud-ready chat.
The Chat was written in .NET Core and can be executed in multiple server instances. The diagram below represents the flow of a message through a multi-server environment.
At the border, the nginx control the load-balance of the multiples server instances. The communication between each server occurs through the Redis Message Broker.
Iarly's Chat requires .NET core 3.1 and, optionally, docker-compose to run.
Install the dependencies & build...
$ dotnet restore
$ dotnet build
$ dotnet run --project Chat.Server
Build the docker-compose...
$ docker-compose build
Running Redis, MongoDb and 5 instances of chat-server...
$ docker-compose up --scale chat-server=5
For each client...
$ dotnet run --project Chat.Client.ConsoleApp
If you're using server multi-instance, you must use the nginx port (34000)...
$ dotnet run --project Chat.Client.ConsoleApp --port 34000
- /to <nickname> <message>: it sends a public message to another user
- /private <nickname> <message>: it sends a private message to another user
- /room <room>: it changes the current room of user
- /exit: it disconnects the user
--host <hostname>: it sets the host of the server (default is localhost)
--port <portnumber>: it sets the port of the server (default is 33000)
--host <hostname>: it sets the network interface where the socket is bound (default is localhost)
--port <portnumber: its sets the port number of the server (default 33000)
--redis <connectionString>: it sets the connection string of Redis Server (default is null)
--mongoDbConnection <connectionString>: it sets the connection stirng of mongo (default is null)
--mongoDbDatabase <databaseName>: it sets the database of mongo (default is null)
If you didn't set the redis or mongoDb configuration, the server will use the in-memory database and dummy message-broker and it will not work as multi-instance.