SolveEase Pay — Deployment Guide


Prerequisites

  • Node.js 20+
  • PostgreSQL database (Neon recommended)
  • Cashfree merchant account (with API credentials)
  • Vercel account (recommended) or any Node.js hosting

Environment Variables

Copy .env.example and fill in values:

cp .env.example .env.local
VariableDescriptionRequired
DATABASE_URLPostgreSQL connection string
CASHFREE_APP_IDCashfree App ID
CASHFREE_SECRET_KEYCashfree Secret Key
CASHFREE_ENVIRONMENTSANDBOX or PRODUCTION
CASHFREE_WEBHOOK_SECRETCashfree webhook signing secret
JWT_SECRETSecret for admin JWT tokens
ADMIN_EMAILDefault admin login email
ADMIN_PASSWORD_HASHbcrypt hash of admin password
NEXT_PUBLIC_APP_URLFull URL of this app (e.g. https://pay.solveease.in)
RATE_LIMIT_WINDOW_MSRate limit window in ms (default: 60000)
RATE_LIMIT_MAX_REQUESTSMax requests per window (default: 100)

Database Setup

# Generate Prisma client
npx prisma generate

# Run migrations
npx prisma migrate deploy

# (Optional) Seed initial admin and test tenant
npx prisma db seed

Local Development

npm install
npm run dev

App runs at http://localhost:3000.

Cashfree webhook in local dev: Use ngrok to expose your local server:

ngrok http 3000
# Use the generated HTTPS URL as webhook endpoint in Cashfree dashboard

Production Deployment (Vercel)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel --prod

Configure environment variables in the Vercel dashboard or via CLI:

vercel env add DATABASE_URL
vercel env add CASHFREE_APP_ID
# ... etc

After deployment:

  1. Run migrations against production DB: npx prisma migrate deploy
  2. Set up the Cashfree webhook URL in Cashfree dashboard: https://pay.solveease.in/api/webhooks/cashfree
  3. Test with a Sandbox order before switching to Production mode

Switching to Production

  1. Change CASHFREE_ENVIRONMENT=PRODUCTION in env
  2. Update CASHFREE_APP_ID and CASHFREE_SECRET_KEY to production credentials
  3. Update the webhook URL in the Cashfree production dashboard
  4. Test with a small real payment before enabling for all products