Handover workspace

ERS, Todo, OfferReview, and Docu in one view

Imported from live server docs, code structure, and deployment notes.

Apr 3, 2026, 12:38 PM

DocuHandshake

Reza DocuHandshake

Private document-signing platform for external PDF uploads and admin-side digital signing.

README.md

Updated Apr 1, 2026, 4:33 AM

Reza DocuHandshake

Private document-signing platform for external PDF uploads and admin-side digital signing.

The current app is a React SPA in src/ backed by a Node/Express API in server/. External users authenticate with a magic link, upload a PDF, and optionally mark suggested signature areas. Reza reviews the document in /admin, signs it in the browser with pdf-lib, and the signed PDF is stored on disk and emailed back to the uploader.

The admin signature preset is shared through the backend so mobile and desktop use the same saved signature configuration.

Current Stack

  • Frontend: React 18, TypeScript, Vite, Tailwind CSS
  • Backend: Express 5, PostgreSQL (pg), JWT cookies, Multer uploads
  • PDF rendering/editing: react-pdf, pdf-lib
  • Email: Resend
  • AI: OpenAI gpt-4o-mini for document analysis
  • Optional signature helper endpoint: OpenAI gpt-image-1 with SVG fallback

Project Layout

  • Frontend app: src/
  • Backend API: server/
  • Database schema: server/sql/001_init.sql
  • Frontend API client: src/lib/api.ts
  • Admin dashboard page: src/pages/SigningDashboard.tsx
  • Local storage root: STORAGE_ROOT env var, default storage/

Local Setup

Run these commands from this prod/ directory:

npm install
cp .env.example .env
npm run db:init
npm run dev:server
npm run dev

Default local URLs:

  • Frontend SPA: http://localhost:5173
  • Backend API: http://localhost:8080
  • Backend utility page: http://localhost:8080/
  • Health check: http://localhost:8080/api/health

If you want uploads outside prod/storage, set STORAGE_ROOT explicitly in .env.

Key Runtime Paths

  • Backend entry: server/index.ts
  • Auth routes: server/routes/auth.ts
  • Document routes: server/routes/documents.ts
  • Admin routes: server/routes/admin.ts
  • Notification routes: server/routes/notifications.ts
  • Email/session/storage helpers: server/services/

Main Routes

  • / user portal
  • /auth/verify magic-link verification
  • /thank-you submission confirmation
  • /admin admin dashboard
  • /api/* backend API