This is a simple chatroom written in Rust/Rocket.
A rocket example project from the official website. I have added some features to it.
- Multiple users connect to the chatroom.
- Auto reconnection.
- Storage messages in Sqlite. (Use
sqlx
) - Represent the time of messages.
- Show the ip of the sender.
- Add protection of the frontend.
- Add mobile phone UI support.
- ...
ensure you have installed rustup
and cargo
. If you have rust environments getted ready, you can build and run the backend project with the following commands:
cargo build
cargo run
the default host and port is 127.0.0.1, 8000
. You can change it by adding env variables:
ROCKET_ADDRESS=0.0.0.0 ROCKET_PORT=80 cargo run
After all tests passed, you can build with release. Just build with cargo build --release
.
In root directory, run npm install
to install dependencies. My frontend skill is bad, sorry :(