- Install npm packages.
npm install
- Properly configure
config.json
. - If deployed on heroku, have to configure
MONGODB_URI
.
- Input student id at student login page.
- Let admin scan qrcode for each counter.
- Input username and password at admin login page.
- Allow camera access.
- Scan student qrcode. (or manually type id)
- Comment. (optional)
- Press pass or fail. (Success alert will pop)
- (For card counter) If student all pass, will pop "All pass" alert when scan qrcode.
Returns an instance of student collection from database.
/studentInfo
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
id |
required | student id of the target | A00000000 |
curl --data "id=A0000000" http://localhost:8080/studentInfo
{
"_id":"5b908251a207860004c3e75a",
"englishName":"Bobby",
"chineseName":"王小明",
"timeSection":1,
"id":"A00000000",
"isChinese":true,
"isVisiting":false,
"commentLog":"",
"receipt":true,
"health":true,
"insurance":true,
"plane":true,
"visiting":false,
"emergency":true,
"card":false,
"isEntered":true,
"entryFee":true,
"__v":0
}
Renders student login page.
/
If target is valid, render QRcode page. Else, render student login page.
/registration
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
id |
required | student id of the target | A00000000 |
curl http://localhost:8080/registration?id=A00000000
Renders admin login page.
/adminLogin
curl http://localhost:8080/adminLogin
If username and password is valid, render validation page. Else, render admin login page.
/adminInfo
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
username |
required | username of the target | insurance | |
password |
required | password of the target | insurance |
curl --data "username=card&password=card" http://localhost:8080/adminInfo
Updates the property of target student.
/adminSetProperty
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
id |
required | student id of the target | A00000000 | |
serviceName |
required | property name to update | card | |
password |
required | SHA256 hashed password of admin | 8367cd66fdd136bba8ba23f8805bb050dd6289401c8ec3b0be44a3c233eef90d |
|
verdict |
required | verdict of pass or fail (boolean) | true |
|
comment |
required | comment regarding verdict (string) | Pass but have to provide more info later. |
curl\
--data "id=A00000000"\
--data "serviceName=card"\
--data "password=8367cd66fdd136bba8ba23f8805bb050dd6289401c8ec3b0be44a3c233eef90d"\
--data "verdict=true"\
--data "comment=Pass but have to provide more info later."\
http://localhost:8080/adminSetProperty
If successfully modified, returns Success
.
Else, currently will not return anything and keeps hanging. (To be fixed)
Initializes database with files with hardcoded path
/initDB
curl http://localhost:8080/initDB
Returns Database initialized.
Check whether target passed all the requirements for registration.
/isAllPass
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
id |
required | student id of the target | A00000000 |
curl --data "id=A00000000" http://localhost:8080/isAllPass
If all pass, Success=true
in post request response.
Else, Sucess=false
in post request response.
- If user initially denied permission for camera, then ssl will remeber so have to remove manually the settings.
- Allow camera and javascript access in Safari settings.
- QRcode scanner won't work on android (still no fix).
- If student cannot render qrcode, try using other browser (Chrome usually works).
- Let
isAllPass
return the missed counters instead of not returning anything when fail. - When the admin scans qrcode, (default) send request to let student pass (to avoid forgetting to press pass).
- Enlarge font for counter display in student QRcode page (shrink qrcode?).