This repo has been archived in favor of https://github.com/oss-videochat/bitlink
Contains the code for the backend of the video conference call app.
Format
event-string(arg1,arg2) - description
equals
io.emit('event-string', 'arg1', 'arg2')
events the client can emit
create-room()
- Create a room. Client should receive ajoin-room
event soon.join-room(idOfRoom [, nameOfParticipant])
- Join a room. Client should receive aroom-summary
event if joining was successful. Otherwise, they will receive anerror
event.update-mediaState(userSettings)
- Update user mediaState.
interface UserSettings {
cameraEnabled?: boolean,
microphoneEnabled?: boolean,
}
update-name(name)
- Update name.
join-room(idOfRoom)
- User should attempt to join the room in the id provided by emittingjoin-room
.room-summary(summary)
- [TODO]new-participant(participantInformation)
- A new user has joined. Information about that client inparticipantInformation
arg.destory
- The room has been destroyed (host either closed it or error occurred).
interface ParticipantInformation {
id: string,
name: string,
mediaState: UserSettings
}
<new|edit|delete>-<room|direct>-message(MessageJSONSummary)
- A message event has occurred. Message event type could beennew
,edit
, ordelete
. Message type could beroom
or adirect
message.
enum Reactions {
ThumbsUp,
ThumbsDown,
Laugh,
Confused,
Celebrate,
OneHundred,
QuestionMark,
Clap,
}
interface ReactionSummary {
type: Reactions,
participantId: string, // id of participant to reacted
}
interface MessageJSONSummary {
from: string // id of participant
to: string, // id of participant
message: string, // id of message
content: string,
reactions: Array<ReactionSummary>
}
:roomIdHash
is a md5 hash of the room id
interface ParticipantAuthObj {
id: string,
key: string
}
POST /api/:roomIdHash/send
-------------------------------
Content-Type: application/json
body: {
from: ParticipantAuthObj,
to: string, // id of to participant || "everyone" if its a room message,
content: "Message content"
}
{
"success": true,
"error": null,
"data": MessageJSONSummary
}
POST /api/:roomIdHash/edit
-------------------------------
Content-Type: application/json
body: {
from: ParticipantAuthObj,
messageId: string, // id of the message the user wishes to edit
content: "Message content" // new content
}
{
"success": true,
"error": null
}
POST /api/:roomIdHash/delete
-------------------------------
Content-Type: application/json
body: {
from: ParticipantAuthObj,
messageId: string, // id of the message the user wishes to delete
}
{
"success": true,
"error": null
}