Cloudflare Pages Functions + D1 + Razorpay

Minimal billing operations built for production.

Responsive customer billing, admin controls, secure session cookies, webhook reconciliation, and clean static-first delivery on Cloudflare.

Invoice-first workflow
Track due dates, statuses, and PDF invoices without visual clutter.
Secure payment flow
Backend-only order creation and signature verification with Razorpay.
Architecture
Static-first
Auth
Secure cookies
Payments
Razorpay

Customer billing

Invoice numbers, due dates, bill filtering, PDF invoice downloads, and mobile-friendly bill cards.

Admin operations

Create, update, cancel, delete, or manually settle bills with audit logging and reconciliation visibility.

Security controls

PBKDF2 password hashing, CSRF protection, rate limiting, server-only Razorpay secrets, and webhook verification.

Session-based auth

Uses `Secure`, `HttpOnly`, `SameSite=Strict` session cookies instead of browser storage tokens.

Prepared queries

All D1 operations use parameterized statements to reduce injection risk.

Webhook reconciliation

Final payment state can be reconciled server-to-server using Razorpay webhooks.

Deploy directly from GitHub

Connect the repository to Cloudflare Pages, attach the D1 binding, add secrets, and deploy globally without a separate frontend build step.