Skip to content

4D2H/ttdttd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Signature Workspace (ttdttd)

A synchronous, invite-based digital signature workspace. Workspace owners can upload PDFs, assign signature placeholders to invited members, and automatically merge signatures into a flattened PDF once all parties approve.

Architecture

┌─────────────┐     ┌─────────────┐     ┌──────────┐
│  Frontend   │────▶│   Backend   │────▶│ PostgreSQL│
│  React+Vite │◀────│  Go + Gin   │◀────│           │
└─────────────┘     └──────┬──────┘     └──────────┘
                           │
                      ┌────▼────┐
                      │ AWS S3  │
                      │ (files) │
                      └─────────┘

Tech Stack

  • Frontend: React 19, TypeScript, Vite, react-pdf, Zustand
  • Backend: Go 1.26, Gin, sqlx, pdfcpu
  • Database: PostgreSQL 16
  • Storage: AWS S3
  • Testing: Ginkgo BDD

Quick Start

Prerequisites

  • Go 1.26+
  • Node.js 20+
  • PostgreSQL 16
  • AWS S3 bucket (or use LocalStack for local dev)

Backend

cd backend
cp .env.example .env
# Edit .env with your database and S3 credentials

# Run migrations (auto-run on startup)
go mod tidy
go run main.go

Server starts on :8080.

Frontend

cd frontend
npm install
npm run dev

App starts on http://localhost:3000 with API proxy to :8080.

Docker Compose

docker-compose up

Starts PostgreSQL, backend, and frontend.

API Reference

Auth & Users

Method Endpoint Description
POST /auth/login SSO login, returns JWT
GET /users/me Get user profile
PUT /users/me/signature Upload signature PNG

Workspaces

Method Endpoint Description
POST /workspaces Create workspace
GET /workspaces List user's workspaces
GET /workspaces/:id Get workspace details
POST /workspaces/:id/invites Generate invite token

Invites

Method Endpoint Description
POST /invites/:token/accept Accept invite (requires signature)

Documents

Method Endpoint Description
POST /workspaces/:id/documents Upload PDF
GET /workspaces/:id/documents/:docId Get document + placeholders
POST /workspaces/:id/documents/:docId/placeholders Create signature box
DELETE /workspaces/:id/documents/:docId/placeholders/:phId Remove placeholder
POST /workspaces/:id/documents/:docId/sign Approve & sign
POST /workspaces/:id/documents/:docId/complete Finalize document

Workflow

  1. Owner creates a workspace and invites signers
  2. Signers accept invites (must upload signature first)
  3. Owner uploads a PDF and places signature boxes on it
  4. Signers review the document and click "Approve & Sign"
  5. Owner clicks "Complete Document" when all have signed
  6. System merges all signatures into a flattened PDF

Constraints

  • No async queues — all operations are synchronous
  • No OCR — manual placeholder placement only
  • Every user must upload a signature before interacting with documents
  • Metadata in PostgreSQL, binaries in S3
  • Standard JSON error format: {"error": "message", "code": 400}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors