dimah-survey

Overview

Understand the server-owned lifecycle around SurveyJS JSON.

dimah-survey adds a server-owned lifecycle around SurveyJS JSON. It publishes survey definitions, creates durable response drafts, and validates each submission against the exact definition that response started with.

It does not replace SurveyJS. Your application still owns the renderer, Creator, authentication, database migrations, and UI.

The central guarantee is simple: publishing a new survey never changes an existing response.definition.

The lifecycle

One response
  1. AuthorCreator writes draftJson
  2. PublishPromote publishedJson
  3. StartFreeze response.definition
  4. FillSurveyJS renders the snapshot
  5. SubmitValidate the same snapshot

draftJson is the editable document. publishedJson is the document new responses may start. At start, the server copies publishedJson into response.definition; every save and submit stays attached to that copy.

Clear ownership

OwnerResponsibilities
SurveyJSSurvey schema, Model, <Survey>, Creator, and question behavior
Your applicationAuthentication, authorization, migrations, file storage, and UI
dimah-surveyPublish, collection policy, response snapshots, drafts, and submit validation

The backend exposes two isolated audiences over one shared SurveyStore:

AudienceIntended callerCapabilities
FillRespondentsRead published JSON; start, save, submit, abandon, and reopen responses
EditorTrusted application codeEdit and publish surveys, change settings, and read full response snapshots

The fill audience always requires a guard. The editor audience has a separate guard and route, so respondent traffic never gains authoring access.

Start here

Machine-readable entry points are available at llms.txt and llms-full.txt. Every docs URL also has a Markdown twin by adding .md.

On this page