PaySwift is a monorepo for a payment platform inspired by Paytm, built with Next.js, TypeScript, and Prisma. It is organized for scalability and maintainability, with separate apps for merchants and users, and shared packages for UI, database, and configuration.
PaySwift/
├── apps/
│ ├── merchant-app/ # Next.js app for merchants
│ └── user-app/ # Next.js app for users
├── packages/
│ ├── db/ # Prisma schema and migrations
│ ├── eslint-config/ # Shared ESLint config
│ ├── typescript-config/ # Shared TypeScript config
│ └── ui/ # Shared React UI components
├── package.json # Root config, scripts, and workspaces
├── turbo.json # Turborepo configuration
└── README.md # Project documentation
-
Install dependencies
npm install
-
Set up the database
- Edit your database connection string in
packages/db/prisma/schema.prismaif needed. - Run Prisma migrations:
npx prisma migrate dev --schema=packages/db/prisma/schema.prisma
- Edit your database connection string in
-
Start development servers
npm run dev
This will start both
merchant-appanduser-applocally.
- merchant-app: Next.js app for merchant features and dashboard.
- user-app: Next.js app for user-facing features.
- db: Prisma ORM setup, schema, and migrations.
- eslint-config: Shared ESLint rules.
- typescript-config: Shared TypeScript configuration.
- ui: Reusable React components for both apps.
- All code is written in TypeScript.
- Shared logic and UI components are imported from the
uipackage. - Database schema and migrations are managed with Prisma in the
dbpackage.
MIT
To build all apps and packages, run the following command:
cd my-turborepo
pnpm build
To develop all apps and packages, run the following command:
cd my-turborepo
pnpm dev
Tip
Vercel Remote Cache is free for all plans. Get started today at vercel.com.
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd my-turborepo
npx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
npx turbo link
Learn more about the power of Turborepo: