Architecture Visualization

Testimonial Platform

End-to-end view of the current app: browser frontend, HTTP API, domain modules, infrastructure adapters, database, background jobs, provider boundaries, and admin operations.

System Diagram

Users and Operators Public User Register, verify, claim, submit Admin / Reviewer Tasks, reviews, risk, payouts Frontend Layer frontend/web index.html, styles.css, app.js Session UI, dashboard, admin console, CSV/export links HTTP Boundary src/server.js Routes, CSRF, cookies, validation Security headers, uploads, exports API Routes /api/auth, /api/me /api/admin, /api/webhooks Application Composition src/app.js Wires store, providers, services, risk analyzer, notifications Domain / Business Modules Identity Auth, sessions, OTP Tasks Capacity, expiry Submissions Proof, status Review Approve/reject Wallet Ledger, payouts Risk + Notes Flags, evidence Infrastructure Adapters Store Contract MemoryStore / PostgresStore Proof Storage Local files / Cloudflare R2 Phone Verify Dev OTP / TextBee SMS Payout Provider Manual now / adapter later Notify Dev provider now Persistence and Operations Neon PostgreSQL Users, tasks, submissions, ledger, audit Migrations schema_migrations + migrations/*.sql Jobs Runner Expire assignments, clean sessions Production Checks Env validation, health, deployment profile

Layer Responsibilities

Frontend

frontend/web

  • Login/register UI
  • User dashboard
  • Admin queues, pagination, CSV exports, notes

HTTP API

src/server.js

  • Routes, sessions, CSRF, validation
  • Proof upload/download
  • Webhook placeholders

Domain Modules

src/modules

  • Identity, tasks, submissions, review
  • Wallet ledger and payouts
  • Risk, audit, admin notes

Infrastructure

src/infrastructure

  • Postgres/memory store
  • R2/local proof storage
  • TextBee/dev OTP, notifications, jobs

Database

docs/db-schema.sql

  • Neon PostgreSQL
  • Versioned migration baseline
  • Audit-first operational records

Production Boundaries

docs/deployment-profile.md

  • Web process
  • Jobs process
  • Provider adapters and env validation