Skip to main content

Settings Live

Account, preferences, notifications, feedback, and external links (About KA26 → ka-26.com).

1. Overview

Single-page list with grouped cards: Account (Edit Profile, QR), Language (multi-language toggle), Notifications (enable / status), Feedback (form), About KA26 (external link to landing site), Logout.

2. User journey

  1. Profile → Settings cog (or directly via /settings)
  2. Tap any card to navigate
  3. Logout shows a confirmation dialog

3. Web ↔ Mobile parity

CapabilityWebMobile
Edit Profile✅ links to Profile section
QR Code
Language picker (6 languages)
Notifications toggle✅ enable button (web push)✅ enable button (Expo push)
Feedback form✅ inline✅ separate screen feedback.tsx
About KA26 → ka-26.com✅ uses Linking.openURL
Logout

4. Key components

  • Web: src/app/(consumer)/settings/page.tsx (~520 lines, 3 views: main, language, feedback)
  • Mobile: mobile/app/settings.tsx, mobile/app/feedback.tsx, mobile/app/language.tsx, mobile/app/edit-profile.tsx, mobile/app/my-qr.tsx

5. APIs

EndpointMethodPurpose
/api/auth/consumer-profilePUTUpdate language, photo, etc.
/api/feedbackPOSTSubmit feedback (sends email to admin via Email Infra)
/api/auth/logoutPOSTClear server session (consumer is mostly client-side though)

6. Database touchpoints

  • Consumer.language — preferred display language
  • Feedback — feedback submissions (type: bug/feature/general, page, description, expected, screenshot)
  • PushSubscription — saved web/Expo push tokens

7. Business logic

  • PWA permission flow: never auto-request notification permission (breaks iOS). Settings provides the explicit "Enable Notifications" button.
  • Feedback PAGE_OPTIONS: Reels, Profile, Orders, Requests, Shop, Product Page, Settings, Notifications, Other. (Eats removed 2026-04-17.)
  • Description max 5000 chars (MAX_DESCRIPTION constant in settings).
  • Feedback emails: subject [KA26 <type>] <page> — <userName>, sent via central email lib with replyTo: feedback.userEmail so admin can reply directly.

8. Feature flags / env vars

  • EMAIL_ADMIN_ADDRESS — where feedback emails go (default siddugkattimani@gmail.com)

9. Tests

  • tests/email-infrastructure.test.ts — feedback email path
  • mobile/tests/mobile-code-integrity.test.ts — feedback PAGE_OPTIONS, settings nav

10. Known gotchas

  • About KA26 link uses Linking.openURL on mobile (opens external browser). Don't change to in-app webview without considering the auth implications.
  • Language change re-renders the whole tree via LanguageContext. Heavy on first switch.
  • Logout clears localStorage (web) / SecureStore (mobile) but doesn't invalidate server-side JWT — JWTs are stateless, just expire on their own (7d for seller, 30d for delivery, indefinite for consumer).