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
- AuthorCreator writes draftJson
- PublishPromote publishedJson
- StartFreeze response.definition
- FillSurveyJS renders the snapshot
- 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
| Owner | Responsibilities |
|---|---|
| SurveyJS | Survey schema, Model, <Survey>, Creator, and question behavior |
| Your application | Authentication, authorization, migrations, file storage, and UI |
| dimah-survey | Publish, collection policy, response snapshots, drafts, and submit validation |
The backend exposes two isolated audiences over one shared SurveyStore:
| Audience | Intended caller | Capabilities |
|---|---|---|
| Fill | Respondents | Read published JSON; start, save, submit, abandon, and reopen responses |
| Editor | Trusted application code | Edit 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
Quickstart
Build the smallest working Next.js integration.
Response lifecycle
Follow snapshot, partial save, submit, and reopen.
Server integration
Mount fill and editor handlers in your runtime.
Is it the right fit?
Compare ownership with SurveyJS alone and hosted products.
Machine-readable entry points are available at llms.txt and
llms-full.txt. Every docs URL also has a Markdown twin by
adding .md.