GroupChat2
GroupChat2 is a full-stack group chat application with live rooms, invite flows, profile management, image uploads, and an AI participant that can respond in-room using OpenRouter plus web tools.
The project is split into two main apps:
What It Does
- Real-time group chat over WebSockets
- Account registration and login with JWT auth
- Optional Nostr-based authentication
- Room creation, membership, invite links, and Nostr invites
- AI-assisted rooms with configurable model, prompt, and assistant name
- Streaming AI responses with tool usage indicators
- Chat image uploads and user avatar uploads
- Message permalinks backed by stored message hashes
- SQLite persistence with automatic startup backups
Project Layout
GroupChat2/
|- client/ Riot.js + Vite single-page app
|- server/ Rust + Axum API, WebSocket server, SQLite storage
|- dev.ps1 Windows dev runner
|- dev.sh macOS/Linux dev runner
|- prod.sh Production build/run script
Stack
- Frontend: Riot.js, Vite, vanilla JS, markdown-it, highlight.js
- Backend: Rust, Axum, Tokio, SQLx, SQLite
- AI: OpenRouter with optional Tavily or Brave search
- Auth: JWT, Argon2 passwords, Nostr challenge/verify flow
Quick Start
- Copy
server/.env.exampletoserver/.env. - Fill in at least
OPENROUTER_API_KEYand the search provider keys required bySEARCH_PROVIDER. - Start the app with one of the repo scripts:
./dev.ps1
./dev.sh
If you prefer running each side manually:
cd server
cargo run
cd client
npm install
npm run dev
Default local ports:
- Windows dev script: client
http://localhost:3000, serverhttp://localhost:3001 - macOS/Linux dev script: client
http://localhost:3003, serverhttp://localhost:3002 - Manual defaults: client
http://localhost:3000, serverhttp://localhost:3001
Development Notes
- The client proxies
/api,/ws, and/uploadsto the server during local development. - The server serves
client/distdirectly in production. - Database migrations are executed at server startup.
- Before opening the SQLite database, the server creates a timestamped backup and retains the 10 most recent copies.
Where To Read Next
- Client README for UI structure, frontend commands, and browser behavior
- Server README for env vars, endpoints, storage, and backend architecture
Description
Languages
Rust
44.8%
Riot
41.1%
JavaScript
7.9%
Shell
2.9%
CSS
2%
Other
1.3%