How faizananwar2801/fab-pay works
Project type and purpose
• This is a full-stack monorepo managed by Turborepo.
• It contains two Next.js frontends—merchant-app (merchant-facing portal) and user-app (end-user dashboard)—plus a backend webhook service (bank-webhook) and shared packages for UI components, state management, database models, and configuration.
• The project’s goal is to power a financial platform: users can transfer money, merchants can receive payments, and the system processes bank webhooks and persists transactions in a database.
File structure
• Top-level folders
• apps/merchant-app: Next.js app with NextAuth for authentication, API routes under /app/api, and React components under /app and /components.
• apps/user-app: Next.js app structured with a (dashboard) route group, API routes for auth and user data, and feature pages for transfers, transactions, etc.
• apps/bank-webhook: a small Node/TypeScript HTTP service (src/index.ts) that receives bank webhooks and writes events to the database.
• Shared packages
• packages/db: Prisma schema, migrations, seed script, and database client wrapper.
• packages/store: React state atoms/hooks for client-side state (e.g., balance).
• packages/ui: shared React component library (buttons, cards, inputs).
• packages/eslint-config & packages/typescript-config: linting and TypeScript base configs.
• Tooling & CI
• .github/workflows: build and deploy pipelines.
• docker/Dockerfile.user: containerization instructions for the user app.
Key architecture insights from README
• Uses Turborepo for task orchestration and caching.
• Leverages TypeScript across all layers.
• NextAuth for authentication.
• Prisma ORM for database access and migrations.