Skip to content

feat: real-time collaboration rooms — chat, notes, editor, voice/vide…#148

Open
StackFox wants to merge 2 commits into
ARUNNG2004:mainfrom
StackFox:feat/real-time-collaboration-rooms
Open

feat: real-time collaboration rooms — chat, notes, editor, voice/vide…#148
StackFox wants to merge 2 commits into
ARUNNG2004:mainfrom
StackFox:feat/real-time-collaboration-rooms

Conversation

@StackFox

@StackFox StackFox commented Jul 4, 2026

Copy link
Copy Markdown

Summary

Closes #136

Adds real-time collaboration rooms to DevConnect AI — a full-featured workspace where developers can create rooms, chat, share notes, co-edit code, and join voice/video calls, all backed by Firestore and WebRTC.

What's included

Room Hub (/rooms)

  • Create rooms with title, description, language, and public/private visibility
  • Browse and join existing rooms from a real-time filtered list
  • Room cards show language tag, member count, online status, and creator info

Room Workspace (/rooms/[roomId])

Three-panel resizable layout with draggable dividers:

  • Chat — live messages via Firestore onSnapshot, send-on-enter, timestamps, sender names
  • Shared Notes — auto-saved markdown notes with debounced Firestore sync
  • Code Editor — Monaco editor with syntax highlighting, language picker, debounced sync, remote cursor overlay

Voice / Video / Screen Share

  • WebRTC peer-to-peer calls with mesh topology (~6 peers)
  • Mic toggle, camera toggle, screen share controls
  • Echo prevention: remote <video> muted, dedicated <audio> element for remote audio
  • Draggable camera preview showing the remote peer; local camera in a small header indicator
  • Screen share with live preview, native stop detection, and renegotiation support

Presence & Awareness

  • Real-time member list with online/offline status
  • Heartbeat-based presence (Firestore presence subcollection, 15s interval)
  • Remote cursor position tracking in the code editor

AI Room Summaries

  • Generate meeting summaries from chat messages and notes via Sarvam AI (/api/rooms/[roomId]/summary)
  • Server-side Firestore fetch (no client-side data bundling)
  • Summary rendered in a modal with react-markdown + remark-gfm for rich markdown
  • Modal: backdrop blur, max-width 640px, Escape key / click-outside to close
  • Content-aware caching: button shows "View Summary" after generation, resets to "Generate Summary" when any workspace content changes (chat, notes, or code)

Dashboard Integration

  • "Rooms" nav item added to the left sidebar
  • "Coding Rooms" promo widget added to the right sidebar with an "Open Rooms" CTA

Files changed

New files (22)

File Purpose
app/rooms/page.js Room hub — list/create rooms
app/rooms/[roomId]/page.js Room workspace — 3-panel layout
app/rooms/[roomId]/layout.js Pass-through layout
app/rooms/[roomId]/messages/[messageId]/ Stub route
app/rooms/[roomId]/notes/[noteId]/ Stub route
app/rooms/[roomId]/presence/[uid]/ Stub route
app/api/rooms/[roomId]/summary/route.js AI summary API endpoint
components/rooms/RoomCallControls.js Voice/video/screen controls + camera preview
components/rooms/RoomChat.js Real-time chat panel
components/rooms/RoomCursorLayer.js Remote cursor overlay
components/rooms/RoomEditor.js Collaborative Monaco editor
components/rooms/RoomLanguagePicker.js Language/version picker
components/rooms/RoomMembers.js Online member list
components/rooms/RoomNotes.js Shared markdown notes
components/rooms/RoomSummaryButton.js Generate/view summary button
components/rooms/RoomSummaryModal.js Markdown summary modal
lib/firebase-admin.js Server-side Firebase init (client SDK)
lib/rooms.js Room CRUD helpers
lib/webrtc.js WebRTC signaling, ICE, renegotiation

Modified files (8)

File Change
README.md Added rooms features, project structure, routes, Firestore docs
app/globals.css Added .markdown styles for summary rendering
components/dashboard/LeftSidebar.js Added "Rooms" nav item
components/dashboard/MobileView.js Added "Rooms" mobile nav
components/dashboard/RightSidebar.js Added "Coding Rooms" promo widget
package.json Added react-markdown, remark-gfm
package-lock.json Lockfile update
postcss.config.mjs Updated PostCSS config for Tailwind v4

Tech stack used

  • Next.js 16 (App Router) — routes, API handlers, server/client components
  • Firebase (Auth + Firestore) — real-time data, presence, signaling
  • WebRTC — peer-to-peer audio/video/screen-share
  • Monaco Editor — collaborative code editing
  • Sarvam AI — AI summary generation
  • react-markdown + remark-gfm — markdown rendering in summary modal

Testing

  • npm run build — passes cleanly
  • npm run check:structure — passes
  • Manual testing required: create a room, join from a second tab/device, verify chat, notes, code sync, camera, microphone, screen share, and summary generation

Notes

  • Firebase Admin SDK service account credentials are not configured; lib/firebase-admin.js uses the client firebase package with NEXT_PUBLIC_FIREBASE_* env vars for server-side Firestore access
  • WebRTC uses a mesh topology (each peer connects to every other peer), suitable for rooms with up to ~6 participants
  • Summary generation requires a valid SARVAM_API_KEY in .env.local

Copilot AI review requested due to automatic review settings July 4, 2026 19:27
@netlify

netlify Bot commented Jul 4, 2026

Copy link
Copy Markdown

