wealth/docs/decisions/README.md

25 lines
2.7 KiB
Markdown
Raw Normal View History

2026-10-04 18:03:42 +00:00
# Decisions
## Design (DDR)
2026-10-04 18:03:42 +00:00
- 0002 Render every tag through island `Element`, flex layouts through `FlexBox`, grid layouts through `GridBox`; never native JSX tags or `flex`/`grid` classes, island included.
- 0011 Serve Yekan Bakh FaNum (`font-sans`, all UI text) and Yekan Bakh (`font-latin`, شبا and bank codes only) from `public/fonts/` under fixed names declared in island `fonts.css`; no version, never hashed, never `next/font`; a changed font gets a new name.
- 0019 Close every toast by itself: success and info after 4 s (6 with an action), errors after 8 s (10 with an action); hovering or a hidden tab pauses it; never `duration: Infinity`.
2026-10-04 18:03:42 +00:00
## Architecture (ADR)
2026-10-04 18:03:42 +00:00
- 0001 Share one platform, `platforms/market`, between `apps/bull` and `apps/bear`; tag all three `scope:market`.
- 0012 Wrap each app's `next.config` in island's `withIconSprite` and `withFontCopy`; they write `symbol-defs.svg` and the fonts into `public/` unhashed, served immutable; link the sprite as `?v=<ICON_SPRITE_VERSION>`.
- 0013 Render every `(auth)` page's steps only in the browser behind `GuestGuard`: the server sends the frame, a same-size skeleton and `noindex`; flow state stays in memory, never in the URL or storage.
- 0018 Call the API from the browser only on the app's own origin under `/api`, rewritten by `next.config.ts` to `API_INTERNAL_ORIGIN`; media URLs use the same path, and the server render calls the gateway directly.
2026-10-04 18:03:42 +00:00
## Proposed
2026-10-04 18:03:42 +00:00
- 0003 design: Only semantic tokens, named as in the Lumina Design System, produce Tailwind utilities (`@theme inline`); primitives stay plain `:root` variables and Tailwind's defaults are removed.
- 0005 design: Island holds Lumina's product components and status-to-tone map; they take every text as props (`children` or `labels`) and never import i18next or platform code.
- 0006 architecture: Make every non-app project a pnpm workspace package `@lumina/<name>` with subpath `exports`; third-party dependencies stay in the root package.json.
- 0014 architecture: Serve registration step 5 under `(onboarding)` behind `AuthGuard`; a creator's profile autosaves as a server draft (`PATCH`) and completes only through `POST …/profile/complete`.
- 0015 architecture: Serve a login or onboarding view whose frame differs from its step on its own route (`/auth/login/suspended`, `/onboarding/creator-profile/done`); browser-only data stays in memory.
- 0016 architecture: Keep a creator who hasn't finished step 5 out of publishing and pricing through the session's `needsProfile`, with `OnboardingGuard` in those routes' layouts and `GuestGuard`.
- 0017 architecture: Give every auth and onboarding route its own `loading.tsx` matching its frame; an index route with nested steps sits in its own route group.