Repository navigation
Content hub
The content hub is the public viewer experience. It lets viewers open a creator's Tapitude page and load that creator's published content.
Current public URL pattern:
/content-hub/:creatorSlugThe controller also registers /content-hub, but the useful public route is the slug route.
Older references to /c/:creatorSlug and /p/:postSlug should be removed unless those routes are intentionally reintroduced later.
The content hub uses the creator profile for:
- Creator slug
- Brand name
- Brand color
- Profile image
- User id for loading content
Posts are loaded through Socket.IO from the /content-hub namespace.
Current viewer-side behavior:
- Viewer opens
/content-hub/:creatorSlug. - Server finds the
CreatorProfilebycreatorSlug. - Server checks that the creator's user account is active.
- EJS renders the content hub shell.
- Browser-side JavaScript connects to Socket.IO.
- Browser emits
requestContent. - Server returns content pages for the creator.
The intended rule is:
- Only show posts for the selected creator.
- Only show posts that are published or due to be public.
- Sort newest content first.
The current content hub controller queries by:
creatorId
status = "published"
publishDate <= now OR publishDate = null
sort by publishDate descendingThe current ContentPage schema should be reviewed against the controller query. The controller and views reference status, but the inspected schema primarily defines publishDate as the scheduling/publication field.
Before final handoff, reconcile whether the source of truth is:
-
status + publishDate, or -
publishDateonly.
Then update the schema, controller queries, and wiki together.
The content hub currently supports:
- View tracking through
viewedBy. - Total creator views through
CreatorProfile.totalViews. - Likes through
ContentPage.likes. - Total creator likes through
CreatorProfile.totalLikes.
Recommended follow-up:
- Prevent likes from going below zero.
- Validate that liked posts belong to the active creator.
- Avoid broadcasting one viewer's requested content to unrelated viewers.
Current code joins all viewers to the same room:
viewer_hubRecommended improvement:
- Use
socket.emit(...)for responses intended only for the requesting viewer. - Or use creator-specific rooms such as
viewer_hub:<creatorId>.
This prevents one viewer's feed request from being sent to every connected viewer.
The current code does not implement:
- Public viewer accounts.
- Comments.
- Public post detail pages.
- Shopping or ecommerce flows.
- Public creator signup.