Skip to main content

Overview

d-sports-engage-native (package name: engage-native) 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)

Getting started

  1. Clone the repository and run bun install.
  2. Configure environment (Clerk, RevenueCat, Thirdweb, API base URL) per repo README.
  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.

API client

The native app communicates with d-sports-api through a typed client layer in lib/api/. The useApi() hook exposes domain-specific modules (wallet, shop, user, quests, leaderboard, locker room, teams, collectibles, checkout) with automatic Clerk token injection.

Strict envelope mode

The API client (lib/api/client.ts) operates in strict envelope mode. Every successful API response must conform to the normalized envelope:
{
  "success": true,
  "data": { ... }
}
Error responses follow the same shape:
{
  "success": false,
  "error": "Human-readable message",
  "code": "MACHINE_READABLE_CODE"
}
If a response does not include a top-level success field, the client rejects it with an INVALID_RESPONSE_ENVELOPE error code. There is no fallback parsing for legacy response shapes.
All backend routes consumed by the native app must return the { success, data?, error?, code? } envelope. Routes that return raw objects or arrays will cause client-side failures.

API modules

ModuleImportCovers
UsercreateUserApiProfile, preferences, team membership
WalletcreateWalletApiTokens, holdings, transactions
ShopcreateShopApiProducts, collectibles
CheckoutcreateCheckoutApiCrypto and fiat checkout flows
QuestscreateQuestsApiDaily quests and rewards
LeaderboardcreateLeaderboardApiRankings and filters
Locker roomcreateLockerRoomApiSocial feed and posts
TeamscreateTeamsApiTeam data and membership
CollectiblescreateCollectiblesApiOwned packs and items

Environment variables

The app uses EXPO_PUBLIC_* variables accessible at runtime:
VariablePurpose
EXPO_PUBLIC_API_URLBackend API base URL (defaults to https://api.d-sports.org)
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEYClerk authentication
EXPO_PUBLIC_TW_CLIENT_IDThirdweb Web3 client
EXPO_PUBLIC_REVENUECAT_API_KEYRevenueCat in-app purchases
EXPO_PUBLIC_SUPABASE_URLSupabase client URL
EXPO_PUBLIC_SUPABASE_KEYSupabase publishable key

Ecosystem overview

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