owned this note
owned this note
Published
Linked with GitHub
# Panel Discussion Moderator for SITCON (PDModerator)
## TODO
1. #1 後端檢查名稱/SUMMARY長度
2. #4 Attendee 更改前端 alert 訊息 (alter, 成功排入講者 Queue 中)
3. ? 增加 /#/All 看 Mongodb 所有資料
4. V Moderate list count update
5. #1 主題 length <= 30 (maxlength)
6. #2 timestamp 解析成人能看的
7. V 前端表單 required 驗證
8. ? Move secret key to server config
9. #9 倒數改用鍵盤快捷鍵
10. #7 結束時 reset 剩餘時間
11. #3 moderate websocket 同步,直接拉 API 不要用 ws 送 obj
12. #1 名子 length ++ (英文) (w_char?)
13. #4 摘要範例
14. #4 Attendee 頁面改標題 => 不要讓人認為這會直接排上 queue
15. #8 下一位 btn disable 問題
16. #5 can not delete when in queue
17. #6 index 加上 viewport
## 功能概述
提供三個介面
1. /#/ 與會者介面
2. /#/moderate 後端審核獎者介面
3. /#/queue 顯示於投影機之畫面
## 技術概述
- 前端
- Vue.js
- Webpack
- 後端
- Express.js
- Socket.io
- Mongodb
## 功能描述
### /attendee
- 功能
- 填入
- [x] 暱稱 (**限制 length <= 10**)
- [x] 發言摘要 (**限制 length <= 100**)
- [x] Email
- [x] reCAPTCHA
- Extra
- [ ] 建議名稱加上簡單的說明(改文案)
- [ ] Submit History (LocalStorage)
- [x] reCAPTCHA backend confirmation
- [ ] 靜態 queue 列表頁面
- [ ] 被 recognized 的通知
- NOTE
- 透過 AJAX (不要 WS) POST
- POST /api/attendee
### /moderate
- 功能
- [x] 用 websocket 接收 attendee 申請
- [x] 對每個 attendee 執行通過/刪除
- [x] 設定現在主題
- Extra
- [ ] 控制 Timer
- [ ] 控制下一個人
- [ ] 刪除理由
### /queue
- 功能
- [x] 顯示 timer
- [x] 顯示現在的 queue
- [x] 顯示目前講者 & Summary
- [x] 顯示目前主題
- [x] websocket 自動更新
- [ ] 聽 websocket 更新訊息,ajax GET
- Extra
- [x] Queue length
## MongoDB.subject
### Data Structure
```json
{
"_id": "MONGODB_ID",
"subject": "string",
"created_at": "string"
}
```
### GET /api/subject
取得目前的 Subject
#### response
```
string
```
### POST /api/subject (AUTH)
更新 Subject
```json
{
"subject": "string"
}
```
## MongoDB.attendee
### Data Structure
```json
{
"_id": "MONGODB_ID",
"attendee_name": "string",
"summary": "string",
"email": "email_string",
"gravatar": "gravatar_url_string",
"created_at": timestamp,
"recognized_at": 0, // 認可後改為 timestamp
"spoken_at": 0, // 講完後改為 timestamp
"removed_at": 0 // 刪除改為 timestamp
}
```
## 已完成 API
### POST /api/attendee
讓參加者申請上台
```json
{
"attendee_name": "string",
"email": "string",
"summary": "string",
"g_recaptcha_response": "string"
}
```
#### response
```json
{
"status": true
}
```
### GET /api/attendee (AUTH)
給 moderate 拿到所有 (removed_at = 0 && recognized_at = 0) attendee
#### response
```json
[
{
"_id": "58b16b157a0ebe3a14da87c1",
"attendee_name": "Jeremy",
"summary": "WERCTVIYBOUHNIJM",
"email": "jeremy5189@gmail.com",
"gravatar": "https://www.gravatar.com/avatar/ea3f65db2b33fad0b573b3c25775f3aa?s=150",
"created_at": 1488022293,
"recognized_at": 0,
"spoken_at": 0,
"removed_at": 0
}
]
```
### PUT /api/attendee/{_id} (AUTH)
1. 認可講者
- `recognized` = boolean
2. 刪除講者
- `removed` = boolean
3. 更新講者講完
- `spoken` = boolean
```json
{
"recognized": 'true' or 'false',
// OR
"removed": 'true' or 'false',
// OR
"spoken": 'true' or 'false'
}
```
#### response
```json
{
"status": true
}
```
### GET /api/queue
取得目前進入 Queue 的所有講者