Commit Graph

40 Commits

Author SHA1 Message Date
Amiram_se d56064fa2e feat(dashboard): list subscribers and clean the plans tab
The plans tab loses «مخاطبان», whose figures now live on the overview, and
shows the soonest-ending subscribers instead. /dashboard/subscribers lists them
all with «همه» and «در حال انقضا»; notifications may now open it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:10:36 +04:00
Amiram_se 33321c2e65 feat(dashboard): add the overview tab as the analyst's default
Adds /dashboard/overview to both apps, with its read of the API's overview
and subscriber list routes. The tab row is now «نمای کلی» · «طرح‌های اشتراک» ·
«سیگنال‌ها» · «مالی», and the nav's داشبورد opens it for a creator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:05:24 +04:00
Amiram_se e1ad6056fc feat(pricing): show the price floor in the editor, plans tab and admin settings
The editor reads the floor from the API, on the final price after any
discount, with the spec's hints and errors, and a tier the floor took off
sale stays editable through the 7-day lock. The plans tab marks those
tiers and links to the fix. Checkout, renew and reactivate handle 409
tier_unavailable. The admin panel gets «تنظیمات» with «کف قیمت اشتراک»: a
dry-run preview on a raise and a confirm with an audited reason. Removes
the stale esbuild key from the Vitest config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 01:51:10 +04:00
Amiram_se cac4f8e229 feat(signals): add exact or range entry and required stop-loss to the composer
The composer asks for the entry as «قیمت دقیق», prefilled from the live
quote until edited, or «بازه», plus a required stop-loss, and checks the
levels against that entry on blur, on a direction change and on every
quote refresh. The confirm step sends what it showed. The signal card
shows a range with «بازه» and «ورود (بازه)», measures from its middle,
and shows «ریسک به ریوارد» as lower to higher ratio.

Every UI string now says «سیگنال» in place of «پیش‌بینی». Code identifiers
and routes stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 01:41:04 +04:00
Amiram_se 01c838e869 feat(legal): add rules caption, analyst agreement and re-acceptance gate
Reads the three legal documents from the API, so /terms and
/terms/subscription render in the browser under a (tabs) route group, and
adds /terms/analyst-agreement. The login and sign-up phone pages accept the
rules through a caption, the analyst sign-up requires the agreement and sends
its version, and a blocking gate opens from the session or a 403
agreement_required. Account rows and the rules_updated notification follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 01:28:42 +04:00
Amiram_se 4ae62a96e1 feat(pwa): add iOS splash screens to bull and bear
The pwa lib lists every iPhone and iPad screen and builds a portrait and a
landscape startup image for each. Both apps' root metadata links the images
and adds apple-mobile-web-app-capable, which Next.js 16 no longer renders.
tools/generate-splash-screens.ts draws each app's icon on the manifest
background with next/og; run it again when the icon, the background or the
screen list changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:18:41 +04:00
Amiram_se 2a1b657a77 feat: render every page except the landing in the browser
- Channel, post, checkout and analysts read their data in the browser; the
  server reads no back-end data outside the landing (0070).
- Only the landing is indexable; every other page is noindex, the rules
  pages through the terms layout (0071).
- Remove the landing's loading.tsx so all of it renders in the first flush.
- Remove the server caches and metadata helpers nothing uses any more.
- Update the page rendering docs; 0021, 0045 and 0055 are superseded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 15:40:47 +04:00
Amiram_se 6b8269900d chore: remove name 2026-10-17 13:59:42 +04:00
Amiram_se bbd8789b9b feat: update configs 2026-10-17 13:58:30 +04:00
Amiram_se d31903b4c0 feat: update creator route 2026-10-16 15:30:43 +04:00
Amiram_se 73eb571530 chore: udpate skills 2026-10-15 14:36:00 +04:00
Amiram_se 8c300edf68 feat(admin): wall-street-plaza admin panel on garden-roof, bound to admin-api
- New admin app apps/wall-street-plaza (port 7002) and platform platforms/garden-roof
  (scope:admin), talking only to admin-api through the /api rewrite (decision 0061;
  0062 and 0063 proposed).
- All J11 sections: beta health, verifications, analysts, invite codes, subscriptions,
  predictions, payouts, featured; audit log, cross-section refresh, Persian-only errors.
- Admin login matches the uniform admin-api contract (one OTP_INVALID message, 429 wait,
  local code check); reason hints say who reads each reason.
- island: DataTable, Pager, PersonSummary, TabLinks count, StatTile footer; tools:
  exactDuration; market: subscription_extended/refunded notification icons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:06:38 +04:00
