|
||
---|---|---|
.. | ||
docs | ||
src | ||
.gitignore | ||
Cargo.toml | ||
README.md |
README.md
🎮 Rust Chat Server - TUI Client
The tui
binary provides a terminal-based UI for the rust-chat-server. This interface communicates with the server using a TCP client via our comms library.
🛠 Technical Stack
- Async I/O: Leverages Tokio for asynchronous tasks and non-blocking I/O, integrating both Tokio Streams and Crossterm's EventStream.
- Flux-inspired Design: Implements a simplified Flux Architecture to decouple UI and user/server interactions, facilitated by Tokio Channels.
- TUI Rendering: Utilizes ratatui-org/ratatui for terminal-based UI rendering.
🏗 Architectural Overview
- State Store & UI Management Loop: On startup, the application initializes loops for both State Store and UI Management, and sets up channels for State Updates and User Actions.
- UI Management:
- Pages and Components sub-modules separate UI-related logic, resembling the structural design in modern web SPAs.
- State-linked components can emit User Actions like server connection requests, room joins, and message sends.
- A dedicated loop orchestrates the UI updates based on both state changes and terminal events.
- State Store:
- State Store subscribes to User Actions to manage server connections and commands.
- Upon processing User Actions or Server Events, State Store pushes the new state to the State Channel for UI updates.
🚀 Quick Start
Run the TUI client using cargo run
or cargo run --bin tui
. Upon bootstrap, you will be asked to enter a server address. The server address field will default to localhost:8080
. Press <Enter>
after entering the server you want to connect to.
Server disconnections will trigger a state reset, requiring re-login.