mirror of
https://github.com/btouchard/ackify-ce.git
synced 2026-02-09 07:18:36 -06:00
Major refactoring to modernize the application architecture: Backend changes: - Restructure API with v1 versioning and modular handlers - Add comprehensive OpenAPI specification - Implement RESTful endpoints for documents, signatures, admin - Add checksum verification system for document integrity - Add server-side runtime injection of ACKIFY_BASE_URL and meta tags - Generate dynamic Open Graph/Twitter Card meta tags for unfurling - Remove legacy HTML template handlers - Isolate backend source on dedicated folder - Improve tests suite Frontend changes: - Migrate from Go templates to Vue.js 3 SPA with TypeScript - Add Tailwind CSS with shadcn/vue components - Implement i18n support (fr, en, es, de, it) - Add admin dashboard for document and signer management - Add signature tracking with file checksum verification - Add embed page with sign button linking to main app - Implement dark mode and accessibility features - Auto load file to compute checksum Infrastructure: - Update Dockerfile for SPA build process - Simplify deployment with embedded frontend assets - Add migration for checksum_verifications table This enables better UX, proper link previews on social platforms, and provides a foundation for future enhancements.
36 lines
1.0 KiB
PL/PgSQL
36 lines
1.0 KiB
PL/PgSQL
-- Create signatures table for Community Edition
|
|
CREATE TABLE signatures (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
doc_id TEXT NOT NULL,
|
|
user_sub TEXT NOT NULL,
|
|
user_email TEXT NOT NULL,
|
|
user_name TEXT,
|
|
signed_at TIMESTAMPTZ NOT NULL,
|
|
payload_hash TEXT NOT NULL,
|
|
signature TEXT NOT NULL,
|
|
nonce TEXT NOT NULL,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
referer TEXT,
|
|
prev_hash TEXT,
|
|
UNIQUE (doc_id, user_sub)
|
|
);
|
|
|
|
-- Create indexes for efficient queries
|
|
CREATE INDEX idx_signatures_user ON signatures(user_sub);
|
|
CREATE INDEX idx_signatures_doc_id ON signatures(doc_id);
|
|
|
|
-- Create trigger to prevent modification of created_at
|
|
CREATE OR REPLACE FUNCTION prevent_created_at_update()
|
|
RETURNS TRIGGER AS $$
|
|
BEGIN
|
|
IF OLD.created_at IS DISTINCT FROM NEW.created_at THEN
|
|
RAISE EXCEPTION 'Cannot modify created_at timestamp';
|
|
END IF;
|
|
RETURN NEW;
|
|
END;
|
|
$$ LANGUAGE plpgsql;
|
|
|
|
CREATE TRIGGER trigger_prevent_created_at_update
|
|
BEFORE UPDATE ON signatures
|
|
FOR EACH ROW
|
|
EXECUTE FUNCTION prevent_created_at_update(); |