This project serves as a learning exercise in Rust, Tokio, Channels, and TUI (Terminal User Interface) programming. It features a room-based chat server with a Terminal User Interface (TUI), utilizing technologies such as Tokio, Ratatui, and a Redux-inspired architecture.
Note: This project is not suitable for production use. It's designed strictly for educational purposes.
To get the project up and running, follow these steps:
- Clone the repository:
git clone [email protected]:Yengas/rust-chat-server.git
- Make sure you have Rust and Cargo installed.
- Change to the project directory:
cd rust-chat-server
- Start the server:
cargo run --bin server
- Launch one or more TUI instances:
cargo run --bin tui
The project utilizes Rust Workspaces to divide itself into three sub-projects, each with its own README that details the concepts and architecture. Below is a brief overview:
- comms: This sub-project houses a library crate that provides Events and Commands used for server-client communication. It also offers client/server socket utilities, enabled via feature flags, to assist in serializing and deserializing events and commands.
- server: Built on the Tokio Runtime and using Tokio Channels, this sub-project implements a single-instance chat server that manages room states and user participation.
- tui: Leveraging Ratatui, this sub-project implements a terminal-based user interface. Users can connect to a chat server, join rooms, and send/receive messages. The code follows a Redux-inspired structure to separate state management from TUI rendering.
The project is distributed under the MIT License.