This is rust implementation of go-chat.
This project is to use rust to do what go can do.
They share the same database and frontend.
go-chat | rust-chat | |
---|---|---|
backend | gin | axum |
frontend | react | react |
database | mysql | mysql |
orm/sql-package | gorm | sqlx |
log | zap | tracing |
config | viper | dotenv |
protobuf | github.com/gogo/protobuf/proto | prost |
coroutine | go routine | tokio task |
channel | go channel | tokio channel |
websocket | github.com/gorilla/websocket | axum websocket |
- rust
- mysql
-
get project
git clone git@github.com:21pages/rust-chat.git cd rust-chat
-
create mysql database with
chat.sql
-
modify
.env
-
sqlx preparation
cargo install sqlx-cli cargo sqlx prepare
-
build && run
cargo run
-
get project
git clone git@github.com:kone-net/go-chat-web.git cd go-chat-web
-
modify
IP_PORT
insrc/common/param/Params.jsx
-
prepare npm environment
npm install
-
run project
npm start
-
visit frontend entry
http://127.0.0.1:3000
- | axum router, cors
- | sqlx, model map
- | user register, login, friends, group join
- | message
- | appstate, channel, websocket
- | file upload & download
- | kafka