menuyukti-mobile

DEPRECATED / inactive Expo React Native app (apps/mobile-app). Kept in the repo but not an active product track — prefer the web customer PWA in apps/web. Use this skill only when maintaining legacy C

SKILL.md

GitHub

Menuyukti: apps/mobile-app (deprecated)

Status: Deprecated / inactive. Customer focus is the web PWA (apps/web customer shell + Serwist). Keep this app in the monorepo for now; do not expand it as the primary customer path. Prefer menuyukti-web for new customer work.

Expo (React Native) CRM client (legacy): enroll via CRM token, then Home / Rewards / Profile. Product data goes through the Next.js mobile BFF (proxies private GraphQL). CRM enroll: POST /api/mobile/crm/v1/enroll on the web app.

For monorepo boundaries, see menuyukti-repo-orientation.

Companion skills

When implementing in apps/mobile-app, follow these skills in addition to this doc.

Feature work (default)

Upgrades, shipping, and performance

Do not restructure this app to match Expo Router “new project” layouts. Prefer React Navigation skills over Expo Router unless migrating intentionally.

Layout (high level)

Concern Typical locations
Entry App.tsx, index.ts
Navigation navigation/RootNavigator.tsx, MainTabs.tsx
Screens screens/ — EnrollScreen, HomeScreen, RewardsScreen, ProfileScreen
UI primitives components/ — Screen, Button, TextField, cards
Theme / brand theme/tokens.ts, BrandContext.tsx, SessionContext.tsx
CRM enroll + session lib/enroll.ts, lib/keys.ts, sessionStorage.ts, sessionCodec.ts, secureStorage.ts
CRM auth / API lib/crmAuth.ts, crmClient.ts, accessToken.ts, tokenStorage.ts, signNonce.ts
Cashback lib/cashback.ts — authenticated CRM reads via crmFetch
Mock / demo data data/mockRestaurant.ts
Expo config app.json, package.json

Commands: apps/mobile-app/package.json scripts (pnpm --filter mobile-app …).

Boundaries

  • No database drivers or migrations in the mobile app — call GraphQL / CRM HTTP only.
  • Prefer pnpm (pnpm --filter mobile-app … from repo root, or scripts inside apps/mobile-app).
  • Secrets: use EXPO_PUBLIC_* only for non-secret public config (e.g. EXPO_PUBLIC_CRM_API_URL). Device private keys stay in SecureStore (native) or localStorage (web demo) via lib/keys.ts — never log or ship private key material.
  • CRM enroll backend lives in apps/graphql (crm_auth/, /crm/v1/enroll) — see menuyukti-graphql.

Session and navigation

  1. SessionProvider hydrates session (customerId, deviceId, optional appId) and profile from SecureStore; exposes isHydrated so the navigator does not flash enroll.
  2. RootNavigator: native stack with Enroll | Main (tabs), gated by hydrated session. Deep links use scheme menuyukti (menuyukti://enroll?token=…&app=…).
  3. Enroll flow: parse token / deep link → ensureDeviceKeypair() → enrollDevice() → persist session → tabs.
  4. resetSession clears SecureStore session, profile, and device key.

Brand theming uses BrandProvider + Warm Editorial tokens in theme/tokens.ts (aligned with web/UI brand colors). Override via brand prop for white-label builds.

Networking

  • Public BFF base: EXPO_PUBLIC_CRM_API_URL (default http://localhost:3000).
  • Enroll: POST /api/mobile/crm/v1/enroll (lib/enroll.ts).
  • Authenticated CRM: crmFetch (lib/crmClient.ts) → /api/mobile/crm/v1/* with device access token from crmAuth / accessToken (refresh token in SecureStore via tokenStorage).
  • Example product read: cashback via lib/cashback.ts (GET .../me/cashback).
  • Quality: pnpm lint (ESLint / eslint-config-expo), pnpm check-types, pnpm test, pnpm check:expo (expo-doctor), pnpm format-check.
  • Keep new client code under lib/ and follow expo-data-fetching.

Related

Topic Skill
CRM / enroll API menuyukti-graphql
Monorepo map menuyukti-repo-orientation
Web counterpart menuyukti-web

Canonical docs

  • Expo docs matching the app’s SDK (see apps/mobile-app/package.json expo version)

Progressive disclosure

Split long screen or API maps into reference.md in this folder if this file grows.