Skip to content

feat(backend): real-time messaging via Socket.IO with persistent storage#3

Merged
codebestia merged 5 commits into
mainfrom
feat/orm-setup
May 12, 2026
Merged

feat(backend): real-time messaging via Socket.IO with persistent storage#3
codebestia merged 5 commits into
mainfrom
feat/orm-setup

Conversation

@codebestia

Copy link
Copy Markdown
Owner

Summary

  • Extended schema with conversations (dm/group enum), conversation_members, and messages tables; generated migration 0001_messaging.sql
  • src/socket/messaging.ts — four Socket.IO event handlers:
    • create_conversation — creates a DM or group conversation, adds all members
    • join_room — subscribes the caller to a Socket.IO room after validating membership
    • send_message — persists message to DB, broadcasts new_message to all room members
    • message_history — fetches last 30 messages with cursor-based pagination (before message ID)
  • All handlers guard against non-members and empty content
  • GET /conversations REST route — returns all conversations + members for the authenticated user
  • Registered messaging handlers in io.on('connection') alongside existing auth middleware

@codebestia codebestia merged commit 72ec7e6 into main May 12, 2026
1 check failed
codebestia added a commit that referenced this pull request Jun 26, 2026
feat(backend): real-time messaging via Socket.IO with persistent storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant