A modern SaaS application for automating recurring PayPal payments to your team, contractors, and vendors.
- Recurring Payments: Set up one-time, weekly, bi-weekly, monthly, or custom payment schedules
- Recipient Management: Add and manage payment recipients with default amounts
- PayPal Integration: Connect your PayPal Business account using API credentials
- Transaction History: Track all payments with status updates
- Dashboard: Overview of upcoming payments, recent activity, and quick stats
- Vercel Cron: Automated payment processing on schedule
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Database: SQLite (local) / Vercel Postgres (production)
- ORM: Prisma
- Auth: NextAuth.js v4
- Styling: Tailwind CSS + Shadcn/UI
- Payments: PayPal Payouts API
- Deployment: Vercel
- Node.js 18+
- npm or yarn
- PayPal Business Account with API credentials
-
Clone the repository:
git clone https://github.com/graphcs/FlexPay.git cd FlexPay -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
Edit
.envwith your settings:DATABASE_URL="file:./dev.db" NEXTAUTH_URL="http://localhost:3001" NEXTAUTH_SECRET="your-secret-key" -
Set up the database:
npx prisma db push
-
Start the development server:
npm run dev
Register with your email and password on the signup page.
Navigate to "Connect" in the dashboard and enter your PayPal API credentials:
- Go to PayPal Developer Dashboard
- Create or select an app
- Copy your Client ID and Secret
- Choose Sandbox for testing or Live for production
Go to "Recipients" and add the people you want to pay with their PayPal email addresses.
Navigate to "Schedules" and create a new payment schedule:
- Select recipients and amounts
- Choose frequency (one-time, weekly, bi-weekly, monthly, custom)
- Set start date
View payment history and status in the "Transactions" section.
flexpay/
├── app/
│ ├── (marketing)/ # Public pages (landing, pricing)
│ ├── (auth)/ # Auth pages (login, register)
│ ├── (dashboard)/ # Protected dashboard pages
│ └── api/ # API routes
│ ├── auth/ # NextAuth endpoints
│ ├── paypal/ # PayPal connect/disconnect
│ ├── recipients/ # Recipients CRUD
│ ├── schedules/ # Schedules CRUD
│ ├── transactions/ # Transactions
│ └── cron/ # Vercel Cron endpoint
├── components/
│ ├── ui/ # Shadcn/UI components
│ └── dashboard/ # Dashboard components
├── lib/
│ ├── auth.ts # NextAuth configuration
│ ├── db.ts # Prisma client
│ ├── paypal.ts # PayPal API client
│ └── utils.ts # Utility functions
├── prisma/
│ └── schema.prisma # Database schema
└── vercel.json # Vercel Cron configuration
| Route | Method | Description |
|---|---|---|
/api/auth/* |
- | NextAuth endpoints |
/api/paypal/connect |
POST | Connect PayPal credentials |
/api/paypal/disconnect |
POST | Disconnect PayPal |
/api/recipients |
GET, POST | List/create recipients |
/api/recipients/[id] |
GET, PUT, DELETE | Manage recipient |
/api/schedules |
GET, POST | List/create schedules |
/api/schedules/[id] |
GET, PUT, DELETE | Manage schedule |
/api/transactions |
GET | List transactions |
/api/cron/process-payments |
GET | Process due payments |
-
Push to GitHub
-
Connect repository to Vercel
-
Add environment variables in Vercel dashboard:
DATABASE_URL(Vercel Postgres connection string)NEXTAUTH_URL(your production URL)NEXTAUTH_SECRET(secure random string)CRON_SECRET(optional, for cron security)
-
Deploy
The cron job is configured in vercel.json to run every hour.
- Create a PayPal Developer Account
- Create sandbox business and personal accounts
- Create an app and get sandbox credentials
- Use sandbox mode in FlexPay
- Upgrade to PayPal Business account
- Enable PayPal Payouts
- Create a live app in PayPal Developer Dashboard
- Use live credentials with "Live" mode in FlexPay
MIT