GRV-MobileApp/README.md
kirukib 1ed5e9729e Add GRV Summit attendee app (Expo SDK 58)
Expo Router app for summit attendees: email OTP login, booth and investee
QR scanning (camera + manual entry, /q/<token> universal links), mystery
investee celebration, points/rank/progress home, leaderboard, raffles,
merch ordering with pickup QR, and ticket QRs. Built against the attendee,
auth and public endpoints in GRV-Backend/API.md. Theme, fonts, icon and
splash follow the GRVSummit site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 21:33:17 +03:00

95 lines
4.2 KiB
Markdown

# GRV Summit — attendee app
Expo (SDK 58, expo-router) app for GRV Summit attendees: scan booth and investee QR codes for
points, find the mystery future investee (double points), follow the leaderboard and raffles,
order merch for pickup at the GRV booth and show ticket QRs.
Backend: `../GRV-Backend` (NestJS). Contract: `GRV-Backend/API.md`. The app uses only the auth,
attendee and public (`/merch`) endpoints.
## Setup
```sh
pnpm install
cp .env.example .env # set EXPO_PUBLIC_API_URL
pnpm start # Expo dev server
```
| Env | Default | Notes |
|---|---|---|
| `EXPO_PUBLIC_API_URL` | `http://localhost:4000` | Inlined at build time. On a phone use your machine's LAN IP (`http://192.168.x.x:4000`); `localhost` is the phone itself. |
| `EAS_PROJECT_ID` | — | EAS builds only (`eas init` prints it). |
| `APPLE_TEAM_ID` | — | Needed for iOS associated domains / signing. |
Checks: `pnpm exec tsc --noEmit`, `npx expo-doctor`, `npx expo export --platform web`.
## Running
The QR scanner needs a real device camera (the web build and simulators fall back to typing the
code under the QR).
- **Expo Go**: `pnpm start`, scan the terminal QR with Expo Go (Android) or the Camera app (iOS).
Everything works except universal/app links (`https://grv.ethiopiatrustfund.org/q/...`);
test those with the dev client.
- **Dev client**: `eas build --profile development --platform ios|android`, install it, then
`pnpm start` and open the project from the dev client.
Sign-in is email + 6-digit code. In backend dev mode the code is printed to the backend console.
Attendees should use the email they bought their ticket with so their ticket QR appears under **Me**.
## EAS builds
```sh
npm i -g eas-cli
eas init # once; put the id in EAS_PROJECT_ID
eas build --profile preview --platform android # internal APK/AAB for testing
eas build --profile production --platform all # store builds
eas submit --profile production
```
Set `EXPO_PUBLIC_API_URL` (production API) in the EAS environment for each profile.
Bundle id / package: `org.ethiopiatrustfund.grvsummit`. Scheme: `grvsummit`.
## Deep links
Printed checkpoint QRs encode `https://grv.ethiopiatrustfund.org/q/<token>`. With the app
installed, the phone's camera opens the app on `src/app/q/[token].tsx`, which calls
`POST /scan` once and shows the result (signed-out users go through login first and come back).
`grvsummit://q/<token>` works too (handy for testing: `npx uri-scheme open grvsummit://q/abc --ios`).
Configured in `app.json`:
- iOS `associatedDomains: ["applinks:grv.ethiopiatrustfund.org"]`
- Android `intentFilters` for `https://grv.ethiopiatrustfund.org/q/*` with `autoVerify`
The site must serve the verification files (not done here; belongs in the GRVSummit site):
- `https://grv.ethiopiatrustfund.org/.well-known/apple-app-site-association`
```json
{ "applinks": { "details": [{ "appIDs": ["<TEAMID>.org.ethiopiatrustfund.grvsummit"], "components": [{ "/": "/q/*" }] }] } }
```
- `https://grv.ethiopiatrustfund.org/.well-known/assetlinks.json` with the package name and the
release signing SHA-256 (`eas credentials` shows it).
Without the app, the same URL opens the website's `/q/<token>` page.
## Layout
```
src/app/_layout.tsx fonts, React Query, auth gate (→ /login?next=…)
src/app/login.tsx email → code → optional name (PATCH /me)
src/app/(tabs)/ index (home), booths, scan, investees, me
src/app/q/[token].tsx scan result (success / mystery celebration / already scanned / not a GRV code)
src/app/leaderboard.tsx, raffles.tsx, merch.tsx
src/components/ui.tsx icons, text, cards, buttons, screen shells
src/components/OrderCard.tsx merch order + pickup QR (order number)
src/lib/api.ts fetch wrapper, session (secure-store), API types, queries, money format
src/lib/theme.ts colours/fonts from GRVSummit/app/globals.css
assets/ icon/splash/pattern PNGs rendered from GRVLogo.png and mainwhite.svg
```
Fonts: Antebas (headings) and DM Sans (body). The Antebas files are the Fontspring **demo**
build — digits and punctuation are watermark glyphs, so headings with numbers or punctuation use
DM Sans. Swap in the licensed OTFs in `assets/fonts/` before the store release.