Overview
d-sports-engage-native (package nameengage-native, version 1.10.5) is the native mobile and web app for D-Sports. It mirrors the core PWA experience on iOS, Android, and web with wallet, shop, leaderboard, locker room, and profile screens.
Ecosystem overview
See how the native app fits with the PWA, site, and Mic’d Up.
Tech stack
| Category | Technology |
|---|---|
| Framework | Expo 54, React Native 0.81, React 19 |
| Language | TypeScript 5.9 |
| Routing | Expo Router 6 (file-based, typed routes) |
| Auth | Clerk (@clerk/clerk-expo) |
| Payments | RevenueCat (react-native-purchases) — Apple IAP, Google Play, Stripe (web) |
| Web3 | Thirdweb SDK — on-chain crypto checkout |
| State | Zustand 5 with MMKV persistence |
| Storage | MMKV (react-native-mmkv) |
| Icons | Lucide React Native |
| Animations | React Native Reanimated 4 |
| Monitoring | Sentry (@sentry/react-native) |
| Package manager | Bun 1.3 |
Getting started
Configure environment variables
Copy the
.env file and fill in values for your environment. Only EXPO_PUBLIC_* keys are accessible at runtime.| Variable | Purpose |
|---|---|
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk authentication publishable key |
EXPO_PUBLIC_API_URL | D-Sports API backend URL (e.g. https://api.d-sports.org) |
EXPO_PUBLIC_TW_CLIENT_ID | Thirdweb client ID for web3 |
EXPO_PUBLIC_REVENUECAT_API_KEY | RevenueCat API key |
EXPO_PUBLIC_REVENUECAT_APPSTORE_ID | RevenueCat App Store app ID |
EXPO_PUBLIC_REVENUECAT_ENTITLEMENT | RevenueCat entitlement identifier (e.g. premium) |
EXPO_PUBLIC_SUPABASE_URL | Supabase project URL |
EXPO_PUBLIC_SUPABASE_KEY | Supabase publishable (anon) key |
Project structure
Architecture
Modular screen pattern
Screen files inapp/(tabs)/ contain only imports and JSX. All state, effects, and handlers live in dedicated hooks:
hooks/use-wallet-screen.ts— wallet/token fetch, PIN verification, transaction handlershooks/use-shop-screen.ts— cart state, product queries, carousel auto-scroll, checkout
components/wallet/ and components/shop/ with barrel exports via index.ts. Styles live in co-located styles/ directories, never inline.
API client layer
The API client inlib/api/client.ts provides authenticated requests using Clerk tokens with normalized { success, data?, error?, code? } response envelopes.
You access all API modules via the useApi() hook:
user, quests, leaderboard, wallet, lockerRoom, teams, collectibles, shop, checkout.
The client includes an MMKV-backed cache layer (lib/api/cache.ts) for offline-first data fetching.
State management
- Zustand (
services/store.ts) — global store for theme, cart, and points with synchronous MMKV persistence - React Context —
UserContextfor auth and profile,CollectiblesContextfor owned items,NavBarVisibilityContextfor scroll-based navbar,CreateActionContextfor FAB state - MMKV (
services/storage.ts) — synchronous key-value storage viagetItem<T>(),setItem(),removeItem()
Checkout and payments
The app supports two payment paths:- Fiat — RevenueCat handles Apple IAP (native), Google Play (native), and Stripe (web) via
lib/revenuecat/provider.tsx - Crypto — Thirdweb SDK signs on-chain transactions calling the PWA backend (
POST /api/checkout/cryptoandPOST /api/checkout/crypto/verify). Supported chains: Arbitrum (default), Ethereum, Polygon.
Routing
Expo Router provides file-based routing with route groups:(tabs)— main tab navigation with animated pill tab bar(auth)— login, sign-up, SSO callback, password reset(onboarding)— new user flow
_layout.tsx automatically redirects based on authentication and onboarding state.
Web optimization
The app is PWA-ready withdisplay: "standalone" and includes:
- Responsive desktop layout (
maxWidth: 480px) viaAppScreenwrapper - Web hover states on interactive components
- Keyboard navigation support
accessibilityRoleandaccessibilityLabelon key elements
EAS build profiles
| Profile | Distribution | Channel | Notes |
|---|---|---|---|
development | Internal | development | Dev client, iOS simulator enabled |
development-device | Internal | development | Dev client, physical devices |
preview | Internal | preview | APK for Android |
staging | Default | staging | Auto-increment version |
production | Default | production | Auto-increment version |
Features
- Wallet — token balances, holdings, pack opening, crypto checkout
- Shop — collectibles, cart, coin bundles, featured packs, crypto and fiat checkout
- Leaderboard — rankings with filters and modals
- Locker room — social feed, daily pick’em, spin wheel, guess the player, quests
- Profile — user profile, settings, team membership
- Theme — dark/light mode (default dark), gold accent (
#F5C842)
Path aliases
Use@/* to import from the project root:
