Skip to content

Thehacker-arch/brochat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to BroChat

Void Welcome

BroChat is a privacy-respecting, minimalist real-time chat application built from scratch for niche businesses that need simple, secure, and effective communication. Just like Slack, but stripped to the essentials — public chat, DMs, no distractions.

Built with:

  • Rust + Axum backend (fast, safe, async-ready)
  • Tauri + Vue.js frontend (native desktop feel with web flexibility)
  • PostgreSQL database (reliable, relational, robust)

🛠️ Tech Stack

Layer Stack
Backend Rust + Axum
Frontend Tauri + Vue.js 3
Database PostgreSQL
Auth JWT
Protocol WebSockets (for real-time chat)

🧠 Why BroChat?

Most chat platforms are bloated, full of unnecessary features and data mining. BroChat focuses on core communication:

  • Public Chat — where every registered user can participate.
  • Direct Messages (DMs) — for one-on-one convos with end-to-end routing.
  • Built from scratch, not on any third-party chat API.
  • Designed for cross-platform deployment via Tauri.
  • Uses JWT-based authentication for secure login and user sessions.

Perfect for:

  • Small teams
  • Niche internal networks
  • Companies wanting chat ownership (no third-party dependencies)

🚀 Features

  • ✅ Auth system with login & registration
  • ✅ Real-time Public Chat
  • ✅ Real-time Direct Messaging (DMs)
  • ✅ Avatar upload support (optional)
  • ✅ Native app for all platforms (Tauri-powered)
  • 🔒 Token-based auth (no cookie mess)
  • 🔧 Fully customizable & open source

Void Welcome Void Welcome

Run Locally

⚠️ Requirements: Rust, Node.js, PostgreSQL, Tauri CLI

Commands in backend folder

export DATABASE_URL=postgres://name:port@localhost/database_name
cargo sqlx prepare

Command for android (in UI/frontend)

export ANDROID_HOME="$HOME/Library/Android/sdk"
export NDK_HOME="$ANDROID_HOME/ndk/$(ls -1 $ANDROID_HOME/ndk)"
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"

Database commands

Open Database

psql -U name -d database_name

CREATE

psql -U name -d postgres -c "CREATE DATABASE database_name;"

DELETE

psql -U name -d postgres -c "DROP DATABASE database_name;"

Migrate

sqlx migrate run

1. Backend (Rust + Axum)

cd brochat/backend
cargo run

2. Frontend (Rust + VueJs)

cd brochat/UI/frontend/

For Web

npm run dev

For android

cargo tauri android dev

Production APK build, signing, and sharing: see docs/ANDROID.md.

For ios

cargo tauri ios dev

For Desktop

cargo tauri dev

Deploy on AWS (Easiest: Single EC2 + Docker Compose)

1) Launch EC2

  • Ubuntu 24.04 instance
  • Open inbound ports: 22 (SSH), 80 (HTTP), 443 (HTTPS)

2) Install Docker on EC2

sudo apt-get update
sudo apt-get install -y docker.io docker-compose-v2
sudo usermod -aG docker $USER
newgrp docker

3) Copy project and start services

git clone <your-repo-url>
cd brochat
docker compose up --build -d

4) Run database migration once

Your backend expects the schema from backend/migrations/20250502140530_init.sql. Copy and execute migration in the postgres container:

docker cp backend/migrations/20250502140530_init.sql $(docker compose ps -q db):/tmp/init.sql
docker compose exec db psql -U brochat -d brochat -f /tmp/init.sql

5) Production env values

  • Set a strong JWT_SECRET in docker-compose.yml
  • Set ALLOWED_ORIGINS to your domain(s)
  • Optional: add TLS with Nginx + Certbot or place ALB/CloudFront in front

About

A minimalist chat application for niche teams

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors