Files
ngqileandClaude Opus 5.5 5ee51d1913 chore: copy kept Tastefully modules and portals into Co-Lite
Backend modules from tastefully 8bd93d15: core-libs, core-session,
api-gateway, mobile-api, services-auth, services-system,
services-counter, services-member, services-log, services-email.
solvway-admin-portal from babyboo f64d096ea, solvway-customer-portal
from tastefully 8bd93d15. Copied as tracked files only.

Literal secrets replaced with environment placeholders:
- services-email: SMTP_PASSWORD, MAILGUN_API_KEY, SENDGRID_API_KEY,
  MAILJET_API_KEY, MAILJET_SECRET_KEY (optional, empty default)
- services-system: JUMIO_TOKEN, JUMIO_SECRET (optional)
- services-auth: USER_AUTH_API_SECRET (required); commented JWT secret removed
- core-libs: JWT_TOKEN default removed (required), XXL_JOB_TOKEN default
  removed, ipgeolocation key read from IPGEOLOCATION_API_KEY
- services-system EkycAppConfig: commented Jumio credentials removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 15:55:45 +08:00

23 KiB
Raw Permalink Blame History

design.md — Solvway Customer Portal (Tastefully Events)

Live design log for solvway-customer-portal/ only. Nothing here applies to other apps in the monorepo. Update this file in the same session as any component, token or style change.

  • Stack: Next.js (App Router), Tailwind CSS 3, Framer Motion, lucide-react icons, Geist font
  • Project type: conversion-focused member app (mobile-first PWA) — soft rounding, spacious, one orange accent
  • Source of truth for tokens: app/globals.css (CSS variables) and tailwind.config.ts

1. Brand assets

Asset Value Notes
Primary brand orange #FF6B00 Fills, icons, glows. Not for small text on light surfaces (2.9:1)
Orange for text --orange-text → #B84700 light / #FF6B00 dark 5.3:1 on white, 6.1:1 on #1a1a1a. Tailwind: text-tastefullyOrangeText
Dark / ink #1a1a1a Body text (light) and app background (dark). No pure black
Accent purple #290a81 Gradients and poster tiles only. Never as text on dark (1.2:1)
Logo TastefullyLogo.tsx Wordmark + chef mark; chef mark reused in MemberAvatar
Font Geist (--font-geist-sans) via next/font/google Fallback system-ui, sans-serif. Twemoji Country Flags is prepended for Windows flag emoji
Theme colour (PWA) #FF6B00 viewport.themeColor in layout.tsx
App name "Tastefully Events" (iOS home-screen title "TastefullyXP") metadata in layout.tsx

2. Colour tokens

2.1 CSS variables (:root = light, .dark = dark)

Token Light Dark Used for
--bg-primary #fafafa #1a1a1a Page background
--bg-backdrop #E5DFDA #101010 Desktop backdrop outside the frame
--bg-card #FFFFFF rgba(255,255,255,0.06) Cards
--bg-card-alt #FAF7F4 rgba(255,255,255,0.03) Secondary card / inset
--text-primary #1a1a1a #FFFFFF Headings, body
--text-secondary #5C5C5C (6.7:1) rgba(255,255,255,0.8) (≈10:1) Supporting text
--text-muted #6B6B6B (5.3:1) rgba(255,255,255,0.6) (6.3:1) Labels, dates, counts
--border-color rgba(0,0,0,0.07) rgba(255,255,255,0.08) Hairlines
--shadow-card 0 2px 20px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.04) 0 8px 32px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06) .surface-card
--nav-bg / --nav-border white 92% / rgba(0,0,0,.07) rgba(10,10,10,.95) / rgba(255,255,255,.06) Header / bottom nav
--tastefully-orange #FF6B00 same Brand orange
--tastefully-dark #1a1a1a same
--tastefully-accent #290a81 same
--orange-text #B84700 #FF6B00 Orange used as text
--option-bg / --option-text #FFF / #1a1a1a #1a1a1a / #FFF Native <select> popups (must be solid)

