Skip to content

21pages/rust-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-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

dependency

  • rust
  • mysql

steps to build

backend

  1. get project

    git clone git@github.com:21pages/rust-chat.git
    cd rust-chat
  2. create mysql database with chat.sql

  3. modify .env

  4. sqlx preparation

    cargo install sqlx-cli
    cargo sqlx prepare
  5. build && run

    cargo run

frontend

  1. get project

    git clone git@github.com:kone-net/go-chat-web.git
    cd go-chat-web
  2. modify IP_PORTinsrc/common/param/Params.jsx

  3. prepare npm environment

    npm install
    
  4. run project

    npm start
  5. 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

About

write go-chat with rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published