bởi codecrumbs

OpenSign is a secure, open-source alternative to DocuSign for PDF e-signing, multi-signer workflows, audit trails, and API integrations. Built for teams and developers who need full control over their document signing infrastructure.
This block is the full Node.js/Express backend for OpenSign, an open-source document e-signing platform. It exposes a Parse Server API, cloud functions, custom Express routes, PDF processing, email delivery, and file storage (S3 or local). The typical buyer is a team self-hosting a document signing workflow who needs to own the entire backend stack.
.github/ - CI workflow definitions for automated testingauth/ - SSO authentication adapter (SSOAuth) for Parse Servercloud/ - All Parse Cloud Functions and custom Express routescloud/customRoute/ - Express sub-app for PDF decryption, docx conversion, account deletioncloud/parsefunction/ - Individual cloud function modules (documents, templates, contacts, signers, etc.)databases/ - Database utility helpersfiles/ - Local file storage directory (used by FSFilesAdapter)font/ - Font assets used in PDF generation and certificate renderingmigrationdb/ - DB migration runners (contact and document indexes)public/ - Static assets served by Expressutils/ - Shared utility helpers (e.g. fileUtils.js)Utils.js - Exported constants, color palette, mail variable helpers, and file utilitiesindex.js - Application entry point; wires Parse Server, Express, adapters, and migrationsapp.json / app.yaml / scalingo.json / openshift.json - Platform deployment manifestscloud/main.js - Registers all Parse Cloud Functions and triggersnpm install dotenv express cors parse-server parse-server-api-mail-adapter \
@parse/s3-files-adapter @parse/fs-files-adapter mailgun.js form-data \
nodemailer pdf-lib date-fns-tz
No native build steps, iOS pod install, or Android linking are required. This is a pure Node.js server. Minimum Node.js version: 18 (ESM support required; the package uses import/export throughout).
Copy the source tree. Place the contents of source/ into your project root or a dedicated subdirectory (e.g. ). Preserve the directory structure exactly; internal imports use relative paths.
Khởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Tetrees AI Review cho phiên bản này
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
Quy trình avcp-2026-08-04.1 · SHA-256 21bfde128b5ad815…
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.
Đã đánh giá 4 thg 8, 2026
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
Chưa có đánh giá.
Sign in to join the discussion
Loading discussion…
server/Enable ESM. Ensure your package.json contains:
{
"type": "module"
}
If using TypeScript, set "module": "ESNext" and "moduleResolution": "bundler" in tsconfig.json.
Configure environment variables. Create a .env file at the root of source/:
APP_ID=opensign
MASTER_KEY=your_master_key
DATABASE_URI=mongodb://localhost:27017/opensign
SERVER_URL=http://localhost:8080/app
DO_ENDPOINT=https://blr1.digitaloceanspaces.com
DO_SPACE=your-bucket-name
DO_BASEURL=https://your-cdn-url
DO_REGION=blr1
DO_ACCESS_KEY_ID=your_access_key
DO_SECRET_ACCESS_KEY=your_secret_key
USE_LOCAL=true # set to 'false' to use S3
SMTP_ENABLE=true
SMTP_SECURE=false
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=user@example.com
SMTP_PASSWORD=password
Start the server. Run node index.js from source/. The server listens on port 8080 by default and mounts Parse Server at /app.
Run DB migrations. Migrations execute automatically on startup via runDbMigrations() called inside index.js. No separate CLI step is needed.
cloudServerUrlexport const cloudServerUrl: string; // "http://localhost:8080/app"
The Parse Server mount URL used internally by cloud functions and adapters. Override via SERVER_URL env var logic if you change the port or path.
serverAppIdexport const serverAppId: string; // defaults to "opensign"
The Parse application ID read from process.env.APP_ID. Pass this as the applicationId when initialising a Parse JS SDK client that talks to this server.
replaceMailVariblesexport function replaceMailVaribles(
subject: string,
body: string,
variables: Record<string, string>
): { subject: string; body: string };
Replaces {{variable}} placeholders in email subject and body strings. Use it when building custom email notifications before handing them to a transporter.
runDbMigrationsexport default async function runDbMigrations(): Promise<void>;
Runs all pending database migrations (creates indexes on the Contacts and Documents collections). Called once at boot; safe to re-run idempotently.
SSOAuthexport const SSOAuth: object; // Parse Server auth adapter
Drop-in Parse Server auth adapter for SSO. Pass it in the auth config object when instantiating ParseServer.
validateSignedLocalUrlexport function validateSignedLocalUrl(req: Request, res: Response, next: NextFunction): void;
Express middleware that validates signed local file URLs. Mounted by index.js before serving the files/ directory.
Demonstrates importing core constants and booting the server programmatically in a wrapper script.
import dotenv from 'dotenv';
dotenv.config();
import { ParseServer } from 'parse-server';
import { serverAppId, cloudServerUrl, appName } from './source/Utils.js';
import { SSOAuth } from './source/auth/authadapter.js';
const server = new ParseServer({
appId: serverAppId,
appName: appName,
masterKey: process.env.MASTER_KEY!,
serverURL: cloudServerUrl,
databaseURI: process.env.DATABASE_URI!,
cloud: './source/cloud/main.js',
auth: { sso: SSOAuth },
});
await server.start();
console.log(`Parse Server running at ${cloudServerUrl}`);
Shows how to use replaceMailVaribles to hydrate a stored email template before dispatch.
import { replaceMailVaribles } from './source/Utils.js';
const template = {
subject: 'Please sign: {{documentName}}',
body: 'Hi {{signerName}}, your document "{{documentName}}" is ready to sign.',
};
const vars = { documentName: 'Service Agreement', signerName: 'Alice' };
const { subject, body } = replaceMailVaribles(template.subject, template.body, vars);
console.log(subject); // "Please sign: Service Agreement"
console.log(body); // "Hi Alice, your document "Service Agreement" is ready to sign."
Useful when you orchestrate the server yourself and want migrations to complete before any request hits the API.
import runDbMigrations from './source/migrationdb/index.js';
async function boot() {
console.log('Running database migrations...');
await runDbMigrations();
console.log('Migrations complete. Starting HTTP server...');
// start your Express app here
}
boot().catch((err) => {
console.error('Boot failed:', err);
process.exit(1);
});
index.js - Entry point. Creates the Parse Server instance, wires S3 or local file adapter, configures nodemailer/Mailgun transporter, mounts custom Express routes, and starts the HTTP server.Utils.js - Shared constants (cloudServerUrl, serverAppId, appName, color palette), the replaceMailVaribles helper, file-usage tracking, and signed-URL utilities.cloud/main.js - Imports and registers every Parse Cloud Function and trigger (AfterSave, BeforeSave, AfterFind hooks). This is the cloud entry point passed to ParseServer.cloud/customRoute/customApp.js - A standalone Express app instance that handles routes not served by Parse (PDF decrypt, docx-to-PDF, account deletion).cloud/parsefunction/ - One module per cloud function: document lifecycle, contact management, signing, template operations, user management, reporting, etc.auth/authadapter.js - Exports SSOAuth, the Parse Server-compatible SSO authentication adapter.migrationdb/index.js - Orchestrates idempotent MongoDB index creation migrations on boot.utils/fileUtils.js - Low-level file parsing helpers used by Utils.js.font/ - Font files consumed by PDF generation functions in cloud/parsefunction/pdf/.databases/ - Database-level helpers consumed by cloud functions.public/ - Static files (HTML, assets) served directly by Express."type": "module" must be in package.json. Using require() anywhere will throw ERR_REQUIRE_ESM. Fix: convert all local wrappers to import.APP_ID defaults silently: If APP_ID is missing from .env, it falls back to "opensign". A second Parse Server instance with the same app ID and different master key will cause auth failures. Fix: always set APP_ID explicitly.index.js catches the error and switches to FSFilesAdapter. Files then accumulate on disk unnoticed. Fix: validate all DO_* env vars at startup.USE_LOCAL is a string, not a boolean: The guard is useLocal !== 'true'. Passing USE_LOCAL=false (as a boolean) will evaluate as truthy for S3 but the string 'false' will also enable S3 since 'false' !== 'true'. Fix: always set USE_LOCAL=true or omit the variable.dotenv quiet option: The code calls dotenv.config({ quiet: true }). If your .env file is missing entirely, no error is raised, and all env vars will be undefined. Fix: add a startup validation step that asserts required keys.parse-server has breaking changes across minor versions affecting cloud function signatures and adapter interfaces. Fix: pin the exact version from the upstream package.json rather than using a range.I have purchased the "opensign" AVCP block. The source is in ./source/ and
the integration guide is in USAGE.md (read it first).
The upstream npm package is user@example.com (backend only, Node.js/Express +
Parse Server). My project is a Node.js/TypeScript REST API and I need to
integrate the OpenSign backend into it.
Please do the following step by step:
1. Read USAGE.md fully before writing any code.
2. Install all required dependencies listed in USAGE.md into my project.
3. Copy or import from source/ the minimum files needed to spin up the
Parse Server with cloud functions (index.js, cloud/main.js, Utils.js,
auth/authadapter.js, migrationdb/index.js).
4. Wire the .env variables from USAGE.md into my existing environment
configuration (dotenv or config package).
5. Add a startup sequence that runs runDbMigrations() before the HTTP
server accepts connections.
6. Mount the custom Express routes from source/cloud/customRoute/customApp.js
onto my existing Express app at the /opensign prefix.
7. Show me how to call replaceMailVaribles() from source/Utils.js in my
existing email-sending module.
8. Do not invent any new exports; only use symbols documented in USAGE.md.
OpenSign is released under the AGPL-3.0 license (see source/LICENSE if present, or the upstream repository). Source: OpenSignLabs/OpenSign on GitHub. Upstream npm package: user@example.com.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
CRM, ERP, Admin & Internal Tools
Miễn phí