Skip to content

[BACKEND] RSVP system — event_rsvps D1 table + POST/DELETE /events/:id/rsvp #301

Description

@linear

The frontend RSVP flow is complete (event detail screen, ConfirmModal, RsvpSuccessToast) but currently uses a temporary in-memory store (app/lib/rsvpStore.ts). This ticket replaces that with real backend support.

Build steps

  1. Create event_rsvps table in D1:
CREATE TABLE event_rsvps (
  user_id TEXT NOT NULL,
  event_id INTEGER NOT NULL,
  created_at TEXT NOT NULL DEFAULT (datetime('now')),
  PRIMARY KEY (user_id, event_id)
);
  1. POST /events/:id/rsvp — auth-gated, inserts a row (idempotent)
  2. DELETE /events/:id/rsvp — auth-gated, removes row
  3. Expose is_rsvped: boolean on GET /events/:id response (join against event_rsvps using the authed user's ID)
  4. Update app/lib/rsvpStore.ts callers to use the real API once endpoints are live

Notes

  • Caller signatures in rsvpStore.ts are already designed to match the future API — function names and Promise return types should not need to change
  • Gate all writes on a valid JWT; unauthenticated requests → 401

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions