A monorepo for PrivPay - a secure payment checkout system with blockchain integration.
- frontend: React.js application with Chakra UI and Privy authentication
- backend: Express.js server with MongoDB and x402 payment integration
- Node.js (v18 or higher)
- pnpm (v8 or higher)
- MongoDB (local or cloud instance)
- Install dependencies:
pnpm install- Set up environment variables:
Frontend (frontend/.env):
VITE_PRIVY_APP_ID=your-privy-app-id-here
Backend (backend/.env):
PORT=8080
MONGODB_URI=mongodb://localhost:27017/privpay
POLYGON_RPC_URL=https://polygon-rpc.com
PAYMENT_WALLET_PRIVATE_KEY=your-private-key-here
X402_CONTRACT_ADDRESS=your-x402-contract-address-here
- Make sure MongoDB is running
Run both frontend and backend:
pnpm devOr run them separately:
# Frontend only
pnpm dev:frontend
# Backend only
pnpm dev:backendpnpm build/- Landing page with Privy signin/signup/dashboard- Private dashboard to view and create checkouts/checkout/:id- Public checkout page for payment execution
POST /api/signin- Sign in with Privy IDPOST /api/signup- Sign up with Privy IDPOST /api/checkouts- Create a new checkout (requires auth)GET /api/checkouts- Get list of user's checkouts (requires auth)GET /api/checkouts/:id- Get checkout details (public)POST /api/checkouts/:id/pay- Process payment with x402 (public)
- Frontend: React, TypeScript, Vite, Chakra UI, Privy, React Router
- Backend: Express, TypeScript, MongoDB, Mongoose, Ethers.js
- Package Manager: pnpm
- Database: MongoDB
- The x402 payment integration is currently a placeholder. You'll need to implement the actual contract interactions based on your x402 protocol setup.
- Make sure to configure your Privy app ID in the frontend environment variables.
- The backend uses Privy ID for authentication (passed in Authorization header as Bearer token).
- User signup requires Railgun credentials (name, railgunPrivateKey, railgunAddress). You'll need to integrate Railgun SDK to generate these.
- See
ENV_VARIABLES.mdfor detailed environment variable setup instructions.