forked from JaiSamyukth/Openchat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase-blueprint.json
More file actions
146 lines (146 loc) · 7.25 KB
/
Copy pathfirebase-blueprint.json
File metadata and controls
146 lines (146 loc) · 7.25 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
"entities": {
"User": {
"title": "User",
"description": "A user of the application.",
"type": "object",
"properties": {
"uid": { "type": "string", "description": "The user's unique ID." },
"email": { "type": "string", "format": "email", "description": "The user's email address." },
"displayName": { "type": "string", "description": "The user's display name." },
"photoURL": { "type": "string", "description": "The user's profile picture URL." },
"username": { "type": "string", "description": "The user's unique username." },
"country": { "type": "string", "description": "The user's country." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the user was created." },
"isOnline": { "type": "boolean", "description": "Whether the user is currently online." },
"lastSeen": { "type": "string", "format": "date-time", "description": "When the user was last seen." }
},
"required": ["uid", "email", "displayName", "username", "country", "createdAt"]
},
"GlobalMessage": {
"title": "GlobalMessage",
"description": "A message in the global chat.",
"type": "object",
"properties": {
"text": { "type": "string", "description": "The message text." },
"senderId": { "type": "string", "description": "The UID of the sender." },
"senderUsername": { "type": "string", "description": "The username of the sender." },
"senderPhotoURL": { "type": "string", "description": "The photo URL of the sender." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the message was sent." }
},
"required": ["text", "senderId", "senderUsername", "createdAt"]
},
"FriendRequest": {
"title": "FriendRequest",
"description": "A friend request between two users.",
"type": "object",
"properties": {
"fromUserId": { "type": "string", "description": "The UID of the user who sent the request." },
"toUserId": { "type": "string", "description": "The UID of the user receiving the request." },
"fromUsername": { "type": "string", "description": "The username of the user who sent the request." },
"toUsername": { "type": "string", "description": "The username of the user receiving the request." },
"status": { "type": "string", "enum": ["pending", "accepted", "rejected"], "description": "The status of the request." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the request was created." }
},
"required": ["fromUserId", "toUserId", "fromUsername", "toUsername", "status", "createdAt"]
},
"Friend": {
"title": "Friend",
"description": "A friend relationship.",
"type": "object",
"properties": {
"friendId": { "type": "string", "description": "The UID of the friend." },
"friendUsername": { "type": "string", "description": "The username of the friend." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the friendship was established." }
},
"required": ["friendId", "friendUsername", "createdAt"]
},
"DirectMessage": {
"title": "DirectMessage",
"description": "A direct message between two users.",
"type": "object",
"properties": {
"chatId": { "type": "string", "description": "The ID of the chat (user1_user2)." },
"participants": { "type": "array", "items": { "type": "string" }, "description": "The UIDs of the participants." },
"text": { "type": "string", "description": "The message text." },
"senderId": { "type": "string", "description": "The UID of the sender." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the message was sent." }
},
"required": ["chatId", "participants", "text", "senderId", "createdAt"]
},
"Group": {
"title": "Group",
"description": "A group chat.",
"type": "object",
"properties": {
"name": { "type": "string", "description": "The name of the group." },
"adminId": { "type": "string", "description": "The UID of the group admin." },
"members": { "type": "array", "items": { "type": "string" }, "description": "The UIDs of the group members." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the group was created." }
},
"required": ["name", "adminId", "members", "createdAt"]
},
"GroupInvite": {
"title": "GroupInvite",
"description": "An invite to join a group.",
"type": "object",
"properties": {
"groupId": { "type": "string", "description": "The ID of the group." },
"groupName": { "type": "string", "description": "The name of the group." },
"fromUserId": { "type": "string", "description": "The UID of the user who sent the invite." },
"toUserId": { "type": "string", "description": "The UID of the user receiving the invite." },
"status": { "type": "string", "enum": ["pending", "accepted", "rejected"], "description": "The status of the invite." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the invite was created." }
},
"required": ["groupId", "groupName", "fromUserId", "toUserId", "status", "createdAt"]
},
"GroupMessage": {
"title": "GroupMessage",
"description": "A message in a group chat.",
"type": "object",
"properties": {
"groupId": { "type": "string", "description": "The ID of the group." },
"text": { "type": "string", "description": "The message text." },
"senderId": { "type": "string", "description": "The UID of the sender." },
"senderUsername": { "type": "string", "description": "The username of the sender." },
"senderPhotoURL": { "type": "string", "description": "The photo URL of the sender." },
"createdAt": { "type": "string", "format": "date-time", "description": "When the message was sent." }
},
"required": ["groupId", "text", "senderId", "senderUsername", "createdAt"]
}
},
"firestore": {
"/users/{userId}": {
"schema": { "$ref": "#/entities/User" },
"description": "Stores user profiles."
},
"/globalChat/{messageId}": {
"schema": { "$ref": "#/entities/GlobalMessage" },
"description": "Stores global chat messages."
},
"/friendRequests/{requestId}": {
"schema": { "$ref": "#/entities/FriendRequest" },
"description": "Stores friend requests."
},
"/users/{userId}/friends/{friendId}": {
"schema": { "$ref": "#/entities/Friend" },
"description": "Stores a user's friends."
},
"/chats/{chatId}/messages/{messageId}": {
"schema": { "$ref": "#/entities/DirectMessage" },
"description": "Stores direct messages for a specific chat."
},
"/groups/{groupId}": {
"schema": { "$ref": "#/entities/Group" },
"description": "Stores group chats."
},
"/groupInvites/{inviteId}": {
"schema": { "$ref": "#/entities/GroupInvite" },
"description": "Stores group invites."
},
"/groups/{groupId}/messages/{messageId}": {
"schema": { "$ref": "#/entities/GroupMessage" },
"description": "Stores group messages."
}
}
}