- Description : Connect to specific MongoDB
- Description : Find user
- Description : Create user in MongoDB for /register
- Description : Update user's location for /{store}/report
- Description : List all locations for /profile
- Path : /login
- Description : For User and Store login
- Input : username , password
- Return - True : status 200 , jwt token
- Return - False : status 404
- Path : /register
- Description : For User register
- Input : username , password , phone
- Return - True : status 200 , jwt token
- Return - False : Exception(409 , User already exists)
- Path : /profile
- Description : List account data
- Input : jwt token
- Return - True : username , password , location , phone
- Return - False : Exception(403 , JWTDecodeError)
- Path : /{store}/qrcode
- Description : Generate QRCode for user to scan
- Input : store
- Return : base64(QRCode)
- Path : /{store}/history
- Description : List all visitors
- Input : jwt
- Return - True : List([username])
- Return - False : Exception(403 , JWTDecodeError)
- Path : /{store}/report
- Description : Update user's location by scanning QRCode
- Input : jwt , location
- Return - True : status 200
- Return - False : Exception(403 , JWTDecodeError)
- Description : Check jwt token for login
- Descriptino : Return loginstate for React.Index.jsx