https://github.com/stoneapptech/mask-frontend
https://github.com/stoneapptech/mask-backend
https://github.com/stoneapptech/mask-data
https://github.com/stoneapptech/mask-utils
fcm
service worker
localStorage 存選擇的藥局清單
IndexedDB
後端
{
token: string,
area_id: string,
is_even: boolean
}
{
succeeded: true
}
{
succeeded: false,
message: 'invalid argument'
}
{
succeeded: false,
message: 'subscription failed',
errors: error messages from firebase
}
errors
property, see Firebase document.{
token: string,
old_area: string,
new_area: string,
is_even: boolean
}
{
succeeded: true
}
{
succeeded: false,
message: 'invalid argument'
}
{
succeeded: false,
message: 'unsubscription failed',
errors: error messages from firebase
}
{
succeeded: false,
message: 'subscription failed',
errors: error messages from firebase
}
errors
property, see Firebase document.{
token: string,
area_id: string,
is_even: boolean
}
{
succeeded: true
}
{
succeeded: false,
message: 'invalid argument'
}
{
succeeded: false,
message: 'unsubscription failed',
errors: error messages from firebase
}
errors
property, see Firebase document.為縣市與鄉鎮市區建立 ID
臺北市(A) 大同區(01) = A.01
醫事機構代碼
5901012061
API endpoint (?) https://stoneapptech.github.io/mask-data/
folder structure
{
city: "臺北市"
town: "大同區"
store: [
{name: "範例藥局1", address: "某市某區某路", tel: 0212345678, code: 5901012061},
{name: "範例藥局2", address: "某市某區某某路", tel: 0212345679, code: 5901012062}
]
}
{
area_id: "A.01"
city: "臺北市",
town: "大同區",
name: "範例藥局1",
address: "某市某區某路",
tel: 0212345678,
note: "備註"
}
[5901012061, 5901012062] # 醫事機構代碼
{adult: 10, child: 10}
<unix timestamp>
{
"A": {
name: "臺北市",
town: {
"01": "大同區",
...
}
},
"B": {
name: "臺中市",
town: {
"01": "X區",
...
}
},
...
}
{
area_id: "<area_id>"
available: [1234567890,1234567892,1234567894]
}
st=>start: 第一次進入
e=>end: 設定完成
digit=>operation: 詢問身分證最後碼
area=>operation: 選擇區域 (縣市 & 鄉鎮市區)
stores=>operation: 選擇藥房 (此區域內的數間)
ask=>condition: 詢問是否開啟通知
register=>operation: 註冊 fcm
(傳送area_id & token)
st->digit->area->stores->ask
ask(yes)->register->e
ask(no)->e
Server->Open Data: 取得口罩數量
Open Data->Server: 回傳口罩數量
Server-->>github: 上傳更新口罩數量
Server-->>Client: 區域中有口罩藥房清單,依使用者登錄之區域推送
Client->github: 取得詳細數量
https://data.nhi.gov.tw/Datasets/DatasetResource.aspx?rId=A21030000I-D50001-001
https://api.maskhelp.info/swagger-ui.html
https://www.post.gov.tw/post/internet/Postal/index.jsp?ID=208
https://file.stoneapp.tech/健保特約醫事機構-藥局_藥局.csv
把地址帶有?
的補齊了
https://g0v.hackmd.io/@kiang/mask-info
https://github.com/kiang/
https://github.com/WJWang/mask-help-info-api/issues/2
https://www.sentinelstand.com/article/device-group-management-with-firebase-cloud-messaging
https://firebase.google.com/docs/cloud-messaging/js/topic-messaging
https://developers.google.com/web/updates/2015/12/background-sync