Skip to main content

Project structure

Payofy is a TypeScript monorepo managed with pnpm workspaces and Turborepo. It contains dedicated deployable services, React web applications, and published npm packages under the @payofy/* scope.

Repository layout​

The repository separates deployable applications and shared packages into top-level directories:

  • apps/: Deployable services and applications
    • api/: payofy-api Fastify REST API service (/v1) and Kurv webhook receiver
    • worker/: payofy-worker BullMQ processor for recurring tasks and background jobs
    • admin/: React operations console for internal staff
    • portal/: React partner portal and hosted merchant dashboard (phase 2)
    • docs/: Public developer documentation site (phase 2)
  • packages/: Reusable libraries and SDKs
    • core/: Shared backend modules, services, guards, and middleware
    • contracts/: Zod request, response, and event schemas with OpenAPI generation
    • db/: Drizzle schemas, migrations, PostgreSQL RLS policies, and seed scripts
    • kurv/: Isolated payment rail adapter for Kurv API and Collect.js
    • testing/: Fake Kurv server fixtures and domain test factories
    • node/: Published server SDK for Node.js backends
    • js/: Published browser SDK for hosted card fields and tokens
    • react/: Published React components for embedded payments
    • react-native/: Tap to Pay mobile bridge
    • ui/: Design tokens with Spicyfy orange and UI primitives
    • config/: Shared presets for TypeScript, ESLint, and Vitest
  • infra/: AWS CDK definitions for VPC, ECS, RDS, Redis, and CloudFront
  • examples/: Reference applications
    • budofy-integration/backend/: Node server demonstrating @payofy/node calls
    • budofy-integration/frontend/: React client embedding @payofy/react widgets
  • scripts/: Operational, database, and setup shell automation
  • docs/: System documentation and architectural decisions

External consumer boundaries​

Budofy and Voiceyfy live in separate repositories. They interact with Payofy through @payofy/node on the backend and @payofy/react on the frontend. They do not import server internals or database models directly.