-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathWorkFlow.txt
32 lines (27 loc) · 2.9 KB
/
WorkFlow.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
This file explains the workflow of the project:
Home page has button for student to start talking to the counsellor. He will be redirected to a window. On clicking connect to counsellor,
if any of the counsellor has their active status as true, the student will be redirected to a new window with active status false or else
student will be shown a html page notifying him that no counsellor is free. Window denotes the chatroom for the student. Counsellors will
be notified using ajax the number of students waiting for the counsellors with their chat rooms open and active status false. Whenever the
counsellor will click upon the give me the student button, he will be redirected to the chatroom of the student who has came the earliest
and still waiting and active status of the chatroom will be set true and foreignkey for counsellor to counsellor who has clicked to give
the student. So the number of students waiting will be decreased as ajax keep refreshing the page. Now when student enters his chatroom,
he will see a pop up of showing to send the hi to start conversation and after sending hi student will see a msg to wait till counsellor joins the
chatroom. Once the counsellor joins the chatroom, he will have to first send a hi or some msg to start a normal conversation and then they
will be able to see all the msgs of each other.
before closing the browser, we will notify the chatroom users that please to close the chatroom and then to close the browser as closing the
chatroom will delete all their msgs.
About the sessions implemented:
To implement the sessions, we have made the custome middleware. the name of the middleware is included in middleware settings
in settings.py . Now the name is placed at the last. The middlewares are executed from bottom to top order. So our middleware
will be the first to get executed. our middleware basically executes the following function: whenever the anonymous user
remains inactive for more than 600 secs, and after that any of counsellor or same anonymous user refreshes the page,
middleware deletes the chatroom user and messages assigned to user and then whoever is quierying they get
redirected to respective homes. middle ware are basically codes which execute on any
responce or request from the user to the site. we have set cookies only for the anoymous user and not for the counsellor as counsellor may
be attending multiple users at the same time.
For the middleware to work correctly, there are some settings which are added to the settings.py like expire on browser close
which enable browser based sessions. So when browser is closed (not window) session cookies are deleted.
Also there is a ready function in apps.py which will be executed after every 1 hrs so that any unattended open
chatrooms which didnt have any request response action which will delete the chatroom happens, all those chatrooms will be deleted.
This is the functionality of the anonymous counselling portal.