Build Formspree

YESreplaces $15/mosaves $180/yrback to the verdict

0%0 of 21 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

A form backend for static sites: point any plain HTML form at your endpoint and get the submission stored, emailed to you and optionally posted to a webhook, with a honeypot, rate limits and an origin allowlist so strangers cannot post to it. Static site stays static; you run one small server.

estimated effort one sittingthe files for this build are in the project pack

RuntimeNode 22, node:http and node:sqliteEmailSMTP via nodemailer, fire-and-forgetHostingA VPS behind Caddy

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree

    Why Everything in this build runs on it: the server, the scripts, the tests.

    Get it Download the LTS installer from nodejs.org, or install with your package manager (brew install node, or nvm install 22). Restart the terminal afterwards. open ↗

    Verify node --version prints v22 or higher

  2. installfree

    Why Every step below is a command you type or a file you edit.

    Get it VS Code (code.visualstudio.com), Cursor or Zed. Open a folder for the project and use the editor's built-in terminal. open ↗

    Verify You can open a folder and run a command in its terminal

  3. installfree

    Why History for your code, and the way most hosts deploy.

    Get it Install from git-scm.com or with your package manager, then run git init in the project folder once it exists. open ↗

    Verify git --version prints a version

  4. have readyfree

    Why Phase 2 refuses any origin not in the allowlist.

    Get it List each site's https origin exactly.

  5. API keyfree tiers exist

    Why Phase 3 emails each submission.

    Get it Fastmail, Postmark, Resend SMTP or your mail host: host, port, user, app password.

  6. have readyfree

    Why The other notification path.

    Get it webhook.site while testing. open ↗

  7. about $5 a month

    Why This needs one process running all the time with a public address.

    Get it Hetzner Cloud (from about 4 EUR), DigitalOcean or Fly.io. Ubuntu 24.04, the smallest size. You need SSH access and a public IP. Only needed for the deploy phase; develop locally first. open ↗

  8. roughly $10 a year, or free on an existing domain

    Why A public address you own, so links you share never break when a provider changes.

    Get it Register at Cloudflare Registrar, Porkbun or Namecheap, or use a subdomain of one you already own. You add one DNS record in the deploy phase. open ↗

  9. installfree

    Why Automatic HTTPS in front of the Node process. Without TLS the browser features this relies on (and your visitors' trust) do not work.

    Get it On the VPS: follow the install steps at caddyserver.com/docs/install for Ubuntu. One Caddyfile with your domain and a reverse_proxy line is the whole config. open ↗

    Verify caddy version prints a version on the server

Data model

Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.

- forms: id, slug (unique, short), name, redirect_url, notify_email, webhook_url, created_at
- submissions: id, form_id, received_at, fields (JSON), ip_hash, user_agent_class, spam (bool)
- One row per submission with the fields as JSON, because every form has different fields and you do not control the markup that posts to you.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
PORTrequired3000Any free port.
DATABASE_PATHrequired./data/forms.dbSQLite file.
UPLOAD_DIRrequired./data/uploadsUploaded files per form.
ALLOWED_ORIGINSrequiredhttps://yoursite.comComma-separated origins permitted to post.
SMTP_URLsecretrequiredsmtps://user:pass@smtp.fastmail.com:465From your SMTP provider.
NOTIFY_TOrequiredyou@yourdomain.comWhere submissions are emailed.
SITE_URLrequiredhttps://forms.yourdomain.comPublic base URL.
ADMIN_USERrequiredadminAny username for the basic-auth admin pages.
ADMIN_PASSsecretrequiredchange-me-to-a-long-random-stringGenerate one: openssl rand -base64 24. Never reuse a real password.

The build, in order

  1. Accept a post

    A plain HTML form on another site submits and lands on a thank-you.

    1. forms (id, slug, name, redirect_url, notify_email, webhook_url), submissions (id, form_id, received_at, fields JSON, ip_hash, user_agent_class, spam). Fields as JSON because you do not control the markup that posts to you.

      terminal
      mkdir formback && cd formback && git init && npm init -y && npm pkg set type=module
      mkdir -p data/uploads && cp .env.example .env
    done when · tick each as it passes
  2. Spam controls

    Honeypot, rate limit, origin allowlist, bot filter, all flagging rather than deleting.

    done when · tick each as it passes
  3. Notifications

    Email and webhook that never make the visitor wait.

    1. terminal
      npm install nodemailer@6
    done when · tick each as it passes
  4. File uploads

    Safe uploads with a generated name and a streaming cap.

    1. terminal
      npm install busboy@1 sharp@0.35.3
    done when · tick each as it passes
  5. Admin

    Forms, the snippet, submissions with spam separate, CSV.

    done when · tick each as it passes
  6. Deploy

    HTTPS, backups covering uploads, README.

    1. Files deploy/formback.serviceCaddyfile

    2. Files README.md

    done when · tick each as it passes
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more forms.