Overview
A backend for SurveyJS surveys in your own application.
dimah-survey is the backend for SurveyJS surveys. It stores each survey, publishes it, and collects responses over HTTP. SurveyJS draws the form. Your application keeps authentication, the database, and the UI.
It is a Better Auth–like backend: create an instance, pass your database, and mount the handler.
Mount two handlers on one store. They do not share routes.
| Audience | Caller | Access |
|---|---|---|
| Fill | Respondents | Read a published survey and work on their own response |
| Editor | Your application | Edit the draft, publish, change settings, and read results |
What the server does
- Saves the editor draft, and publishes only when you ask
- Stores progress while someone is answering, then checks the submission
- Applies collection rules: who may answer again, when the survey is open, and how many submissions it accepts
- Runs on Next.js, Hono, Express, Fastify, Elysia, SvelteKit, and Node
From draft to submission
- DraftEdit in Creator
- PublishRespondents can open it
- AnswerSurveyJS renders the form
- SubmitThe server checks the answers
A response keeps the published survey it started with. A later edit or publish does not change that copy, and submit is checked against it. See Draft and publish and Responses.
Start here
Quickstart
Add the tables, mount the API, and render a survey.
Database
Add the tables to Drizzle, Prisma, or Kysely.
Mount the server
Create fill and editor handlers in your runtime.
Comparison
What this server adds beside SurveyJS alone.
Machine-readable entry points are available at llms.txt and
llms-full.txt. Every docs URL also has a Markdown twin by
adding .md.