Commit Graph

5 Commits

Author SHA1 Message Date
Amiram_se aafac927bf refactor(market,apps): drop the session proxy and restore auth in the browser
The server render no longer depends on auth: it reads no session and
forwards only FORWARDED_COOKIES (none today), so every visitor of a URL
gets the same HTML and the Next.js proxy is no longer needed.

- Remove proxy.ts from bull and bear, the app/session module, the
  server auth and role guards, and the server caches that read the
  viewer's own data. Public caches stay: channel, post, prediction stats.
- Add an auth store (status unknown | guest | member) filled by the
  restoreSession action, which reads GET /auth/session once per load
  from the AppShell's useSession hook.
- Login and register actions set the store, logout clears it; the
  AppShell clears the query cache on auth.logout. No router.refresh.
- Add client AuthGuard (fallback, optional role) and GuestGuard, with
  safeReturnPath limiting post-login redirects to same-site paths.
- readOnServer no longer redirects on 401.
- The browser HTTP client refreshes against AUTH_ENDPOINTS.refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 22:28:05 +04:00
Amiram_se a483fc0767 feat(market): app foundation, session handling and feature data layer
Foundation
- AppShell: query client, i18n, connection bar (NetworkBoundary), toast region,
  and reactions to sign-in and sign-out
- error boundaries: ErrorFallback, PartBoundary (catchError), StatusEmptyState,
  readOnServer
- typed ROUTES, platform env (API origin, support config), Persian locales
  (common, errors) with typed i18next keys
- mapApiErrorBody adapts the gateway's error envelope; shared utils for E.164
  phones, API URLs and field-error renames
- session: refreshSessionInProxy renews an expired cookie session before render
- guards: requireAccount, redirectIfSignedIn, requireRole

Data layer (entities, repositories with mappers, query keys, server caches)
- auth (with login, logout and registration actions), profile, channel, follow,
  notification, post, prediction, feed, pricing, checkout, subscription,
  transaction, overview, finance
- shared domain enums live in shared/constants

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 21:33:07 +04:00
Amiram_se 5e35fbd6f2 feat: libs, tools 2026-10-02 19:42:11 +04:00
Amiram_se 486f86fcea fix: gitignore 2026-10-02 19:30:30 +04:00
Amiram_se 7dde8dd6f8 feat: scaffold 2026-10-02 18:19:11 +04:00