Skip to main content

Overview

d-sports-engage-native (package name: engage-native, current version v1.10.5) is the native mobile app for D-Sports. It mirrors the core PWA experience on iOS and Android: wallet, shop, leaderboard, locker room, and profile.
  • Run: bunx expo start or bun run start — then press a for Android or i for iOS, or scan the QR code with Expo Go.

Tech stack

CategoryTechnology
FrameworkExpo 54, React Native 0.81, React 19
AuthClerk (Expo)
PaymentsRevenueCat (react-native-purchases)
Web3Thirdweb
StateZustand
StorageMMKV
UILucide React Native
NavigationExpo Router
PackageBun

Features

  • Wallet — Tokens, holdings, pack opening, crypto checkout (via PWA backend)
  • Shop — Collectibles, cart, coin bundles, checkout
  • Leaderboard — Rankings and filters
  • Locker room — Social feed and engagement
  • Profile — User profile and settings
  • Theme — Dark/light mode (default dark)

API client layer

The native app communicates with d-sports-api through a typed client in lib/api/. All responses follow a normalized envelope:
interface ApiResponse<T> {
  success: boolean;
  data?: T;
  error?: string;
  code?: string;
}
Domain-specific modules are organized by feature area:
ModuleKey endpoints
teams-api.tsGET /api/teams, POST/DELETE/GET /api/teams/[id]/follow, GET /api/teams/followed
shop-api.tsGET /api/products, GET /api/products/[id]
collectibles-api.tsGET /api/packs, POST /api/packs/[id]/purchase, POST /api/packs/[id]/open
checkout-api.tsPOST /api/checkout/crypto, POST /api/checkout/crypto/verify
wallet-api.tsWallet balances, transactions, holdings
user-api.tsProfile, onboarding, username checks
quests-api.tsQuest progress, daily visit, rewards
leaderboard-api.tsRankings, filters, season data
locker-room-api.tsSocial feed, posts, fan interactions
The client in lib/api/client.ts auto-injects Clerk auth tokens and resolves the API base URL from the EXPO_PUBLIC_API_URL environment variable (falls back to https://api.d-sports.org).

API normalization status (Phase 2)

The native app is undergoing a phased API contract normalization to ensure every backend route uses the standard { success, data } / { success: false, error, code? } envelope and shared response helpers (apiSuccess, apiError, apiUnauthorized, apiNotFound).
BatchStatusRoutes
StarterCompletePOST /api/auth/native-token, POST /api/auth/validate, GET/PATCH /api/user, GET /api/user/check-username, GET/POST /api/user/onboarding
ACompleteRemaining app/api/user/* routes
BCompletePOST /api/quests/check-progress, POST /api/quests/daily-visit, POST /api/rewards/redeem, GET/POST /api/dashboard, GET /api/dashboard/quests, GET /api/dashboard/balance, GET /api/dashboard/stats, GET /api/admin/stats
CComplete (verification pending)GET /api/teams, GET /api/teams/followed, POST/DELETE/GET /api/teams/[id]/follow, GET /api/products, GET /api/packs, GET /api/packs/[id], POST /api/packs/[id]/open, POST/PUT /api/packs/[id]/purchase, POST /api/checkout/crypto, POST /api/checkout/crypto/verify, POST /api/checkout/dsports-cash, POST /api/webhooks/revenuecat
During migration, client.ts supports both normalized and legacy response shapes. Once all batches are verified, fallback compatibility parsing will be removed and only envelope responses will be accepted.

Environment variables

VariablePurpose
EXPO_PUBLIC_API_URLBackend API base URL (defaults to https://api.d-sports.org)
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEYClerk authentication key
EXPO_PUBLIC_REVENUECAT_APPLE_KEYRevenueCat Apple API key
EXPO_PUBLIC_REVENUECAT_GOOGLE_KEYRevenueCat Google API key
EXPO_PUBLIC_THIRDWEB_CLIENT_IDThirdweb client ID for Web3
SENTRY_DSNSentry error tracking DSN

Getting started

  1. Clone the repository and run bun install.
  2. Copy .env.example to .env and fill in the required keys (Clerk, RevenueCat, Thirdweb, API base URL).
  3. Run bunx expo start.
  4. For development builds: bun run build:dev (EAS) or run with Expo dev client.
The app targets both native and web (responsive) and uses the same backend (d-sports-api) as the PWA for API and checkout flows.

Ecosystem overview

See how the native app fits with the PWA, site, and Mic’d Up.