No description
  • Rust 98.4%
  • Nix 1.1%
  • HTML 0.5%
Find a file
vMohammad24 4faac691cc missed one
2026-02-26 20:51:00 +03:00
.cargo add CONTRIBUTING.md 2026-02-22 19:15:34 -05:00
migrations add CONTRIBUTING.md 2026-02-22 19:15:34 -05:00
src update deps + add redis 2026-02-26 20:50:39 +03:00
templates/email email verification with templates 2026-01-22 14:34:40 -05:00
.env.example implement local and s3 storage backends; add base URL configuration and update avatar handling (patch /me/avatar) 2026-02-05 22:13:56 +03:00
.envrc add dev env flake 2026-02-26 15:32:08 +03:00
.gitignore add dev env flake 2026-02-26 15:32:08 +03:00
.gitlab-ci.yml add CONTRIBUTING.md 2026-02-22 19:15:34 -05:00
Cargo.lock missed one 2026-02-26 20:51:00 +03:00
Cargo.toml missed one 2026-02-26 20:51:00 +03:00
CONTRIBUTING.md add CONTRIBUTING.md 2026-02-22 19:15:34 -05:00
flake.lock add dev env flake 2026-02-26 15:32:08 +03:00
flake.nix add dev env flake 2026-02-26 15:32:08 +03:00
LICENSE Update LICENSE 2026-02-14 18:06:03 -05:00
README.md user dms 2026-02-14 10:42:17 -05:00
routes.md change email route 2026-02-23 02:07:45 -05:00
rustfmt.toml Initial commit 2026-01-17 15:05:57 -05:00

hu backend

minimal chat application backend with dms, servers, channels, and voice chat.

stack

  • framework: actix-web
  • database: postgresql + sqlx
  • auth: hybrid (jwt + refresh tokens)
  • ids: ulids
  • password hashing: argon2
  • storage: s3 or local filesystem
  • api: versioned rest (/v1/...)

setup

cp .env.example .env
# edit .env with your values
cargo run

todo

phase 1 - foundation

  • health endpoints
  • project structure
  • database connection pool
  • sqlx migrations setup
  • configuration system (env vars)
  • error handling
  • api versioning (/v1/)
  • rate limiting middleware
  • per-endpoint rate limits
  • rate limit headers
  • basic api scaffolding
  • general 404

phase 2 - user system

  • user model and migrations
  • registration endpoint (with auto-login)
  • login endpoint
  • jwt access tokens (short-lived)
  • refresh tokens (stored in db, max 10 per user)
  • logout / token revocation
  • basic user profile (/users/me, /users/{id})
  • input validation and trimming
  • auth event logging
  • email verification (optional, configurable)
  • user settings (theme, allow_dms, typing indicators, public_email, language, timezone, allow_friend_requests)
  • validate timezone/language values
  • profile picture upload (s3/local)
  • friend system (requests, unfriend, privacy setting)

phase 3 - servers & channels

  • server model and migrations
  • create server
  • join/leave server
  • server invites (create, expiry, max uses)
  • server settings (name, icon, description)
  • server roles (owner, admin, member)
  • channel model and migrations
  • create/delete/rename channels
  • channel permissions

phase 4 - messaging

  • message model and migrations
  • dm conversations
  • channel messages
  • websocket connection handling
  • websocket rate limiting
  • real-time message delivery
  • message editing
  • message deleting
  • message history / pagination
  • message edit history (snapshots)
  • file attachments (multipart upload, s3/local)
  • typing indicators

phase 5 - presence

  • user online/offline status
  • custom status messages
  • presence broadcasting via websocket
  • last seen tracking

phase 6 - voice

  • voice channel model
  • voice state tracking
  • webrtc signaling endpoints
  • voice channel join/leave

phase 7 - federation (future)

  • add more permissions
  • instance identity and keys
  • user identity format (@user@instance)
  • instance-to-instance protocol
  • cross-instance message delivery
  • instance discovery and trust