Skip to content

Real-time collaboration — multiple observers per incident #12

Description

@bgorzelic

Description

On large incidents, multiple division supervisors and lookouts observe fire behavior simultaneously. Firevector should support real-time collaboration where multiple observers can contribute to an incident's observation set.

Proposed Architecture

Data Model Changes

  • Add incidents table: { id, name, created_by, status, created_at }
  • Add incident_members table: { incident_id, user_id, role } (roles: owner, observer, viewer)
  • Observations get an optional incident_id FK — shared observations belong to an incident

Real-Time Updates

  • Use Vercel's @vercel/postgres with LISTEN/NOTIFY or Supabase Realtime
  • Alternative: Server-Sent Events (SSE) from Next.js API route
  • Dashboard auto-updates when other observers add/edit observations

Invitation Flow

  • Incident owner generates invite link or sends email invitation
  • Invitee joins via link → added as observer
  • Role-based permissions (owner can delete, observer can create/edit own, viewer read-only)

Acceptance Criteria

  • Create incident and invite observers
  • Multiple users can create observations under one incident
  • Dashboard shows all incident observations (not just your own)
  • Real-time updates when other observers add data
  • Role-based access control (owner/observer/viewer)
  • Incident-scoped map view with all observers' pins
  • Works alongside individual (non-incident) observations

ADR Needed

This is a significant architectural change. Needs a design document covering:

  • Data model changes and migration strategy
  • Real-time technology selection
  • Authorization model
  • Impact on existing single-user features

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: lowLow priority — nice to havearea: webNext.js web app (apps/web)needs designNeeds UX/UI design before implementationneeds discussionNeeds team discussion or ADRsize: XLExtra large — 1+ weeks, consider breaking downtype: featureNew feature or capability

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions