This file provides guidance to AI agents when working with code in this repository.
Note: This is a legacy proof-of-concept application. For active development, see
dapps/pos-app.
PoC POS App is a proof-of-concept React Native point-of-sale application for cryptocurrency payments via WalletConnect. It serves as the foundation for the production pos-app. The app allows merchants to:
- Generate QR codes for payment requests
- Accept payments through WalletConnect-compatible wallets
- Print thermal receipts for completed transactions
- Support multiple branded variants (white-labeling)
The app is built with Expo and React Native, supporting Android, iOS, and Web platforms.
- React Native: 0.81.5
- Expo: ^54.0.23 (with Expo Router for navigation)
- TypeScript: ~5.9.2
- React: 19.1.0
- @tanstack/react-query: Data fetching and caching
- zustand: State management
- react-hook-form: Form handling
- expo-router: File-based routing
- react-native-thermal-pos-printer: Thermal printer integration
- react-native-qrcode-skia: QR code generation
- @shopify/react-native-skia: Graphics rendering
- react-native-mmkv: Fast key-value storage
- @sentry/react-native: Error tracking
poc-pos-app/
├── app/ # Expo Router screens (file-based routing)
│ ├── _layout.tsx # Root layout with providers
│ ├── index.tsx # Home screen
│ ├── amount.tsx # Amount input screen
│ ├── scan.tsx # QR code display & payment polling
│ ├── payment-success.tsx # Success screen
│ ├── payment-failure.tsx # Failure screen
│ ├── settings.tsx # Settings & configuration
│ └── logs.tsx # Debug logs viewer
├── components/ # Reusable UI components
├── constants/ # Theme, variants, spacing
├── hooks/ # Custom React hooks
├── store/ # Zustand state stores
├── utils/ # Utility functions
└── assets/ # Images, fonts, icons
Uses Zustand with two main stores:
-
useSettingsStore(store/useSettingsStore.ts)- Merchant ID, theme mode, variant selection
- Device ID, PIN protection settings
- Printer connection status
-
useLogsStore(store/useLogsStore.ts)- Debug logs for troubleshooting
Uses Expo Router with file-based routing:
- Routes defined by file structure in
app/directory - Navigation via
router.push(),router.replace(),router.dismiss()
- Home Screen → New Sale button
- Amount Input → Custom numeric keyboard
- QR Code Display → Polls payment status
- Payment Success/Failure → Receipt printing option
Supports branded variants for white-labeling:
- default: Blue accent (#0988F0)
- solflare: Yellow/gold (#FFEF46)
- binance: Yellow (#FCD533)
- phantom: Purple (#AB9FF2)
- solana: Purple (#9945FF)
- PIN protection with lockout after failed attempts
- Biometric authentication support
- MMKV encrypted storage
Required in .env:
EXPO_PUBLIC_PROJECT_ID="" # WalletConnect project ID
EXPO_PUBLIC_SENTRY_DSN="" # Sentry error tracking DSN
SENTRY_AUTH_TOKEN="" # Sentry authentication token
EXPO_PUBLIC_API_URL="" # Payment API base URL
EXPO_PUBLIC_GATEWAY_URL="" # WalletConnect gateway URL
EXPO_PUBLIC_MERCHANTS_URL="" # Merchants API URLnpm install
cp .env.example .env
npm run prebuild
npm run android # or ios/webnpm start: Start Expo dev servernpm run android: Run on Androidnpm run ios: Run on iOSnpm run web: Run on webnpm run lint: Run ESLintnpm test: Run Jest tests
- Use
useLogsStorefor debugging, notconsole.log() - Remove console statements before committing
Always run these checks and fix any errors before committing:
npm run lint # Check and fix ESLint errors
npx prettier --write . # Format code with Prettier
npx tsc --noEmit # Check for TypeScript errors- No trailing whitespace
- Use TypeScript strict mode
- Follow existing code patterns