Skip to content

[Enhancement] CommandPalette poll creation has no backend integration #768

Description

@RUKAYAT-CODER

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions