wealth/docs/decisions/0024-home-is-the-investors-...

1.6 KiB

0024 خانه is the investor's feed, read in the browser

Status: Superseded by 0027 · Area: architecture · Date: 2026-10-07 · Decided by: agent

Context

/ (خانه) is drawn for investors only: their followed creators' posts, premium ones open when subscribed. A creator's home tab is their own channel, no board draws a guest's home, and the API answers 401 to a guest and 403 to a creator. Every link home (the brand, back with no history, «بازگشت به خانه», login with no return path) lands there.

Decision

  • The server sends only the frame (top bar or header, «خانه») and the feed's skeleton, the same for every visitor; the feed is read in the browser with the session (feedKeys.home(), no server read and no initialData, unlike 0021), so nothing is read again for a subscriber.
  • In the browser, HomeGuard sends a guest to login with a return to /, a creator to their channel with router.replace (to step 5 first while needsProfile), and any other role to the no-access state; the skeleton stays until then.
  • Page and loading sit in (main)/(home), so its loading covers no other main route (0017); bear's @modal/page.tsx is the null page for / (0023).

Alternatives

  • A server read like the channel's (0021): rejected; the feed exists only for a signed-in investor.
  • AuthGuard's no-access state for a creator: rejected; its «بازگشت به خانه» leads back to /.

Consequences

  • / is not indexed. A guest's «بازگشت به خانه» (error pages, a missing channel) lands on login.
  • Follows change the feed: every follow or unfollow calls syncFollowCaches, which invalidates feedKeys.all.