Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Atheer2104/chat-grpc
Real-time Chat Microservice built in Rust using gRPC
https://github.com/Atheer2104/chat-grpc
grpc postgresql ratatui redis rust tokio tonic
Last synced: 7 days ago
JSON representation
Real-time Chat Microservice built in Rust using gRPC
- Host: GitHub
- URL: https://github.com/Atheer2104/chat-grpc
- Owner: Atheer2104
- License: mit
- Created: 2023-12-25T17:53:23.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-08-13T18:25:09.000Z (4 months ago)
- Last Synced: 2024-08-14T00:00:05.350Z (4 months ago)
- Topics: grpc, postgresql, ratatui, redis, rust, tokio, tonic
- Language: Rust
- Homepage:
- Size: 8.02 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ratatui - Chat-gRPC - A Real-time Chat Microservice built in Rust using gRPC, including a TUI client. (💻 Apps / 🤡 Social Media)
README
# Chat gRPC
**Chat gRPC** is a real-time chat service built entirely in Rust using gRPC (Google Remote Procedure Call). It follows a microservice architecture with two main components:
- **Auth Service**: Handles user authentication and registration.
- **Chat Service**: Manages message broadcasting to all connected clients.
The project is fully asynchronous, ensuring high performance and responsiveness. A Terminal User Interface (TUI) is provided to interact with the service.
## Video Showcase
![grab-landing-page](video-showcase.gif)
# Installation
## Requirements
- make sure that you have [docker](https://www.docker.com) installed
- make sure that you have [rust](https://www.rust-lang.org/tools/install) installed
- install [bunyan](https://github.com/trentm/node-bunyan) as below (this requires [node](https://nodejs.org/en/download/package-manager) to be installed first)
```sh
npm install -g bunyan
```## Set up repo
* Clone the repo with
```sh
git clone [email protected]:Atheer2104/chat-grpc.git
```* change the directory with
```sh
cd chat-grpc
```Now we will create PostgreSQL and Redis containers using docker, these containers can be stopped and restarted from the docker desktop for further usage.
* initialize PostgreSQL with
```sh
auth/scripts/init_db.sh
```
* Initialize Redis with
```sh
auth/scripts/init_redis.sh
```# Usage
* Create a separate terminal window and navigate to `cd chat-grpc/auth` and run the auth service with
```sh
cargo run --release --bin auth-server | bunyan
```- create a separate terminal window and navigate to `cd chat-grpc/chat` and run chat service with
```sh
cargo run --release --bin chat-server | bunyan
```Now you can start one or more clients by having a separate terminal window for each client navigating to `cd chat-grpc/client` and starting the client with
```bash
cargo run --release --bin chat-client
```# Technology
Main Technologies used
- [JWT](https://jwt.io) - Used to serve as an access token allowing users to be able to chat
- [PostgreSQL](https://www.postgresql.org) - Used to save user credentials and JWT access token
- [Redis](https://redis.io) - Used to cache JWT auth token
- [Tonic](https://docs.rs/tonic/latest/tonic/) - A rust gRPC library, Used to implement the gRPC functionality
- [Tokio](https://tokio.rs) - A rust Asynchronous runtime, Used to schedule and spawn asynchronous tasks
- [Tracing](https://github.com/tokio-rs/tracing) - Used to write logs asynchronously
- [Ratatui](https://ratatui.rs) - Used to create Terminal User Interfac# License
The project is licensed under the **MIT license**
See [LICENSE](LICENSE) for more information.