Social Graph, Feed, Stories, And Mentions
Quick Answer
Social features live mainly in src/core/socialgraph, with related modules in src/core/mentions, src/core/media, and src/core/user-reporting.
This area powers social network, Instagram-style, TikTok-style, dating, chat, and community features: posts, comments, reactions, stories, friends, user search, profile feeds, hashtags, and mentions.
Source Map
src/core/socialgraph
|-- feed
| |-- api
| `-- redux
`-- friendships
|-- api
|-- helpers
`-- redux
src/core/mentions
|-- IMMentionList
|-- IMRichTextInput
`-- IMRichTextView
Important feed hooks:
| Hook | Purpose |
|---|---|
useHomeFeedPosts | Home feed subscription/fetch. |
useDiscoverPosts | Discover feed. |
useProfile | Profile feed and profile data. |
usePost | Single post read. |
usePostMutations | Create, edit, delete, or update posts. |
useCommentMutations | Create or update comments. |
useStories | Story reads. |
useStoryMutations | Story writes. |
useHashtagPosts | Hashtag feed. |
Important friendship hooks:
| Hook | Purpose |
|---|---|
useSocialGraphFriends | Current user's friends. |
useSocialGraphFriendships | Friend request state. |
useSocialGraphMixedFriendships | Mixed friend/request views. |
useSocialGraphMutations | Send, accept, reject, or remove relationships. |
useSearchUsers | Find friends/user search. |
Backend Providers
The active social provider is selected inside:
src/core/socialgraph/feed/api/index.js
src/core/socialgraph/friendships/api/index.js
Firebase and AWS provider exports exist in the generator. Keep one provider active per generated app.
Media Upload In Feed
New posts and stories often use:
src/core/camera
src/core/media
src/core/socialgraph/feed
When debugging failed post creation, separate these stages:
- text validation;
- media selection;
- media validation;
- media upload;
- feed document creation;
- feed subscription refresh.
Security And Cost Controls
Social apps can become expensive or unsafe if reads and writes are unbounded. Review:
- Firestore indexes for feed queries;
- pagination or capped page sizes;
- blocked-user filtering;
- report/block flows;
- upload limits for media posts and stories;
- Function triggers that fan out feed or notification records;
- rate limiting for comments, likes, follows, and search.
Verification Checklist
Test:
- home feed empty state;
- home feed with data;
- create text-only post;
- create image post;
- create story if enabled;
- comment creation;
- reaction/like creation;
- profile feed;
- discover feed;
- user search;
- send/accept/remove friend;
- blocked users are filtered from feeds and search.
Troubleshooting
| Problem | Fix |
|---|---|
| Feed loads forever | Check hook error handling, Firestore rules, and required indexes. |
| Post succeeds but does not appear | Check feed query filters, created timestamps, and subscription refresh. |
| Image post fails | Debug src/core/media before changing feed code. |
| User search is slow or expensive | Add backend search strategy, indexing, pagination, and rate limits. |
| Blocked user content still appears | Confirm user-reporting data is included in feed filtering. |