Skip to content

t301000/digital-board

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

簡易電子看板

  1. 不須後端程式
  2. 資料庫使用 firestore
  3. 解析度 1920x1080 或 1366x768
  4. 使用 chrome 全螢幕呈現
  5. 可展示素材:google 簡報、YouTube 播放清單

設定與安裝

  1. 複製 app/config.sample.js 為 app/config.js
  2. 登入 firebase 並新增一專案,資料庫選擇 firestore,以測試模式啟動
  3. 取得專案設定值,填入 app/config.js
  4. 瀏覽 /install,建立帳號
  5. 瀏覽 /login,登入後即可建立看板
  6. 建議將 install 資料夾刪除

firestore 規則設定

由於一開始使用測試模式啟動,任何人都可以讀寫資料庫,因此安裝完成後要將以下規則寫入並發佈

service cloud.firestore {
  match /databases/{database}/documents {
    
    match /boards/{board} {
      // 開放讀取
      allow read;
      // 只有對該 board 有管理權者才能寫入
      allow write: if (request.auth.uid !=null) && exists(/databases/$(database)/documents/users/$(request.auth.uid)/boards/$(board));
      
      match /{document=**} {
      	allow read;
        allow write: if (request.auth.uid !=null) && exists(/databases/$(database)/documents/users/$(request.auth.uid)/boards/$(board));
      }
    }
    
    match /users/{uid} {
      // 只有 user 能讀寫自己的 document
      allow read, write: if request.auth.uid == uid;
      
      match /{document=**} {
        allow read, write: if request.auth.uid == uid;
      }
    }
    
    match /flags/{documents=**} {
      allow read;
      allow write: if false;
    } 
  }
}

About

簡易電子看板

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published