Amiram_se aec09a0ecd refactor: code review 2026-10-10 18:28:58 +04:00
Amiram_se c593e09554 feat(apps): rules pages under /terms, pricing editor with leave guard, page-size errors on subscriptions and transactions, pending channel gate, welcome sheet and invite notes on channels, registration back on step 4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:29:48 +04:00
Amiram_se e945e646fc feat(apps): static metadata except channel and post pages, metadata in head for every visitor, manifest from market, no iPhone input zoom in bull
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 12:19:43 +04:00
Amiram_se c801ab6d8e chore(apps,decisions): three-tab creator layouts, intercepts without loading files; propose 0050, note 0023 intercept loading
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 19:34:24 +04:00
Amiram_se 5eba6775f8 feat(apps): account, search, analysts, prediction composer, creator predictions and install routes in bull and bear; manifest, service worker and placeholder app icons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:46:36 +04:00
Amiram_se 48166c17db feat(apps): auth frames on the 560 column with back, payment result back to the channel, layouts declare toast placement
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 17:38:43 +04:00
Amiram_se 000c42bd74 feat(apps): creator plans, finance and pricing routes in bull and bear
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:11:12 +04:00
Amiram_se 3b8c95a94e feat(apps): checkout, payment, subscriptions, transactions and notifications routes in bull and bear
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 22:36:22 +04:00
Amiram_se 45c5551e18 feat(apps): prerendered landing at / and خانه at /feed in bull and bear
- `(landing)` route with `force-static` and `revalidate = 600`, its
  loading and error pages, the hero image and LandingRedirect (0026, 0027).
- `force-dynamic` moves from the root layouts to each route group's
  layout, so every other route still renders per request.
- The feed moves from `(main)/(home)` to `(main)/feed`, with bear's
  empty `@modal` page.
- Auth frames' brand goes to the landing, onboarding's to خانه.
- Server bootstrap adds the server-only translations; server env reads
  `NEXT_PHASE` for the build-time fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 23:02:58 +04:00
Amiram_se 7949eb0d64 feat(market): channel, posts, composer, home feed and following
The creator's channel and post pages, the post composer, the investor's home feed and the following tab, in bull and bear.

- Channel and post page start from the server's read and re-read in the browser for the creator or a subscriber; locked posts show a gate only once the viewer and their standing are known, frozen for another creator.
- Composer: text and up to four images uploaded as picked, free or premium, a device draft that keeps stored file URLs, 15-minute edit of a published post; on desktop a dialog over the page through bear's @modal intercept.
- Owner actions: preview as a visitor or subscriber, edit, delete (dialogs locked while sending), close a prediction with the outcome the API recorded.
- Follow and unfollow run in tap order; the home feed dates posts from its last read; paged lists read past pages with nothing to show.
- Cache stays true after mutations: a delete re-reads the channel's offset pages, a new post resets them, and a post page delete navigates without a stale refresh.
- Navigation: bottom nav, mobile top bar, desktop header and publish menu; the preview chrome only for the creator's own post.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:29:33 +04:00
Amiram_se cb0891c77c feat(market): complete entering and onboarding
Login, registration steps 1–4 and step 5 now follow the design (S6, R2-Register, R2-CompleteProfile).

- Login: hourly code limit and blocks open the code step with their wait; wrong-code message no longer replaced while retyping; suspended screen on its own route with the admin's reason; «log in to subscribe» variant.
- Registration: focus on the first card or empty upload box; typed number kept; «تمدید زمان» renews the token; live username check with ✓; leave prompt for in-app links; creator ID accepts PDF and maps server field errors.
- Step 5: square photo crop, stricter link rules, done screen on its own route; the session's `needsProfile` keeps unfinished creators out of publishing and pricing (OnboardingGuard) and sends them back to step 5 at login.
- Every auth and onboarding route has its own loading skeleton matching its frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 21:47:26 +04:00
Amiram_se ed6ddc05b1 feat(apps): call the API through a same-origin /api rewrite
- next.config rewrites /api/:path* to API_INTERNAL_ORIGIN, with a 120 s proxy timeout for uploads; NEXT_PUBLIC_API_ORIGIN is gone.
- The browser HTTP base is /api/v1; media, avatars and uploads load through /api (market env `apiBaseUrl`), so private media gets the session cookie.
- toApiUrl keeps a narrow rule for uploads stored with a host before the back end stored paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 21:47:18 +04:00
Amiram_se cfa8cce1b0 refactor: code review 2026-10-06 17:12:50 +04:00
Amiram_se dc221f50bf chore(apps): run bull on 7000 and bear on 7001; ignore server-proxy.js
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:33:12 +04:00
Amiram_se a6e6eddc94 feat(apps): registration step 5 pages in bull and bear
Add /onboarding/creator-profile and /onboarding/investor-profile to both
apps, with the group's loading skeleton. Each page renders its frame on the
server and its step only in the browser behind AuthGuard for its role, with
noindex. bull uses the mobile top bar and column; bear the desktop header,
with the creator's form card beside its live preview (AuthTemplate
`framed={false}`) and the investor in the 560 card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:33:00 +04:00
Amiram_se 02e543d95d refactor(market,apps): share the registration frame with onboarding
Registration step 5 lives under (onboarding), so the pieces both route groups
use move to the nearest level they share. No behavior change.