2.2 Tailwind colours (tailwind.config.ts)

tastefullyOrange #FF6B00 · tastefullyOrangeText var(--orange-text) · tastefullyDark #1a1a1a · tastefullyAccent #290a81

2.3 Per-page theme objects (duplicated)

Most pages build a local t = { bg, card, textSec, textMuted, … } from isDark rather than reading the CSS variables. The text values were kept identical to the variables above (muted #6B6B6B/0.6, secondary #5C5C5C/0.8). Tech debt: consolidate these into one hook reading the CSS variables so a token change is a one-line edit. Files: page.tsx, store/*, attendance, settings/*, goodie-bag, floorplan, stage, events, draw, checkin, vouchers/[uuid], ui/ImageGallery, ui/EventGallerySection.

2.4 Status & semantic colours (hard-coded in components)

Purpose Colour(s)
Success / checked-in / earned #22c55e (19×), #16a34a, #10b981, #34d399
Error / destructive #ef4444, #f87171, #d92d20
Warning / pending #f59e0b, #d97706, #ffb03a
Info #3b82f6, #0369a1
Brand tints rgba(255,107,0,0.10–0.15) fills, rgba(255,107,0,0.25–0.4) borders
Third-party brand (share/contact channels) #25d366 WhatsApp, #1877f2 Facebook, #e1306c Instagram, #006aff
Gradients Orange CTA #C94D00 → #A83F00; poster tiles #290a81 → #6d28d9, #FF6B00 → #290a81, #FF6B00 → #ff9e4d

Why the CTA gradient is #C94D00 → #A83F00: white text on brand #FF6B00 is only 2.9:1. #C94D00 is 4.6:1, so white labels pass AA. Decorative tiles that carry no text keep the original brand gradient.


3. Typography

Family: Geist. Scale is rem-based so it follows the device/root font size (see §9).

Class Size Line-height Typical use
text-xs 14px (0.875rem) 20px Floor. Eyebrows, captions, chips, nav labels, dates
text-sm 16px (1rem) 24px Body, inputs, list rows
text-base 18px 28px Emphasised body
text-lg 20px 28px Card titles
text-xl 22px 30px Section titles, stat values
text-2xl 26px 32px
text-3xl 32px 36px
text-4xl 38px 40px Page <h1> (e.g. "Rewards", "Attendance")

Weights in use: medium 500 · semibold 600 · bold 700 · extrabold 800 · black 900 (eyebrow labels, page titles). Eyebrows: text-xs font-black tracking-[0.2em] uppercase in --orange-text. Rule: no text-[Npx] arbitrary sizes. If a new size is needed, add it to the scale in tailwind.config.ts (in rem).

Previously the app used text-[9px]/[10px]/[11px]/[12px] (≈85 places) and text-xs = 12px. These were all lifted to the 14px floor on 2026-11-06.


4. Spacing, radius, depth

  • Spacing: Tailwind default 4px scale (rem-based). Pages use px-4/pt-4–pt-6, card padding p-4–p-5, gap-2–gap-4.
  • Radius (one scale, soft rounding): rounded-2xl 16px (66×, cards) · rounded-xl 12px (63×, inputs/buttons) · rounded-full (24×, pills/avatars) · rounded-3xl 24px (8×, modals/hero) · rounded-lg 8px (5×) · .surface-card = 1.25rem.
  • Shadows: var(--shadow-card) for cards; orange glow shadows on primary CTAs (0 8px 24px rgba(255,107,0,0.35) family); Tailwind shadow-glow-orange, shadow-glow-accent, shadow-glass.
  • Layout shell: PhoneFrame — full-bleed <768px, fluid 768–1279px, centred max-w-5xl ≥1280px. Height uses .h-screen-safe (100dvh).
  • Safe areas: viewportFit: cover + env(safe-area-inset-bottom) on the bottom nav.

5. Motion

Library: Framer Motion (component/state-driven) + a few CSS keyframes. Reduced-motion is respected only in HomePromoCarousel (pauses auto-advance/video). Gap: AnnouncementMarquee (continuous scroll), AuthShell floating food emoji, GlowOverlay and SpinWheel do not check prefers-reduced-motion.

CSS keyframes (globals.css): shimmer, pulseGlow, float, scanline, stripeMove, colorWave, teMarquee. Tailwind animations: pulse-glow (3s), float (6s), shimmer (2.5s).


6. Component inventory

6.1 Global CSS utilities (globals.css)

Class Purpose
.surface-card Theme-aware card (bg, border, --shadow-card, radius 1.25rem) — home page
.glass-card / -orange / -accent Dark glass cards with blur + coloured glow (feed/check-in/store/draw)
.glow-text-orange / -accent Text glow (archived SpinWheel)
.shimmer-bg Skeleton/shine sweep
.stripe-animate Diagonal orange stripes background
.te-marquee, .te-marquee-track Announcement ticker (pauses on hover/press)
.h-screen-safe, .min-h-screen-safe 100vh fallback, 100dvh override
.scrollbar-hide Hide scrollbars

6.2 Shell (app/components/)

Component Purpose
PhoneFrame Responsive page frame (see §4)
AppHeader Top bar: logo on main pages, or back button + title on sub-pages (/draw, /attendance, /goodie-bag, /stage, /floorplan, plus settings/store-history pages — see EXACT_SUB_PAGES). Back and theme buttons have aria-labels ("Back", "Switch to dark/light mode"). Adding a Home-tile page? Add it to EXACT_SUB_PAGES so its header matches
BottomNav 4 tabs (Home, Events, Points, Profile) + centre check-in FAB (aria-label="Scan QR to check in"); active label uses --orange-text. Deliberately not fully rem-based so it survives large device fonts: labels scale 14px → capped at 20px (text-[length:min(0.875rem,20px)]), bar is min-h-[64px], FAB and its spacer are a fixed 64px. Verified at 100/150/200% on a 390px screen
ClientMain Scrolling <main>; adds bottom padding for the nav on every route except the auth screens (/login, /register, /register/verify, /forgot-password, /reset-password), where BottomNav is not meant to show
TastefullyLogo Brand wordmark/mark
FlagEmojiPolyfill Loads Twemoji flag font on platforms without flag emoji
ReferralCapture Reads referral code from the URL on first load

6.3 Feature components

Component Purpose
QRModal Member QR in a modal
DialCodeSelect Country dial-code picker (pinned entries first)
ProfileReminderModal "Complete your profile" dialog (presentation only)
HomeProfileReminder Opens the reminder once per session for incomplete profiles
auth/AuthShell Shared layout for login/register/reset screens with floating food emoji backdrop
ui/PasswordToggle Show/hide button for any password input. Named `Show
store/VoucherSection "Your Vouchers" list on /store. Each card is two columns: image/ticket icon on the left; title, amount, reason hint and a full-width Redeem button stacked on the right. Titles wrap (never truncated). Tapping the card or its Redeem button opens the same VoucherModal
store/VoucherModal Detail dialog for one voucher: image (or ticket on the brand gradient), full title, amount, description (hidden when empty or the same as the title) and the action. Redeem link when redeemable; when only the profile is missing, the modal itself shows the complete-profile message (UpdateProfileGetRewardsMessage) and a Complete Profile link to /settings/profile (no second popup); a disabled button carrying the reason otherwise. role="dialog", Escape/backdrop/✕ close, focus moves in and is restored. Themed from CSS variables (no isDark prop)
archive/SpinWheel Archived lucky-draw wheel (not in active routes)

6.4 UI primitives (app/components/ui/)

AnnouncementMarquee (attention styles + icons) · ComingSoonBanner · EventGallerySection · GlassCard · GlowOverlay · HomePromoCarousel (swipe, auto-advance) · ImageGallery · ImageLightbox · MemberAvatar (chef mark on orange gradient) · MemberQR · PdfReader (in-app PDF viewer, pdfjs-dist)

6.5 Providers (app/lib)

ThemeProvider (light/dark, localStorage: te-theme, toggles .dark on <html>) · MemberProvider · ToastProvider · MessagesProvider (i18n; locale from te_locale cookie → Accept-Language)

6.6 Routes

/ · /login · /register · /register/verify · /forgot-password · /reset-password · /events · /attendance · /checkin · /goodie-bag · /stage · /floorplan · /draw · /store · /store/history · /vouchers/[uuid] · /settings · /settings/profile · /settings/change-password · /settings/referral · /settings/transactions

6.7 Common patterns (not yet extracted into components)

  • Guide image first (/store): the event's "How to redeem" image sits above the Rewards hero as a full-width, natural-ratio, rounded-2xl card; tapping it (or the "How to redeem" hero button) opens ImageLightbox. The lightbox does not open by itself on entry. Hidden entirely when the event has no document
  • Two-column card (vouchers): fixed-size image left (w-20 h-20, rem so it scales), content column right (flex-col gap-2.5) with the action button under the text — never title and button in one row, so long text can wrap at any font size
  • Eyebrow + H1 page header (orange eyebrow, text-4xl font-black)
  • Primary CTA: full-width, rounded-xl, #C94D00 → #A83F00, white label, orange glow shadow
  • Soft orange chip/button: rgba(255,107,0,.12) fill, rgba(255,107,0,.3) border, --orange-text label
  • Inputs: rounded-xl px-3.5 py-3 text-sm font-medium, placeholder gray-500 / white/60 (dark)
  • Icons: lucide-react, stroke style, 16–22px

7. Accessibility status

Check Status
Text contrast ≥ 4.5:1 (primary, secondary, muted, orange text, CTA labels) ✅ after 2026-11-06 changes
Pinch-zoom enabled ✅ (was locked; regression test in layout.test.tsx)
Minimum text size 14px ✅
Follows device font size ✅ Android Chrome (native) · iOS via -apple-system-body (see §9)
<html lang> set from locale ✅
Icon-only buttons have accessible names (header back/theme, centre check-in) ✅ 2026-11-10 (TASTE-148)
Non-text contrast (icons on orange, FAB) ❌ centre FAB is white icon on a #FF6B00 → #f1c28c gradient — the pale end is well under 3:1 (seen in the 2026-11-10 screenshot). Also white on #FF6B00 ≈ 2.9:1 on some tiles
Remaining raw #FF6B00 text-ish uses ⚠️ icon arrays in page.tsx, store/history, referral (string-concatenated alpha, left as-is)
Orange-gradient tiles with light end (#ff9e4d) carrying white text ⚠️ vouchers / reward tiles / check-in hero — verify
prefers-reduced-motion across all animation ❌ only HomePromoCarousel (see §5)
Touch targets ≥ 44px, focus rings, screen-reader pass ❓ not audited
Accent purple #290a81 as text on dark ❌ must not be used

8. Known deviations from house defaults

  • Accent is orange plus a secondary purple used in gradients only (house default is one accent). Purple is decorative.
  • .glass-card* and glow-* effects are heavier than the "soft diffused shadow" default; kept for the dark-mode look.
  • Type scale is larger than Tailwind default on purpose (older members).

9. Device font-size behaviour

Every size in the app is rem, so the UI scales with the root font size.

Platform Mechanism
Android Chrome Applies the system Font size setting itself
iOS Safari / home-screen app Ignores Dynamic Type by default. globals.css sets html { font: -apple-system-body } inside @supports (font: -apple-system-body), then restores the Geist family
Everything else Unchanged (16px root)

On iOS the root becomes 17px at the default Dynamic Type setting (about 6% larger than 16px) and grows with the user's setting. Browser zoom works because maximumScale/userScalable:false were removed. Rules: use rem/Tailwind scale for text and text-bearing boxes; avoid fixed px heights on anything that contains text; test layouts at a 24px root. Exception — fixed-width rows that must fit N items across (the bottom nav): cap the text with min(<rem>, <px>) and size the chrome in px, otherwise 200% text pushes items off screen. Document any such cap here.


10. Change log

2026-11-06 — Accessibility pass (contrast, size, zoom, device font scaling)

Why: audit found muted text at 2.8:1, orange text/white-on-orange at 2.9:1, 9–12px text in ~160 places, and pinch-zoom disabled — hard for older members.

  • --text-muted light #9A9A9A → #6B6B6B; dark 0.35 → 0.6 alpha. --text-secondary dark 0.65 → 0.8. Same values updated in ~20 per-page theme objects.
  • Added --orange-text (#B84700 light / #FF6B00 dark) and Tailwind tastefullyOrangeText; replaced orange text uses (eyebrows, links, headings, nav active label).
  • Orange CTA/avatar/hero gradients #FF6B00 → #c94d00 (and 3-stop variants) → #C94D00 → #A83F00 so white labels pass AA.
  • Placeholders gray-400 → gray-500, white/35 → white/60; text-white/35|40 → /60; text-gray-400 → gray-500; BottomNav inactive colour and AnnouncementMarquee muted colour darkened.
  • New rem type scale in tailwind.config.ts (xs 14px … 4xl 38px); all text-[9–13px] → text-xs.
  • Removed maximumScale: 1 / userScalable: false from viewport; added regression test.
  • Added -apple-system-body root font (iOS Dynamic Type) and text-size-adjust: 100%.
  • Tests: MemberAvatar.test and stage/page.test updated for the new gradient/orange token.

2026-11-10 — TASTE-148: consistent sub-page headers + accessible icon buttons

Why: QA defect D-24 — Lucky Draw and Attendance showed the logo with no back arrow while Stage and Floor Plan showed back + title; icon-only buttons had no accessible names.

  • AppHeader: added /draw ("Lucky Draw"), /attendance ("Attendance") and /goodie-bag ("Welcome Gift") to EXACT_SUB_PAGES, so all Home-tile pages use back arrow + title.
  • AppHeader: aria-label="Back" on the back button; theme toggle labelled for its next action ("Switch to dark mode" / "Switch to light mode").
  • BottomNav: aria-label="Scan QR to check in" on the centre check-in button.
  • Tests added in AppHeader.test.tsx (5 sub-pages, 4 main pages, theme label) and BottomNav.test.tsx.
  • Verified in the running app (logged in as the dev test member) on /draw, /attendance, /stage, /floorplan.

2026-11-10 — /store: "How to redeem" image moved to the top

Why: the guide was only reachable via a button (and, since 2026-11-06, an automatic popup on every visit); members should see it on the page itself.

  • store/page.tsx: the event's Taste Rewards document (currentEventTasteRewards) now renders inline above the Rewards title/balance card (full width, natural ratio, reserves min-h-40 until it loads). Tapping it opens the lightbox (accessible name "Enlarge the redemption guide").
  • Reverses commit 4e89ea82 (auto-open the lightbox on every /store visit): the popup no longer opens on entry, because the image is already inline.
  • The "How to redeem" hero button is kept and still opens the lightbox; "Redeem at counter" is unchanged.
  • Tests in store/page.test.tsx updated (image above heading, no auto-open, button and image both open the lightbox, nothing rendered when there is no document).

2026-11-10 — Voucher cards: stacked layout + detail modal (branch fix-voucher-card-layout-modal)

Why: with the larger type, voucher titles were cut off in a single-row card ("Welcome gift vou…"), so members could not tell what a voucher was for.

  • VoucherSection: card is now image/icon on the left and a stacked content column on the right (title, amount, hint, then a full-width Redeem button). Title is break-words, not truncate; title and amount raised to 18px / 16px, button label to 16px.
  • New VoucherModal: tap a card for the image, full title, amount, description and the action. Handles redeemable / profile-incomplete / not-redeemable states and the missing-image and empty-description cases.
  • The image/icon tile on the card is brand-gradient #C94D00 → #A83F00 (was #FF6B00 → #ff9e4d, which failed contrast under the white ticket icon).
  • Tests: VoucherModal.test.tsx (new) and a card-layout/modal block in store/page.test.tsx.

2026-11-10 — BottomNav at large device font sizes

Why: measured at a 390px screen, 150% text made the tabs touch each other and 200% pushed "Profile" off-screen (right edge at x=502); the rem-based bar grew to ~130px.

  • Tab labels: min(0.875rem, 20px) (scales, then holds), whitespace-nowrap, unitless line-height; tabs are min-w-0.
  • Bar height h-16 → min-h-[64px]; FAB w-16 h-16 → w-[64px] h-[64px] (md: 80px) with a 64px spacer; icon inside the FAB 32px.
  • Result: bar stays 65px, labels never clip, 12–15px gap between neighbouring labels at 150–200%.

2026-11-10 — Login: "Forgot Password?" moved below the password input

Why: beside the "PASSWORD" label the link was cramped on a narrow screen and wrapped onto two lines at 150% text.

  • login/page.tsx: the label now sits alone above the field; the link is right-aligned under the input, text-sm (16px, was 14px) with vertical padding for a larger tap area.
  • Checked at 100/150/200%: one line at 100% and 150%, wraps to two only at 200%; no horizontal overflow.
  • Register also links to Forgot Password, but only as a centred link pair shown after a "phone already registered" error (text-xs, not beside a label) — not changed here. Worth bumping to text-sm for consistency if you want.

2026-11-10 — Rewards / Lucky Draw header row at large text

Why: at 150% text the wide-tracked eyebrow ("TASTE REWARDS+") and the History link fought for one row, so the eyebrow wrapped and the link was squeezed.

  • store/page.tsx and draw/page.tsx: the eyebrow row is flex-wrap with gap-x-3 gap-y-2; History is ml-auto flex-shrink-0, so it shares the row when there is room and otherwise drops to its own right-aligned line.
  • History link: icon 13px → 16px, label text-xs → text-sm (16px), padding px-3 py-2 for a larger tap area.
  • Checked on /store at 100/150/200%: one row at 100%, own line at 150%, no overlap or horizontal overflow. /draw has no tests and its History button only shows with a live event, so it was changed to match but not viewed.

2026-11-10 — Shared PasswordToggle (accessible name + real tap target)

Why: the show/hide-password eye icon had no accessible name on login, register and reset-password, and its tap target was just the ~20px icon.

  • New components/ui/PasswordToggle.tsx replaces 7 copy-pasted toggles in login, register (×2), reset-password (×2) and settings/change-password. Net −53 lines.
  • aria-label is Show|Hide <field> (kept change-password's existing wording, so its test is unchanged); the icon is aria-hidden.
  • Tap area is now the whole 44px-wide, input-height strip at the right edge (was ~20×20px); icon 16px → 20px. Verified on login: 44×51px at 100%, 66×75px at 150%; still toggles type password ↔ text.
  • The login icon swap animation is now the register-style scale (the old login one also rotated).

2026-11-10 — Voucher card and Redeem button open the same modal

Why: tapping the Redeem button on a profile-incomplete voucher opened the plain "complete your profile" popup, while tapping the card opened the voucher modal — two different behaviours and designs for one action.

  • VoucherSection: the Redeem button (profile-incomplete case) now opens the same VoucherModal as the card.
  • VoucherModal: for PROFILE_INCOMPLETE it shows the voucher design (image/icon, title, amount) plus a highlighted complete-profile message and a Complete Profile link (i18n: UpdateProfileGetRewardsMessage, CompleteProfile). The onIncompleteProfile prop is gone from both components.
  • store/page.tsx no longer renders ProfileReminderModal (still used by HomeProfileReminder on the home page).
  • Redeemable vouchers are unchanged: the card opens the modal; the card's Redeem button still goes straight to /vouchers/{uuid}.
  • Verified in the browser: card tap and Redeem tap produce identical dialog content.