HeyForm 是一个开源表单,调查问卷生成器,允许任何人通过拖拽的方式设计调查问卷,测验等。无需任何编码技能,就可以快速生成一个美观的调查问卷。

HeyForm 是一个基于 JavaScript 开发的表单工具,提供了丰富的表单元素和模板,无需代码基础,只需要简单拖拽式操作,就可以轻松创建各种类型表单,比如调查问卷,订单收集,活动报名等等。

HeyForm 基于对话式的设计理念,将表单的每个问题都作为一个对话节点,我们可以根据自己的选择进行下一步操作,从而体验更加流畅的表单。

主要功能包括:

  • 拖拽式表单设计界面,简单易用
  • 丰富的表单元素,满足各种需求
  • 支持多主题皮肤,可自定义表单样式
  • 实时预览和测试,确保表单效果
  • 数据收集和分析功能

技术栈

  • [[KeyDB]] Redis 的一个改进版本
  • [[Percona Server for MongoDB]]

Docker 安装

可以非常轻松地使用 Docker 进行安装。

当然,也可以通过在 [[Zeabur]]、[[Railway]] 等云端服务提供商实现一键部署

可以参考我的 dockerfile

mkdir -p ~/heyform/{assets,database,keydb}
# 为了防止权限问题
sudo chown -R 1001:1001 ~/heyform/database
cp env .env
# edit .env
docker-compose up -d

需要注意的是在我的配置中,将 MongoDB 的数据持久化直接到磁盘目录,在启动的时候报错。

mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.841+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.842+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.843+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"497954254aa5"}}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.843+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.29-28","gitVersion":"03fb7a382f43f467e1502fd436f52297a175ba8b","openSSLVersion":"OpenSSL 1.1.1k  FIPS 25 Mar 2021","modules":[],"allocator":"tcmalloc","environment":{"distarch":"x86_64","target_arch":"x86_64"}}}}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.843+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Oracle Linux Server release 8.9","version":"Kernel 5.15.0-122-generic"}}}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.843+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"}}}}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"E",  "c":"STORAGE",  "id":20557,   "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db"}}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"REPL",     "id":4784900, "ctx":"initandlisten","msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":10000}}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"COMMAND",  "id":4784901, "ctx":"initandlisten","msg":"Shutting down the MirrorMaestro"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"SHARDING", "id":4784902, "ctx":"initandlisten","msg":"Shutting down the WaitForMajorityService"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"NETWORK",  "id":20562,   "ctx":"initandlisten","msg":"Shutdown: going to close listening sockets"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"NETWORK",  "id":4784905, "ctx":"initandlisten","msg":"Shutting down the global connection pool"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"STORAGE",  "id":4784906, "ctx":"initandlisten","msg":"Shutting down the FlowControlTicketholder"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"-",        "id":20520,   "ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"NETWORK",  "id":4784918, "ctx":"initandlisten","msg":"Shutting down the ReplicaSetMonitor"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.844+00:00"},"s":"I",  "c":"SHARDING", "id":4784921, "ctx":"initandlisten","msg":"Shutting down the MigrationUtilExecutor"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.845+00:00"},"s":"I",  "c":"STORAGE",  "id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.845+00:00"},"s":"I",  "c":"-",        "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.845+00:00"},"s":"I",  "c":"FTDC",     "id":4784926, "ctx":"initandlisten","msg":"Shutting down full-time data capture"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.845+00:00"},"s":"I",  "c":"CONTROL",  "id":20565,   "ctx":"initandlisten","msg":"Now exiting"}
mongo-1    | {"t":{"$date":"2024-09-26T12:38:15.845+00:00"},"s":"I",  "c":"CONTROL",  "id":23138,   "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":100}}

需要执行如下的命令给予权限。

sudo chown -R 1001:1001 ~/heyform/database

使用体验

HeyForm 提供了一个直观且用户友好的表单创建体验。注册并创建工作区后,用户可以轻松开始设计新表单。界面布局清晰,中央的编辑区域让用户可以专注于问卷内容的设计。左侧面板允许用户添加新问题或复制现有问题,为问卷设计提供了灵活性。右侧的自定义选项面板提供了丰富的功能,如设置必填项、插入图片和调整布局,让用户能够根据需求精细调整每个问题。顶部工具栏包含了预览、分享和数据分析等实用功能,方便用户在设计过程中随时查看效果并管理表单。HeyForm 还提供了大量现成的模板,用户只需点击”使用此模板”按钮即可快速开始。