Skip to content

Conversation

vbmade2000
Copy link

This commit adds a simple chat server and a CLI client.

Workspace is divided into 4 crates.

  1. server - A chat server.
  2. client - A chat client.
  3. common - A crate containing common functionalities.
  4. integration_tests - A crate containing integration tests.

Both Client and Server use tokio crate for asynchronous development.

(Potential) issues with code.

  1. Integration tests are written but not executable as they are unreliable.
  2. Although tracing crate is used for logging but it may make increase memory footprint.
  3. In logging, tracing span is not removed and it remains with every function call. So for each client, every next log contains current span info plus previous span info. Big issue IMHO. For now, no idea why it is happening and how to solve it.

cargo run -p server -- --ip <IP> --port <PORT>

cargo run -p cli-client -- --host <IP> --port <PORT> --username <username> or
SIMPLE_CHAT_SERVER_HOST=<IP> SIMPLE_CHAT_SERVER_PORT=<PORT> cargo run -p cli-client -- --username <USERNAME>

cargo build --release
cargo test

simple-chat.mp4

This commit adds a simple chat server and a CLI client.

Workspace is divided into 4 crates.
1. `server` - A chat server.
2. `client` - A chat client.
3. `common` - A crate containing common functionalities.
4. `integration_tests` - A crate containing integration tests.

Both Client and Server use `tokio` crate for asynchronous development.

(Potential) issues with code.
1. Integration tests are written but not executable as they are unreliable.
2. Although `tracing` crate is used for logging but it may make increase memory footprint.

`cargo run -p server -- --ip <IP> --port <PORT>`

`cargo run -p cli-client -- --host <IP> --port <PORT> --username <username>`
or
`SIMPLE_CHAT_SERVER_HOST=<IP> SIMPLE_CHAT_SERVER_PORT=<PORT> cargo run -p cli-client -- --username <USERNAME>`

`cargo build --release`
`cargo test`

https://github.com/user-attachments/assets/a4c163e2-d29b-40ab-97e2-037e86164486

Signed-off-by: Malhar Vora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant