Skip to content

Frontend Initial State Design (Current)

Stephanie Chan edited this page Mar 21, 2018 · 18 revisions
{
    "chat": {
        "connected": "whether a user is connected to the chat or not"
    },
    "auth": {
        "auth": "counsellor, user, or null if not authenticated",
        "status": {
            "error": "error message",
            "success": "success message",
        }
    },
    "counsellor": {
        "counsellor": {
            "ID": "from the counsellor entry in the DB",
            "firstName": "from the counsellor entry in the DB",
            "lastName": "from the counsellor entry in the DB",
            "email": "from the counsellor entry in the DB",
            "students": [{
                "ID": "from the user entry in the DB",
                "username": "from the user entry in the DB",
                "phoneNumber": "from the user entry in the DB"
            }]
        },
        "status": {
            "error": "error message",
            "success": "success message",
        }
    },
    "user": {
        "user": {
            "ID": "from the user entry in the DB",
            "username": "from the user entry in the DB",
            "nickname": "from the user entry in the DB",
            "age": "from the user entry in the DB",
            "gender": "from the user entry in the DB",
            "phoneNumber": "from the user entry in the DB",
            "email": "from the user entry in the DB",
            "registered": "from the user entry in the DB",
        },
        "status": {
            "error": "error message",
            "success": "success message",
        }
    },
    "room": {
        "activeRoom": "id of the active room",
        "rooms": [{
            "roomID": "ID of room",
            "sessionID": "ID of latest chat session",
            "humans": {
                "counsellor": "ID of counsellor",
                "user": "ID of user"
            },
            "messages": [{
                "ID": "from the message entry in the DB",
                "sessionID": "from the message entry in the DB",
                "messageTime": "from the message entry in the DB",
                "counsellorID": "from the message entry in the DB",
                "userID": "from the message entry in the DB",
                "messageContent": "from the message entry in the DB",
                "fromCounsellor": "from the message entry in the DB",
                "fromTwilio": "from the message entry in the DB"
            }]
        }]
    },
    "sms": {
        "sms": {
            "email": "from the settings entry in the flat file",
            "twilioPhoneNumber": "from the settings entry in the flat file",
            "accountSid": "from the settings entry in the flat file",
            "authToken": "from the settings entry in the flat file"
        },
        "status": {
            "error": "error message",
            "success": "success message",
        }
    }
}
Clone this wiki locally