Skip to content

Commit 9f72c5c

Browse files
committed
initial api idea for using firebase
1 parent b3c353c commit 9f72c5c

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

features_firebase.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Features
2+
these would be the features we would want if we would rewrite helpq
3+
4+
## login page
5+
- lcs login
6+
- get user data
7+
8+
## hacker view
9+
- form to submit tickets
10+
- retract tickets
11+
- estimated wait
12+
- see how many mentors are online and available with websocket/window.isFocused (wishlist) (websock)
13+
14+
## mentor view
15+
- see live feed of tickets (websocket)
16+
- claim a ticket
17+
- unclaim a ticket
18+
- complete a ticket
19+
- mark yourself as offline (wishlist)
20+
21+
## stats/admin view
22+
- most of what helpq provides for
23+
- word frequency thing to see what people are asking for help with.
24+
- how many tickets get answered
25+
- hacker and mentor count
26+
- promote user to mentor
27+
- create user (local non lcs)
28+
29+
## new
30+
### volunteer view
31+
- see how many tickets are in the queue
32+
- see all tickets
33+
- set q status
34+
35+
# api
36+
### HTTP login
37+
- POST /login {username:"", password:""}
38+
+ {ok: true, user: {isMentor, name: ""}, token} if login was valid
39+
+ {ok: false, err: ""} if invalid login
40+
token will be given to firebase for login
41+
### HTTP tickets
42+
Tickets will be done through client talking to firebase
43+
- mentees should only be able to see their ticket and only have one ticket
44+
- mentees shouldn't be able to submit tickets to a closed queue
45+
- mentors shoul be able to see all tickets
46+
- mentees should not delete tickets but can mark it as resolved
47+
- mentors can mark any ticket as resolved
48+
### HTTP status
49+
- GET /qstatus
50+
/qstatus contains one document {mentorsOnline, mentorsOnShift, qOpen, avgResponseTime}
51+
52+
##js api
53+
- login(username, pass): promise<{token, user: {isMentor: bool, name: ""}> throws BadLogin
54+
- loginToken(token): promise<token, isMentor: bool> throws BadLogin
55+
+ login in puts token in local storage
56+
- logOut()
57+
+ removes token from local storage
58+
59+
### websock
60+
- start(token): promise<ok> opens websoc
61+
- onNewTicket: (ticket)=>unit
62+
- onNewQStatus: (qStatus)=>unit
63+
64+
### user
65+
- newTicket(ticketData): promise<unit> throws AlreadyDone, BadTicket
66+
- getTicket(): promise<ticket>
67+
- retractTicket(): promise<ticket> throws NoTicket gives the retracted ticket
68+
+ for user to potentialy update
69+
- getQStatus(): promise<qStatus>
70+
71+
### mentor
72+
- claimTicket(ticketId): promise<unit> thows AlreadyDone, NoTicket
73+
- unClaimTicket(): promise<unit> throws NoTicket
74+
- getTickets(alsoCompletedOnes): promise<array<ticket>>
75+
- mentorStatus(here) tell help queue you're here or away.
76+
+ could be hooked into window.onfocus and window.onblur
77+
- complete(ticketId): promise<unit> throws NoTicket, AlreadyDone
78+
79+
### exceptions
80+
- BadLogin
81+
- NoTicket
82+
- BadTicket
83+
- AlreadyDone
84+
85+
### vars
86+
- user
87+
- token
88+
- webSocket
89+
90+
91+
92+
93+

0 commit comments

Comments
 (0)