learn

Connections

Requests, accepts, lists, and removal.

One row per pair, unique on the ordered pair, with a pending, accepted, or rejected state. Sending notifies the recipient; accepting notifies the requester; rejecting only flips the state. Lists return the other user, populated for display. Accepted connections are the main gate for chat.

What it owns

  • Sending requests with self and duplicate guards
  • Accepting and rejecting incoming requests
  • Incoming, sent, and accepted lists
  • Removing connections

Files

File list and purposes from the folder README.

FilePurpose
frontend/src/pages/RequestsPage.jsxIncoming and sent request screens.
frontend/src/pages/ConnectionsPage.jsxAccepted connections screen.
frontend/src/services/connectionService.jsRequest lifecycle calls.
backend/routes/connectionRoutes.jsRequest, accept, reject, list, remove routes.
backend/controllers/connectionController.jsPair guards and list shaping.
backend/models/Connection.jsPair rows with a unique index.
Connections slice
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral

Talks to

Sources: frontend/src/services/connectionService.js, backend/routes/connectionRoutes.js, backend/controllers/connectionController.js, backend/models/Connection.js (documented at commit cdef8af)

On this page