Overview
src/components/CommandPalette.tsx line 322 has a TODO comment indicating that poll creation needs to be connected to a backend. Currently the UI for creating polls is present but submitting a poll does nothing — the data is never persisted and no participants see the poll.
Specifications
Features:
- Poll creation via the command palette persists the poll to the backend
- Participants in the current session see the poll in real time via WebSocket
Tasks:
- Create
src/app/api/polls/route.ts with POST (create) and GET (list) handlers
- Store polls in a
polls database table with fields: id, question, options, course_id, created_by, created_at
- In the command palette submit handler, call the polls API and broadcast the new poll via Socket.io
- Update the WebSocket server to handle
poll:created and poll:vote events
Impacted Files:
src/components/CommandPalette.tsx
src/app/api/polls/ (new)
Acceptance Criteria
- Creating a poll via the command palette persists it to the database
- Poll appears for other connected participants within 1 second
- No TODO comment remains in
CommandPalette.tsx related to poll creation
Overview
src/components/CommandPalette.tsxline 322 has a TODO comment indicating that poll creation needs to be connected to a backend. Currently the UI for creating polls is present but submitting a poll does nothing — the data is never persisted and no participants see the poll.Specifications
Features:
Tasks:
src/app/api/polls/route.tswith POST (create) and GET (list) handlerspollsdatabase table with fields:id,question,options,course_id,created_by,created_atpoll:createdandpoll:voteeventsImpacted Files:
src/components/CommandPalette.tsxsrc/app/api/polls/(new)Acceptance Criteria
CommandPalette.tsxrelated to poll creation