Skip to content

Commit 1f52a55

Browse files
committed
updated the readme of example project
1 parent 7378d10 commit 1f52a55

3 files changed

Lines changed: 24 additions & 352 deletions

File tree

examples/social-demo/PLAN.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/social-demo/README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ Add these extra fields to the `users` schema:
7070
{
7171
"authorId": { "type": "String", "required": true },
7272
"authorUsername": { "type": "String", "required": true },
73+
"authorDisplayName": { "type": "String" },
74+
"authorAvatar": { "type": "String" },
75+
"authorVerified": { "type": "Boolean", "default": false },
7376
"content": { "type": "String", "required": true },
7477
"images": { "type": "Array", "default": [] },
7578
"likesCount": { "type": "Number", "default": 0 },
76-
"commentsCount": { "type": "Number", "default": 0 }
79+
"commentsCount": { "type": "Number", "default": 0 },
80+
"retweetsCount": { "type": "Number", "default": 0 },
81+
"createdAt": { "type": "Date", "default": "Date.now" }
7782
}
7883
```
7984

@@ -131,20 +136,36 @@ To protect your **Secret Key**, this app uses a hybrid architecture:
131136

132137
## 📊 Detailed Schema Reference
133138

139+
### `comments`
140+
```json
141+
{
142+
"postId": { "type": "String", "required": true },
143+
"authorId": { "type": "String", "required": true },
144+
"authorUsername": { "type": "String", "required": true },
145+
"authorDisplayName": { "type": "String" },
146+
"authorAvatar": { "type": "String" },
147+
"content": { "type": "String", "required": true },
148+
"likesCount": { "type": "Number", "default": 0 },
149+
"createdAt": { "type": "Date", "default": "Date.now" }
150+
}
151+
```
152+
134153
### `likes`
135154
```json
136155
{
137156
"userId": { "type": "String", "required": true },
138157
"targetId": { "type": "String", "required": true },
139-
"targetType": { "type": "String", "enum": ["post", "comment"] }
158+
"targetType": { "type": "String", "enum": ["post", "comment"] },
159+
"createdAt": { "type": "Date", "default": "Date.now" }
140160
}
141161
```
142162

143163
### `follows`
144164
```json
145165
{
146166
"followerId": { "type": "String", "required": true },
147-
"followingId": { "type": "String", "required": true }
167+
"followingId": { "type": "String", "required": true },
168+
"createdAt": { "type": "Date", "default": "Date.now" }
148169
}
149170
```
150171

0 commit comments

Comments
 (0)