Skip to content

feat: deadline banners (#734), analytics (#718), tx metrics (#720), dual-auth ADR (#713)#859

Merged
Ogstevyn merged 1 commit into
Ogstevyn:mainfrom
Salmatcre8:feat/banners-analytics-metrics-adr
Jun 2, 2026
Merged

feat: deadline banners (#734), analytics (#718), tx metrics (#720), dual-auth ADR (#713)#859
Ogstevyn merged 1 commit into
Ogstevyn:mainfrom
Salmatcre8:feat/banners-analytics-metrics-adr

Conversation

@Salmatcre8

Copy link
Copy Markdown
Contributor

Summary

Four monitoring / UX / docs items, all in this repo:

Closes #734
Closes #718
Closes #720
Closes #713

#734 — Landlord deadline reminder banner

  • New: components/dashboard/DeadlineBanners.tsx — on dashboard load, shows a dismissible amber banner for each active escrow whose deadline is within 72 hours. Dismissals persist in localStorage.
  • New: components/dashboard/deadline-utils.ts — JSX-free selection/format helpers (so the logic is unit-testable under node --test).
  • Modified: app/dashboard/page.tsx — renders <DeadlineBanners escrows={escrows} /> above the portfolio summary.
  • Acceptance: a deadline 48h away produces a warning banner (covered by a test).

#718 — Privacy-first page analytics

  • New: components/ui/analytics.tsx — loads Plausible (cookieless, GDPR-compliant) via next/script, only when NEXT_PUBLIC_PLAUSIBLE_DOMAIN is set and Do Not Track / GPC is off. Exposes trackEvent() for the key events (escrow-creation start, wallet connect, contribution complete); Plausible auto-records page views.
  • Modified: app/layout.tsx — mounts <Analytics />.
  • No new dependency (script-tag integration). Respects DNT by default.

#720 — Transaction failure-rate metrics

  • New: lib/metrics.ts — in-process counters with recordTransaction() + getMetrics() returning { total_transactions, failed_transactions, failure_rate_percent } (plus a per-type breakdown).
  • New: app/api/metrics/route.tsGET /api/metrics.
  • Modified: lib/stellar/actions/contribute.ts — wraps submit/confirm to record success/failure.

#713 — ADR for the dual authentication system

  • New: docs/adr/002-dual-auth.md — documents why email-JWT and Stellar-wallet auth must coexist (account identity vs. on-chain financial identity, custody boundary, onboarding), plus a migration path if either is removed. Follows the format of the existing 001-file-storage.md.

Verified terminal output

$ node --test ... lib/metrics.test.ts components/dashboard/deadline-utils.test.ts
ℹ tests 12
ℹ pass 12
ℹ fail 0

tsc --noEmit: no new errors in changed files (repo has 21 pre-existing baseline errors unrelated to this PR).

Acceptance criteria

Note: #720's metrics are in-process (reset on restart, per-instance) — sufficient for current visibility; the store can be swapped for Redis/DB without changing the API. Analytics requires NEXT_PUBLIC_PLAUSIBLE_DOMAIN to be set in the deployment to emit events.

@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

@Salmatcre8 is attempting to deploy a commit to the Stephen's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 2, 2026

Copy link
Copy Markdown

@Salmatcre8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ogstevyn Ogstevyn merged commit f893bce into Ogstevyn:main Jun 2, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants