How shahilsingh546/paisaflow works
Paisa Flow is a wallet monorepo with user and merchant web apps, a bank webhook service, and shared database, state, and UI packages. The user journey spans sign-in, wallet overview and transaction history, adding money, and peer-to-peer transfers; merchant sign-in is a separate workflow. The excerpts establish several page, authentication, and database relationships, but the webhook implementation and some transfer actions were not sampled, so their internal links are omitted.
Main entry points: auth.ts User authentication · dashboard/page.tsx Wallet dashboard · index.ts Prisma database · p2p/page.tsx P2P transfer page
Components 24
User wallet
- Session redirect
apps/user-app/app/page.tsx - User authentication
apps/user-app/app/lib/auth.ts - Wallet dashboard
apps/user-app/app/(dashboard)/dashboard/page.tsx - Balance display
apps/user-app/components/BalanceCard.tsx - Transaction history
apps/user-app/app/(dashboard)/transactions/page.tsx - Transaction retrieval
apps/user-app/app/lib/getTransactions.ts - Transaction display
apps/user-app/components/TransactionsCard.tsx - Wallet funding page
apps/user-app/app/(dashboard)/transfer/page.tsx - Onramp transaction
apps/user-app/app/lib/actions/createOnrampTransaction.ts - P2P transfer page
apps/user-app/app/(dashboard)/p2p/page.tsx - Transfer form
apps/user-app/components/SendCard.tsx - P2P transfer action
apps/user-app/app/lib/actions/p2pTransfer.ts - P2P history view
apps/user-app/components/P2PTransactions.tsx - User profile API
apps/user-app/app/api/user/route.ts
Merchant portal
- Merchant authentication
apps/merchant-app/lib/auth.ts - Merchant API
apps/merchant-app/app/api/user/route.ts
Shared packages
- Prisma database
packages/db/index.ts - Balance state
packages/store/src/atoms/balance.ts - Balance hook
packages/store/src/hooks/useBalance.ts - Shared app bar
packages/ui/src/Appbar.tsx - Shared button
packages/ui/src/button.tsx
Payment integration
- Bank webhook handler
apps/bank_webhook_handler/src/index.ts
Other components
- Wallet user
- Merchant user
Connections 21
- Wallet user → Session redirect: opens
apps/user-app/app/page.tsx - Session redirect → User authentication: checks session
apps/user-app/app/page.tsx - User authentication → Prisma database: reads/writes users
apps/user-app/app/lib/auth.ts - Wallet dashboard → User authentication: checks session
apps/user-app/app/(dashboard)/dashboard/page.tsx - Wallet dashboard → Prisma database: reads balance
apps/user-app/app/(dashboard)/dashboard/page.tsx - Wallet dashboard → Transaction retrieval: loads transactions
apps/user-app/app/(dashboard)/dashboard/page.tsx - Wallet dashboard → Balance display: renders
apps/user-app/app/(dashboard)/dashboard/page.tsx - Wallet dashboard → Transaction display: renders
apps/user-app/app/(dashboard)/dashboard/page.tsx - Transaction history → User authentication: checks session
apps/user-app/app/(dashboard)/transactions/page.tsx - Transaction history → Transaction retrieval: loads transactions
apps/user-app/app/(dashboard)/transactions/page.tsx - Transaction history → Transaction display: renders
apps/user-app/app/(dashboard)/transactions/page.tsx - P2P transfer page → User authentication: checks session
apps/user-app/app/(dashboard)/p2p/page.tsx - P2P transfer page → Prisma database: reads transfers
apps/user-app/app/(dashboard)/p2p/page.tsx - P2P transfer page → Transfer form: renders
apps/user-app/app/(dashboard)/p2p/page.tsx - P2P transfer page → P2P history view: renders
apps/user-app/app/(dashboard)/p2p/page.tsx - User profile API → User authentication: checks session
apps/user-app/app/api/user/route.ts - Merchant user → Merchant authentication: signs in
- Merchant authentication → Prisma database: upserts merchant
apps/merchant-app/lib/auth.ts - Merchant API → Prisma database: creates merchant
apps/merchant-app/app/api/user/route.ts - Balance hook → Balance state: reads state
packages/store/src/hooks/useBalance.ts - Shared app bar → Shared button: uses
packages/ui/src/Appbar.tsx