Survey Management Workflow
This document outlines the process for adding and updating surveys using the provided automation script.
Adding a New Survey
To add a new survey, use the add-survey.js script from the decision-pulse-survey-app directory. This script will automatically:
- Generate a unique ID for the new survey.
- Add the survey definition to
src/survey-definitions.json. - Commit the changes to the current branch.
- Push the changes to the remote repository, triggering a new deployment.
Usage
From the decision-pulse-survey-app directory, run the following command:
node add-survey.js "<title>" "<description>" '<questions_json>' "<optional_fields_text>"
Arguments
<title>: The title of the survey.<description>: A brief description of the survey.<questions_json>: A JSON string representing the survey questions. This must be a valid JSON array.<optional_fields_text>: The text to display in the optional fields section.
Example
node add-survey.js "Q1 2026 Team Morale Survey" "A quick check-in on team morale for the first quarter." '[{"id":"q1","label":"How are you feeling about your work-life balance?","left":"Struggling","right":"Thriving"}]' "Your feedback is anonymous and helps us improve."