👷 Deploy request for devconnectai pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 72ecc37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Collaboration Rooms to DevConnect AI, adding new /rooms routes and supporting components for a real-time workspace experience (chat, shared notes, collaborative code editor, WebRTC calling) plus an AI-powered room summary API route.

Changes:

  • Added Rooms hub (/rooms) and Room workspace (/rooms/[roomId]) with real-time Firestore-backed chat, notes, presence/cursors, and Monaco editor sync.
  • Added WebRTC calling utilities + UI controls for voice/video/screen sharing inside rooms.
  • Added AI room summary generation endpoint and UI (summary button + markdown modal), plus dashboard navigation/promotions and markdown styling.

Reviewed changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
README.md Documents collaboration rooms feature set, routes, and Firestore collections.
postcss.config.mjs Minor formatting/update aligning with Tailwind v4 PostCSS plugin usage.
package.json Adds new client dependencies for rooms (Monaco, markdown rendering, toasts).
package-lock.json Lockfile updated for new dependencies.
app/globals.css Adds .markdown styling for rendered summaries/notes.
app/rooms/page.js Rooms hub UI: real-time rooms list + create-room modal.
app/rooms/[roomId]/layout.js Pass-through layout for room workspace route.
app/rooms/[roomId]/page.js Room workspace: 3-panel resizable layout + summary UI + presence heartbeat + call controls.
app/rooms/[roomId]/messages/[messageId]/layout.js Stub layout for message route segment.
app/rooms/[roomId]/messages/[messageId]/page.js Stub page for message route segment.
app/rooms/[roomId]/notes/[noteId]/layout.js Stub layout for notes route segment.
app/rooms/[roomId]/notes/[noteId]/page.js Stub page for notes route segment.
app/rooms/[roomId]/presence/[uid]/layout.js Stub layout for presence route segment.
app/rooms/[roomId]/presence/[uid]/page.js Stub page for presence route segment.
app/api/rooms/[roomId]/summary/route.js Room summary generation endpoint (Firestore fetch + Sarvam AI call + fallback).
components/rooms/RoomChat.js Firestore onSnapshot chat panel with send-on-submit behavior.
components/rooms/RoomNotes.js Firestore-backed shared notes with debounced persistence.
components/rooms/RoomEditor.js Monaco editor with debounced Firestore sync and cursor persistence to presence.
components/rooms/RoomCursorLayer.js Remote cursor badges overlay using presence docs.
components/rooms/RoomMembers.js Presence list UI derived from presence heartbeat timestamps.
components/rooms/RoomCallControls.js WebRTC call control bar + draggable previews + in-component toasts.
components/rooms/RoomSummaryButton.js Summary generation/view button with toast feedback.
components/rooms/RoomSummaryModal.js Modal that renders summary markdown with GFM support.
components/rooms/RoomLanguagePicker.js Language/version picker UI (currently broken in diff).
components/dashboard/LeftSidebar.js Adds “Rooms” navigation entry.
components/dashboard/MobileView.js Adds “Rooms” tab routing on mobile.
components/dashboard/RightSidebar.js Adds “Coding Rooms” promo widget CTA to /rooms.
lib/rooms.js Room CRUD/presence helper module (some functions stubbed).
lib/webrtc.js Firestore-based signaling + mesh WebRTC utilities for calls/screen share.
lib/firebase-admin.js Server Firestore accessor used by the summary API route.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +20
const roomDoc = await getDoc(doc(db, "rooms", roomId));
const roomData = roomDoc.exists ? roomDoc.data() : {};
const title = roomData.title || "Collaboration Room";
const language = roomData.language || "Not specified";
const LANG_COLORS = {
JavaScript: "#f7df1e",
TypeScript: "#3178c6",
Python: "#377ab",
}

setIsGeneratingSummary(true);
setShowSummaryHistory(false);
Comment on lines +16 to +23
<ul>
{languages.map((language, version) => {
<li key={language}>{language}
&nbsp;
<div>{version}</div>
</li>
})}
</ul>
python: "3.10.0",
java: "15.ø.2",
csharp: "6.12.0",
Php: "8.2.3",
</div>
))}
</div>
<form style={S.inputArea} onSubmit={handleSend} role="search" aria-label="Send chat message">
Comment thread lib/webrtc.js
Comment on lines +618 to +622
try { state.unsubParticipants?.(); } catch (_) {}
try { state.unsubIce?.(); } catch (_) {}
state.unsubParticipants = null;
state.unsubIce = null;
state.iceListeners.clear();
Comment thread package.json
Comment on lines 29 to 31
"firebase": "^12.14.0",
"firebase-admin": "^14.1.0",
"lucide-react": "^1.17.0",
@ARUNNG2004

Copy link
Copy Markdown
Owner
image 1.there is no exit button to dashboard 2. not able to delete the rooms image
  1. there not having the button to completed or close the call

@StackFox StackFox force-pushed the feat/real-time-collaboration-rooms branch from 99ec754 to 13eaffc Compare July 5, 2026 18:25
@StackFox

StackFox commented Jul 5, 2026

Copy link
Copy Markdown
Author
image

Fix: Now the delete room button works

image

Feat: Added an exit to Dashboard button

image

Fix: The end call button now works

@ARUNNG2004

Copy link
Copy Markdown
Owner

resolve conflict

@StackFox

StackFox commented Jul 6, 2026

Copy link
Copy Markdown
Author

resolve conflict

Done 👍

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.

Feature: Real-Time Collaboration Rooms

3 participants