by Tane H.

Documenso is a self-hostable, open-source alternative to DocuSign for legally binding digital document signatures. Built for teams and enterprises needing full control over their signing infrastructure.
Documenso is a self-hostable, open-source document signing platform built on React Router 7 (Remix), Hono, Prisma, and TypeScript. This block provides the complete monorepo source including the authentication server, API layer, client SDK, and the full-stack web application. Typical buyers are teams replacing DocuSign/HelloSign who need full data ownership, or developers embedding e-signature flows into their own SaaS products.
apps/ - Deployable applications; apps/remix/ is the main web frontend/backendpackages/ - Shared packages: auth, api, prisma schema, lib utilities, UI componentsdocker/ - Dockerfile and Compose files for containerized deploymentscripts/ - Database migration helpers and CI utility scripts.github/ - CI/CD workflows (GitHub Actions), issue/PR templates.devcontainer/ - VSCode Dev Container config for zero-friction local setup.agents/ - AI agent plans, skill definitions, and scratch notes (project-internal).vscode/ - Editor settings and recommended extensionsturbo.json - Turborepo pipeline configurationlingui.config.ts - i18n configuration via LinguiJSpackage.json - Workspace root; defines monorepo with all packagesnpm install @hono/node-server hono hono-react-router-adapter superjson
npm install @prisma/client @prisma/extension-read-replicas
npm install zod typescript react
npm install @ai-sdk/google-vertex ai
npm install @lingui/core @lingui/conf
npm install luxon cron-parser posthog-node
npm install @marsidev/react-turnstile
npm install @libpdf/core
After installing, generate the Prisma client from the schema in packages/prisma:
npx prisma generate --schema=source/packages/prisma/schema.prisma
npx prisma migrate deploy --schema=source/packages/prisma/schema.prisma
No native iOS/Android linking is required. @libpdf/core ships a WebAssembly binary — ensure your bundler is configured to handle .wasm assets.
Copy the source into your project root or a subdirectory, e.g. .
Spin up an isolated sandbox and run it server-side — no local setup.
Tetrees AI Review of this version
This Express backend / api completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Pipeline avcp-2026-08-04.1 · SHA-256 87ad08ff90a6ac81…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Reviewed Aug 4, 2026
Push this product straight into your AI IDE, web builder or cloud IDE.
Download your licensed source snapshot from the library, then follow the setup guide in your workspace.
No reviews yet.
Sign in to join the discussion
Loading discussion…
./documenso-source/Configure TypeScript to resolve workspace packages. In your root tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@documenso/lib/*": ["documenso-source/packages/lib/*"],
"@documenso/auth/*": ["documenso-source/packages/auth/*"],
"@documenso/prisma": ["documenso-source/packages/prisma/index.ts"]
}
}
}
NEXT_PUBLIC_WEBAPP_URL=https://yourdomain.com
DATABASE_URL=postgresql://user:pass@host:5432/documenso
DIRECT_DATABASE_URL=postgresql://user:pass@host:5432/documenso
NEXTAUTH_SECRET=your-32-char-secret
NEXTAUTH_URL=https://yourdomain.com
apps/remix:cd documenso-source/apps/remix
npm run build
node server/main.js
auth router from packages/auth/server/index.ts and mounting it at /auth.auth (Hono router)import { auth } from './documenso-source/packages/auth/server/index';
// auth: Hono<HonoAuthContext>
The fully-assembled Hono router exposing all authentication routes: CSRF token issuance (GET /csrf), session management, sign-out, OAuth callbacks, passkey, email/password, and two-factor authentication. Mount it directly into any Hono application with .route('/auth', auth).
AuthClientimport { AuthClient } from './documenso-source/packages/auth/client/index';
const client = new AuthClient({ baseUrl: 'https://yourdomain.com/auth' });
Browser-side typed client built on Hono RPC. Use it in frontend code to call sign-in, sign-out, passkey, two-factor, and session endpoints without manually constructing fetch requests. All request/response types are inferred from the server router type AuthAppType.
AuthClient.signOutawait client.signOut({ redirectPath?: string }): Promise<void>
Posts to the sign-out endpoint and redirects the browser. Supply redirectPath to override the default /signin destination. Use this wherever your frontend needs to terminate a user session.
AuthClient.signOutAllSessionsawait client.signOutAllSessions(): Promise<void>
Terminates all active sessions for the current user. Use on security-sensitive pages (password change, account compromise recovery).
A backend service wants to delegate all authentication to Documenso's auth package without running the full Remix app.
import { Hono } from 'hono';
import { serve } from '@hono/node-server';
import { auth } from './documenso-source/packages/auth/server/index';
const app = new Hono();
// Mount Documenso auth under /auth
app.route('/auth', auth);
app.get('/', (c) => c.text('My App'));
serve({ fetch: app.fetch, port: 3000 });
A React component needs to sign the current user out and redirect to a custom page.
import { AuthClient } from './documenso-source/packages/auth/client/index';
const authClient = new AuthClient({
baseUrl: typeof window !== 'undefined' ? window.location.origin + '/auth' : '',
});
async function handleSignOut() {
await authClient.signOut({ redirectPath: '/goodbye' });
// Browser is redirected; no further code runs.
}
// Usage in a React component
export function SignOutButton() {
return <button onClick={handleSignOut}>Sign Out</button>;
}
After a user updates their password, revoke every active session across devices.
import { AuthClient } from './documenso-source/packages/auth/client/index';
const authClient = new AuthClient({ baseUrl: '/auth' });
async function onPasswordChanged() {
try {
await authClient.signOutAllSessions();
window.location.href = '/signin?reason=password-changed';
} catch (err) {
console.error('Failed to revoke sessions', err);
}
}
Deploy the compiled Remix application as a standalone Node.js HTTP server using the included entry point.
// From apps/remix/server/main.js after build:
// node build/server/main.js
// The server binds to process.env.PORT (default 3000).
// Static assets in build/client/assets are served with immutable cache headers.
// All other static files use stale-while-revalidate.
import { createServer } from 'node:child_process';
const proc = createServer();
// Or simply: node documenso-source/apps/remix/build/server/main.js
apps/remix/ - The primary deployable app: React Router 7 frontend, Hono middleware, server entry at server/main.js.apps/remix/server/main.js - Node.js entry point: spins up @hono/node-server, serves static assets, and delegates all requests to the React Router build.packages/auth/ - Complete authentication package: server-side Hono router, client SDK, session utilities, OAuth, passkey, 2FA, and email/password flows.packages/auth/server/index.ts - Assembles and exports the auth Hono router with CSRF, CORS origin check, and all sub-routes chained for RPC type safety.packages/auth/client/index.ts - Browser AuthClient class wrapping the Hono RPC client with typed methods for all auth actions.packages/auth/index.ts - Public package entry; re-exports auth error codes for consumers.packages/api/index.ts - API package stub (currently empty export; routes added in packages/api/).packages/prisma/ - Prisma schema, generated client, and seed scripts for the Documenso database model.packages/lib/ - Shared utilities: app constants (NEXT_PUBLIC_WEBAPP_URL), error classes (AppError, AppErrorCode), request metadata extraction, and more.docker/ - Production Dockerfile and docker-compose.yml for containerized deployment with PostgreSQL.scripts/ - Utility scripts for database operations, migrations, and CI helpers.turbo.json - Defines Turborepo task graph (build, lint, test, typecheck) with caching rules.lingui.config.ts - LinguiJS i18n setup; points to message catalogs in packages/lib/.NEXT_PUBLIC_WEBAPP_URL not set at build time: The auth server reads this at module load via @documenso/lib/constants/app; missing it causes CORS to reject all requests. Fix: export the variable before starting the server, not just at runtime.auth router uses method chaining (.route().route()...). Splitting routes across app.route() calls outside the chain loses TypeScript types in AuthClient. Fix: keep all sub-routes chained on the single exported auth instance.packages/prisma requires npx prisma generate to produce the client. Without it, imports fail at runtime. Fix: add prisma generate as a pre-build step in CI and local dev.@libpdf/core WASM not bundled: Some bundlers (esbuild, Vite) require explicit WASM plugin configuration to include .wasm assets. Fix: add @rollup/plugin-wasm or the esbuild WASM loader to your bundler config.superjson: AuthClient imports superjson (ESM-only in v2+). If your build target is CJS, use "moduleResolution": "bundler" or "node16" in tsconfig and ensure your bundler handles dual-mode packages.apps/remix: The server defaults to PORT=3000. If another service occupies that port, the server fails silently. Fix: always set PORT explicitly in your process environment or Docker Compose file.I have the Documenso open-source document signing platform source code located in `./source/`.
I also have `USAGE.md` in the same directory which explains the architecture and exports.
The upstream package is `@documenso/root@2.9.0`.
Please help me integrate Documenso into my existing Node.js/TypeScript project step by step:
1. Read `USAGE.md` and the key source files under `source/packages/auth/` and `source/apps/remix/server/main.js`.
2. Mount the `auth` Hono router from `source/packages/auth/server/index.ts` into my existing Hono application at the `/auth` path.
3. Add the `AuthClient` from `source/packages/auth/client/index.ts` to my frontend code so users can sign in and sign out.
4. Set up the required environment variables listed in `USAGE.md`.
5. Configure TypeScript path aliases so `@documenso/lib` and `@documenso/auth` resolve correctly.
6. Generate the Prisma client from `source/packages/prisma/schema.prisma`.
7. Show me how to run the full Documenso server locally using `source/apps/remix/server/main.js`.
Use only exports and symbols documented in `USAGE.md`. Do not invent APIs.
Documenso is licensed under the GNU Affero General Public License v3.0 (AGPLv3). See source/LICENSE for the full license text. Any modifications to Documenso source code that are deployed as a network service must be made available under the same license.
Upstream repository: github.com/documenso/documenso
Upstream package: @documenso/root@2.9.0
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
The full install guide and integration prompts unlock after purchase.
eCommerce, Marketplace & POS Systems
Free