vidscrip-forms

Vidscrip Forms

HIPAA-compliant healthcare intake and assessment forms for multiple practices.

This repo contains:

Architecture

High-level flow

  1. A user opens a form and answers questions.
  2. The frontend posts events or final payloads to the Google Apps Script web app endpoint.
  3. Backend routes by formType and eventType.
  4. Data is written to a branded Google Sheet tab.
  5. Intercom events/tags are sent (when responseId exists).
  6. Survey API receives completed/final payloads (when configured).

Backend model

Form modes

Current forms

Repository layout

Setup

1) Google Apps Script

  1. Create or open your Apps Script project bound to the destination spreadsheet.
  2. Copy in unified-google-apps-script.js and all files from formConfigs/.
  3. Deploy as a Web App (Execute as: Me, Who has access: Anyone or your required access policy).
  4. Use the Web App URL as your frontend submit endpoint.

2) Script Properties (required)

Add in Apps Script Project Settings -> Script Properties:

Optional (for Survey API writes):

3) Frontend endpoint wiring

Set each form’s GOOGLE_APPS_SCRIPT_URL (or fetch target URL) to your deployed web app endpoint.

4) Local development

Run a static server from repo root:

python3 -m http.server 8080

Open forms:

In Codespaces, use the forwarded URL instead of localhost.

Testing

Apps Script tests

Use functions in formConfigs/tests.gs:

Manual verification checklist

Security notes

See SECURITY_SETUP.md for details.

Contributing

When adding a new form:

  1. Add a config object in formConfigs/<newForm>.gs.
  2. Register it in formConfigs/loadConfigs.gs.
  3. Add tests in formConfigs/tests.gs.
  4. Ensure frontend payload shape matches backend expectations.
  5. Update this README and any form-specific setup docs.