Feature/question panel - #11
Conversation
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR introduces a question management system with CRUD operations, backend seeding, and real-time synchronization. Changes include new Express routes for questions, a database seeding script, a reusable Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant QPanel as QuestionPanel
participant Socket as Socket.io
participant Server as Backend
participant DB as MongoDB
User->>QPanel: Load peer interview room
QPanel->>DB: getAllQuestions()
DB-->>QPanel: [questions array]
QPanel->>User: Render question list
alt User is host
User->>QPanel: Select question
QPanel->>QPanel: Update local selection
QPanel->>Socket: emit("question-change", {roomId, question})
Socket->>Server: Receive question-change
Server->>Socket: Broadcast to room participants
Socket-->>QPanel: Receive question-change
QPanel->>QPanel: Update selection state
QPanel->>User: Re-render with selected question
else User is guest
Socket-->>QPanel: Receive question-change
QPanel->>QPanel: Update selection state
QPanel->>User: Re-render with selected question
end
sequenceDiagram
actor Admin
participant Panel as AdminPanel
participant Form as Form Handler
participant API as questionAPI
participant Server as Backend
participant DB as MongoDB
Admin->>Panel: Load admin panel
Panel->>API: getAllQuestions()
API->>Server: GET /api/questions
Server->>DB: Query questions
DB-->>Server: Return questions
Server-->>API: Return data
API-->>Panel: Display question list
Admin->>Form: Fill question form
Admin->>Form: Submit form
Form->>API: createQuestion(payload)
API->>Server: POST /api/questions
Server->>DB: Insert question
DB-->>Server: Return saved document
Server-->>API: Return created question
API-->>Panel: Success
Panel->>Form: Reset form
Panel->>API: Reload getAllQuestions()
API-->>Panel: Update list with new question
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Added question panel with DB + form support
Summary by CodeRabbit
New Features
Chores