Skip to content

Add backend: Sign-In with Ethereum, ciphertext messages API on Neon, OpenAPI and Swagger UI - #3

Merged
A-RYAN-1 merged 1 commit into
mainfrom
feat/siwe-messages-api
Oct 23, 2026
Merged

A-RYAN-1 merged 1 commit into
mainfrom
feat/siwe-messages-api

Conversation

@A-RYAN-1

Copy link
Copy Markdown
Owner

Summary

  • Sign-In with Ethereum (EIP-4361): single-use nonces (5 minutes), message domain and chain checked, session in an httpOnly SameSite=Lax cookie.
  • Messages API on Neon Postgres: stores base64 ciphertext only (max 4096 characters), 30 messages per minute per address, epoch computed on the server from the anchor genesis.
  • OpenAPI 3 at /api/openapi.json, Swagger UI at /api/docs, /api/health, request ids and JSON logs without message content.
  • Static export removed so pages/api runs as Vercel Functions; Next.js 16.4.0 to 16.4.3.
  • Not in this PR: the chat UI does not use the API yet, and there is no on-chain friendship check.

Test plan

  • npm run test:api: 18 pass on the in-memory store, 17 pass on the real Neon database (1 skipped by design)
  • npm test: 49 contract tests pass; npm run lint; npm run build
  • Manual end-to-end run against next dev on Neon: nonce, verify, session, post, read, docs, logout
  • After merge: same flow on the live site

…OpenAPI and Swagger UI

Pages stay prerendered; pages/api becomes Vercel Functions (static export removed).
Single-use 5-minute nonces, httpOnly session cookie, base64-only ciphertext, per-address
rate limit, request ids in logs. 18 API tests on a memory store, 17 on Neon. Next.js 16.4.3.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
node-connect Ready Ready Preview Oct 23, 2026 2:04pm UTC

@A-RYAN-1
A-RYAN-1 merged commit ce20971 into main Oct 23, 2026
4 checks passed
@A-RYAN-1
A-RYAN-1 deleted the feat/siwe-messages-api branch October 23, 2026 14:19

This branch was successfully deployed

1 active deployment
Preview — 56b2f98a Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant