What SocketPay covers
Authentication
Passkey-powered sign-in that creates or loads a smart wallet on first use.
Wallet dashboard
Real-time balance reads and asset display using
readContract().Token transfers
Full transfer form with status lifecycle, approval flow, and post-tx refresh.
Backend verification
Express API with
verifyAuth() middleware protecting every sensitive route.Activity feed
Transaction history stored server-side and displayed in the frontend.
Security center
Credential rotation and account recovery entry points in a settings page.
High-level architecture
Repository structure
Environment variables
Authentication flow
SDK initialization is the first thing that runs. TheAuthProvider wraps the entire application and restores any persisted session before rendering routes.
apps/web/src/socketfi/client.ts
Wallet dashboard
The dashboard reads balances directly from Soroban usingreadContract() and caches them with React Query. After any transaction, the query is invalidated so the display stays accurate.
apps/web/src/wallet/useBalance.ts
Transaction flow
Every state-changing operation goes throughrequestTransaction(). SocketPay wraps it in a service layer, leaving TransferForm free of SDK-specific logic.
apps/web/src/transactions/transactionService.ts
Backend verification
The Express backend protects all/api routes with authMiddleware. No route handler ever trusts user-supplied identity.
server/src/middleware/auth.ts
server/src/app.ts
Activity feed
SocketPay stores transaction hashes server-side after every successful transfer. The frontend fetches them with React Query.server/src/routes/activity.ts
Security center
Give users a dedicated settings page to manage their passkey credentials and initiate account recovery if needed.apps/web/src/settings/SecurityPage.tsx
React Query setup
Wrap your app withQueryClientProvider at the root alongside AuthProvider:
apps/web/src/main.tsx