Giter Site home page Giter Site logo

nag763 / tchatchers Goto Github PK

View Code? Open in Web Editor NEW
171.0 2.0 15.0 5.57 MB

tchatchers is a blazing fast chat application built with Axum and Yew.rs

Home Page: https://tchatche.xyz

License: MIT License

Rust 97.55% HTML 0.37% Shell 0.30% JavaScript 0.20% CSS 0.60% PLpgSQL 0.99%
axum rust wasm websockets yew nginx postgresql redis

tchatchers's Introduction

ci.yml tchatchers-stars tchatchers-license github-issues instance-health

tchatchers

A blazing fast chat application built with Axum and yew.rs ๐Ÿš€

TL;DR

  • ๐Ÿ’ฌ tchatchers is a realtime chat application built with yew.rs (frontend) and axum (backend) frameworks.
  • โœ”๏ธ Easy to use, only requires authentication informations to be used.
  • ๐Ÿš€ Blazing fast, completely built on Rust.
  • ๐ŸŒ” Supports browser's dark mode.
  • โœจ Simple yet elegant UI.
  • ๐Ÿ“– Translated in several languages.
  • ๐Ÿ”’ With little data collected and robust security, this app is completly secured.
  • ๐Ÿšข This application is fully optimized to be as small as possible for production environments.

How to access the application

The application is deployed on https://tchatche.xyz and should be compatible with any modern navigator.

It was formerly on tchatchers but the domain name renewal fee was too expensive.

About

tchatchers is an application used to help clients to communicate between each others. It is built with yew.rs and axum server in order to provide blazing fast responses and strong API.

The main application's usage is to create rooms to talk between people being connected to the application. You like football ? Try the football room. You like philosophy ? Try the philosophy one.

All depends on you to chat how you want to .

๐Ÿ†• Installing the application locally and starting developping

Follow this guide.

Project structure

.
โ”œโ”€โ”€ Cargo.lock => Dependency lock file generated by Cargo
โ”œโ”€โ”€ Cargo.toml => Main configuration file for the Rust project
โ”œโ”€โ”€ CODE_OF_CONDUCT.md => Code of conduct for contributors
โ”œโ”€โ”€ docker-compose_dev.yml => Docker compose file for development environment
โ”œโ”€โ”€ docker-compose.yml => Docker compose file for production environment
โ”œโ”€โ”€ Dockerfile_back => Dockerfile for building the backend service
โ”œโ”€โ”€ Dockerfile_front => Dockerfile for building the frontend service
โ”œโ”€โ”€ Dockerfile_tct => Dockerfile for building the TCT tool
โ”œโ”€โ”€ LICENSE.MD => License file for the project
โ”œโ”€โ”€ Makefile.toml => Makefile for building and testing the project
โ”œโ”€โ”€ README.md => Project README file
โ”œโ”€โ”€ SETUP.md => Instructions for setting up the development environment
โ”œโ”€โ”€ setup.sh => Shell script for setting up the development environment
โ”œโ”€โ”€ tchatchers_back => Rust crate for the backend service
โ”œโ”€โ”€ tchatchers_cli_tools => Rust crate for command-line tools
โ”œโ”€โ”€ tchatchers_core => Rust crate for shared core functionality
โ””โ”€โ”€ tchatchers_front => Rust crate for the frontend service
โ””โ”€โ”€ tchatchers_async => Rust crate for the asynchronous service

Rustdoc

The rustdoc can be found for each subproject at :

  • tchatchers_core : here
  • tchatchers_back : here
  • tchatchers_front : here
  • tchatchers_async : here
  • tct (tchatchers_cli_tool): here

Technologies used

Technology/Framework Utility Version
Rust Programming language 1.68.2
Tailwind Stylesheets 3.X
yew.rs WASM Frontend framework 0.20
axum Rust server 0.6.12
trunk-rs Rust development WASM server 0.16
nginx Reverse proxy server latest
Postgres SQL engine latest
Redis Messaging and cache latest

Production project architecture

The production architecture consists of several layers :

  • The client, who uses the application and interacts with the different ressources.
  • The proxy layer, that defines some security constraints such as BruteForce mitigation, the HTTPS connection, the read time out and HTTP headers. This layer is the sole entry point for the client to the application, as others aren't publicly reachable since they are on another network.
  • The applicative layer : This contains two noticeable applicative layers :
    • First, the front layer, a static WASM file being downloaded once by the client and then used to display the application's data to the client. Understand that there is no server side rendering.
  • The Asynchronous Layer: This layer, introduced in the updated architecture, is responsible for processing queued messages stored in Redis. It includes components such as the asynchronous payload, processor, and queue modules. These modules facilitate the retrieval, processing, and deletion of messages from the Redis queue.
    • Secondly,the API layer, used to persist the application data, besides of permitting operations such as authentication and translation.
  • The data layer : Mainly used for persistence. The choice has been made to persist all the data onto a Postgres database, both the user's data and the chats. On network level, the data layer can only be accessed by the API layer, and is not exposed publicly. Redis on its side mainly stores the authorization and refresh tokens.

Postgres schema

Made with one of my other tools, doteur.

img

Personnal objectives behind this project, feedback

My goal with this project was to learn more about both WASM and Websocket technologies besides of perfecting my Rust knowledge. It was really nice to build such a project and I hope it can inspire or help other peoples to built similar tools. I think the code is pretty good (even though it should be perfectible) on the back and core projects, but quite perfectible on the front one. It is to note that there are still some bugs remaining.

My feeling is that both Rust and WASM have a pretty good future when it comes to frontend apps. The backend side of Rust already has several frameworks that are making it a reliable language when it comes to handling data logic, and the development of yew.rs or similar technologies in the future could be a game changer for the interest users and firms have toward the language.

Special thanks

Thanks to the Rust community for all their advices and their time reviewing my project, it's always a pleasure to be part of such a community. ๐Ÿ˜Š ๐Ÿฆ€

tchatchers's People

Contributors

nag763 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tchatchers's Issues

Setting up the application

Is your feature request related to a problem? Please describe.
I am having trouble setting up the project in a local environment and in a Docker container, specifically with configuring the Postgres host.

Describe the solution you'd like
I would like to have clear and concise installation guides that provide instructions on how to set up the project both locally and in a Docker container, including how to properly configure the Postgres host.

Describe alternatives you've considered
I have not considered any alternatives as I am not familiar with how to set up the project properly.

Additional context
The Postgres host seems to be hardcoded in tchatchers_core/src/pool.rs, and it would be helpful to have instructions on how to configure it properly in the installation guides.
Thank you for your great work on this project :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.