Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 75 additions & 7 deletions repositories/d-sports-engage-native.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
---
title: "d-sports-engage-native"
description: "Native iOS and Android app for D-Sports Engage. Expo 54, React Native, Clerk, RevenueCat, Thirdweb."

Check warning on line 3 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L3

Did you really mean 'Thirdweb'?
icon: "smartphone"
---

## 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.

Check warning on line 9 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L9

Did you really mean 'leaderboard'?

- **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.
## Getting started

```bash
# Install dependencies
bun install

# Start development server
bunx expo start
# Press 'a' for Android, 'i' for iOS, or scan QR with Expo Go

# TypeScript check
bun tsc --noEmit
```

## Tech stack

Expand All @@ -17,31 +29,87 @@
| Framework | Expo 54, React Native 0.81, React 19 |
| Auth | Clerk (Expo) |
| Payments | RevenueCat (react-native-purchases) |
| Web3 | Thirdweb |

Check warning on line 32 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L32

Did you really mean 'Thirdweb'?
| State | Zustand |

Check warning on line 33 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L33

Did you really mean 'Zustand'?
| Storage | MMKV |
| UI | Lucide React Native |

Check warning on line 35 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L35

Did you really mean 'Lucide'?
| Navigation | Expo Router |
| Package | Bun |

## Project structure

```tree
app/
├── (auth)/ # Login/signup screens
├── (onboarding)/ # New user onboarding flow
├── (tabs)/ # Main tab navigation
│ ├── wallet.tsx # Wallet screen (JSX only — logic in hook)
│ ├── shop.tsx # Shop screen (JSX only — logic in hook)
│ ├── leaderboard.tsx # Leaderboard screen
│ ├── locker-room.tsx # Social feed
│ └── profile.tsx # User profile
├── settings/ # Settings pages with nested modals/tabs
└── _layout.tsx # Root layout with providers + auth protection

components/
├── wallet/ # Wallet sub-components (TokenRow, ActionModal, etc.)
├── shop/ # Shop sub-components (CartModal, CryptoCheckoutModal, etc.)
├── locker-room/ # Locker room components
├── layout/ # AppScreen wrapper (responsive web max-width)
├── ui/ # Reusable UI primitives (Button, TextField, etc.)
└── Icon/ # Icon wrapper using lucide-react-native

hooks/
├── use-wallet-screen.ts # All wallet state, effects, and handlers
├── use-shop-screen.ts # All shop state, effects, and handlers
└── useScrollHandler.ts # Scroll-based navbar visibility

lib/
├── api/ # API client modules (wallet, shop, user, checkout, etc.)
├── revenuecat/ # RevenueCat in-app purchases provider
└── utils.ts # Shared utilities

context/
├── user-context.tsx # Authentication, user profile, team membership
├── collectibles-context.tsx # Owned packs and items
└── navbar-visibility-context.tsx
```

## Features

- **Wallet** — Tokens, holdings, pack opening, crypto checkout (via PWA backend)

Check warning on line 80 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L80

Did you really mean 'crypto'?
- **Shop** — Collectibles, cart, coin bundles, checkout
- **Leaderboard** — Rankings and filters

Check warning on line 82 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L82

Did you really mean 'Leaderboard'?
- **Locker room** — Social feed and engagement
- **Profile** — User profile and settings
- **Theme** — Dark/light mode (default dark)

## Getting started
## Architecture patterns

- **File-based routing** via Expo Router with route groups `(tabs)`, `(auth)`, `(onboarding)`
- **Modular screen architecture** — screen files contain only JSX; all state/effects/handlers live in dedicated hooks
- **Zustand + MMKV** for global state with synchronous persistence

Check warning on line 91 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L91

Did you really mean 'Zustand'?
- **React Context** for auth, collectibles, navbar visibility

Check warning on line 92 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L92

Did you really mean 'navbar'?
- **API client layer** in `lib/api/` with MMKV cache fallback
- **Crypto checkout** via Thirdweb SDK calling PWA backend for on-chain payments

Check warning on line 94 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L94

Did you really mean 'Crypto'?

Check warning on line 94 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L94

Did you really mean 'Thirdweb'?
- **PWA-ready** — `display: standalone`, responsive desktop layout, web hover states

## Checkout and payments

| Method | Provider | Platform |
| ------ | -------- | -------- |
| Fiat | RevenueCat | Apple IAP (native), Google Play (native), Stripe (web) |
| Crypto | Thirdweb | Arbitrum (default), Ethereum, Polygon |

Check warning on line 102 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L102

Did you really mean 'Crypto'?

Check warning on line 102 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L102

Did you really mean 'Thirdweb'?

Check warning on line 102 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L102

Did you really mean 'Arbitrum'?

Check warning on line 102 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L102

Did you really mean 'Ethereum'?

The crypto checkout flow calls the PWA backend at `POST /api/checkout/crypto` and `POST /api/checkout/crypto/verify`.

Check warning on line 104 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L104

Did you really mean 'crypto'?

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.
## Branding

The app targets both native and web (responsive) and uses the same backend (d-sports-api) as the PWA for API and checkout flows.
- **Base background (dark):** `#0a0e1a`
- **Accent gold:** `#F5C842` / `#FFD700`
- **Primary blue:** `#4169E1`
- Default theme is dark mode

<Card title="Ecosystem overview" icon="map" href="/repositories/ecosystem-overview">
See how the native app fits with the PWA, site, and Mic'd Up.

Check warning on line 114 in repositories/d-sports-engage-native.mdx

View check run for this annotation

Mintlify / Mintlify Validation (chronoscyberchronicles) - vale-spellcheck

repositories/d-sports-engage-native.mdx#L114

Did you really mean 'Mic'd'?
</Card>