๐Ÿ“ฆ 21pages / rust-chat

write go-chat with rust

โ˜… 4 stars โ‘‚ 1 forks ๐Ÿ‘ 4 watching
๐Ÿ“ฅ Clone https://github.com/21pages/rust-chat.git
HTTPS git clone https://github.com/21pages/rust-chat.git
SSH git clone git@github.com:21pages/rust-chat.git
CLI gh repo clone 21pages/rust-chat
21pages 21pages log 747af22 3 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ src
๐Ÿ“„ .env
๐Ÿ“„ .gitignore
๐Ÿ“„ build.rs
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ chat.sql
๐Ÿ“„ README.md
๐Ÿ“„ sqlx-data.json
๐Ÿ“„ README.md

introduction

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.

comparison

go-chatrust-chat
backendginaxum
frontendreactreact
databasemysqlmysql
orm/sql-packagegormsqlx
logzaptracing
configviperdotenv
protobufgithub.com/gogo/protobuf/protoprost
coroutinego routinetokio task
channelgo channeltokio channel
websocketgithub.com/gorilla/websocketaxum websocket

dependency

  • rust
  • mysql

steps to build

backend

  • 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

frontend

  • get project
git clone git@github.com:kone-net/go-chat-web.git
    cd go-chat-web

  • modify IP_PORTinsrc/common/param/Params.jsx
  • prepare npm environment
npm install

  • run project
npm start

  • visit frontend entry http://127.0.0.1:3000

schedule

  • | axum router, cors
  • | sqlx, model map
  • | user register, login, friends, group join
  • | message
  • | appstate, channel, websocket
  • | file upload & download
  • | kafka