- SupportEntry and RegisterProgress move from screens/(auth) to
  screens/organisms.
- bull's AuthTopBar and both apps' AuthTemplate move from the (auth) group to
  the app root's organisms/ and templates/.
- MARKETS and Market move from the profile feature to shared/constants, so
  features other than profile (the investor's interests) can use them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:32:05 +04:00
Amiram_se 46958936dc chore: doc 2026-10-05 20:14:24 +04:00
Amiram_se fbb3a59677 feat(apps): login and registration pages in bull and bear
Add /auth/login, /auth/login/verify and /auth/register (type, phone, verify,
details) to both apps, with each group's loading skeleton. bull renders the
mobile top bar and column; bear the desktop header and centred card. Each
page renders its frame on the server and its step only in the browser behind
GuestGuard, with noindex metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:06:42 +04:00
Amiram_se 64048e8224 fix(apps): render every request fresh in both root layouts
Declare `dynamic = 'force-dynamic'` in the bull and bear root layouts, so no
page is prerendered or cached on the server, as the no-server-cache rule asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:06:42 +04:00
Amiram_se 86944adb97 feat(island,apps): serve fonts and icon sprite under fixed names
Replace the hashing asset plugin with two build-time plugins that never
rename their files, so an unchanged font or sprite stays in every
visitor's cache across deploys (0011, 0012):

- icon-sprite-plugin builds icons/*.svg with svgo into
  public/icons/symbol-defs.svg. The Icon atom links it as
  symbol-defs.svg?v=<ICON_SPRITE_VERSION>; the file's first line stamps
  its version, so dev warns when the sprite changes without a bump.
- font-copy-plugin copies island fonts/ byte for byte into public/fonts/
  and warns when a font changes under its old name.
- island fonts.css declares both Yekan Bakh faces with root paths and a
  fallback face; theme.css points font-sans and font-latin at them.
- Root layouts preload CRITICAL_FONT_URL. next/font is gone.
- Both apps serve /fonts and /icons as immutable.
- island env, the apps' island-env bootstrap, NEXT_PUBLIC_ISLAND_* and
  NEXT_PUBLIC_CDN_ORIGIN are removed; paths live in island constants.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:00:46 +04:00
Amiram_se dc229a3949 refactor(market,apps): share PageError from market screens
Both apps had their own copy of the page error boundary. It now lives
once in platforms/market/src/app/screens/organisms/page-error, and every
route group's error.tsx re-exports it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:00:28 +04:00
Amiram_se bbf84069c9 feat(island,apps): island asset plugin writes hashed fonts and icon sprite
Add withIslandAssets (island tools/asset-plugin) per ADR 0008. On next dev
and next build it builds the svgo sprite from src/icons and copies the
Yekan Bakh fonts into the app's public/ under content-hashed names, puts
their paths in env (NEXT_PUBLIC_ISLAND_*) and serves them with an
immutable Cache-Control. Files are written in headers(), which only Next
calls, because Nx's next plugin also evaluates the config from the
workspace root.

- island env (setEnv/getEnv); Icon reads the sprite path from it
- icon-sprite-plugin becomes icon-name-extraction (IconName type only);
  the committed sprite.svg is removed
- bull and bear register the plugin, validate the paths, pass them to
  island through their bootstraps, and add an optional CDN origin for fonts
- gitignore the generated files; Nx build outputs include them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 11:58:56 +04:00
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 c251633246 feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
  site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
  mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
  every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 21:33:07 +04:00
Amiram_se 2a3df2fcd8 chore(deps): upgrade Next.js to 16.3 and add the front-end stack packages
- next ~16.3.8 (catchError and retry for error boundaries are stable from 16.3)
- i18next, react-i18next, react-hook-form, @hookform/resolvers, zustand, immer,
  @tanstack/react-query
- bull runs on port 3001 and bear on 3002 in dev and start

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