A minimalist questionnaire system that can help you solve your questionnaire-related needs with just some simple configurations.
Main front-end frameworks and libraries: Vue, Element, Vuex, Vue-Router
Main back-end frameworks and libraries: express, mongodb, mongoose
Administrator login (PS: Control the turning on and off of low-polygon background animation. Turning on the background animation in the current version is a great test on computer performance, so it is recommended to turn it off)
Set up a questionnaire template.
Select a template to generate a questionnaire.
Users fill out the questionnaire.
Statistics Questionnaire.
Download the code git clone https://github.com/no5no6/questionnaire.git
.
To install backend dependencies, execute npm install
in the project root directory.
To install the front-end dependencies, execute npm install
in the project questionnaire_web directory.
To configure the database, first confirm that mongodb has been installed correctly on this machine and started normally on this machine. Create the questionnaire
database locally, set the login account username to ky1
, and the password to 123
(PS: If you need to change the database name, username, and password, please open the questionnaire/models/index.js file and find the corresponding location 'mongodb://ky1:123@localhost:27017/questionnaire'
can be modified).
(1). Open the terminal window (Terminal).
(2). Use the command line to enter mongodb, enter and execute mongo
.
(3). Create questionnaire database, input and execute use questionnaire
.
(4). Create user, enter and execute
db.createUser({
user:'ky1',
pwd:'123',
roles:[{
"role" : "readWrite",
"db": "questionnaire"
}]
})
Start the back-end service and execute node questionnaire
in the project root directory.
Create administrator
(1). Open the terminal window (Terminal).
(2). Use the command line to enter mongodb, enter and execute mongo
.
(3). Create questionnaire database, enter and execute use questionnaire
.
(4). Create user, enter and execute
db.users.insert({
name: "admin",
password: "123",
organization: 'test'
})
Start the front-end service and execute npm run dev
in the project questionnaire_web directory.
Open the browser and visit localhost:8080/#/questionList. (PS: When filling in the questionnaire, just send the viewing address to all users who need to fill in the questionnaire)
├── db // 备份数据库脚本
├── models // 数据库模型目录
├── public
│ └── web // 前端打包后运行文件目录
│
├── questionnaire_web // 前端目录
│ ├── src
│ │ ├── components // 组件目录
│ │ ├──router // 路由目录(vue-router)
│ │ ├── store // 模型目录(vuex)
│ │ ├── views // 视图目录
│ │ └── main.js // 前端入口文件
│ ├── index.html // 首页
│ └── package.json // 前端包管理文件
│
├── router // 接口目录
├── package.json // 后端包管理文件
└── questionnaire.js // 项目主进程