INDIAONEMATRIMONY
A production matrimony platform for Indian and NRI families, preference-based matchmaking, 25+ quota-based plans, a self-healing multi-gateway payment system, automated invoices on email and WhatsApp, an admin panel and a gamified sales CRM, all self-hosted on a Hostinger VPS.


- Role
- Full Stack Developer
- Timeline
- Nov 2025 - Oct 2026
- Platform
- Web · Mobile-first
- Hosting
- Hostinger VPS · Supabase · R2
0+
Lines of TypeScript / SQL
0
API routes
0
Pages
0
Database migrations
0
Reusable UI components
0
Commits
0+
Tiered plans
0+
Registered profiles
Framework
Next.js 16 (App Router, Turbopack, Route Handlers, proxy.ts), React 19, TypeScript 5
UI
Tailwind CSS v4, shadcn/ui on Radix, Framer Motion, Embla, Vaul, Sonner, next-themes
Forms
React Hook Form, Zod, input-otp
Data & Auth
Supabase Postgres, Auth (OTP, password, Google OAuth PKCE), RLS, triggers, pg_cron + pg_net
Payments
Razorpay (primary), PayU (automatic fallback + AutoPay), PhonePe (legacy)
Storage
Photo server on the same Hostinger VPS (Node + nginx + Let’s Encrypt), Cloudflare R2 via S3 SDK for invoices
Messaging
Resend, ZeptoMail SMTP, Meta WhatsApp Cloud API
Growth
Meta Pixel + Conversions API, Google Translate / Sheets / AdSense, first-party analytics
Hosting
Self-hosted on a Hostinger KVM VPS running Ubuntu, Supabase for the database, Cloudflare R2 for documents
HOW IT'S WIRED
One Next.js app, self-hosted on a Hostinger KVM VPS running Ubuntu, serves the pages and 127 API routes, with proxy.ts refreshing auth on every request. Everything else is a specialised service behind it.
Next.js 16 on Hostinger VPS
76 pages · 127 API routes · proxy.ts auth refresh
Supabase
Postgres + Auth, RLS, triggers, pg_cron jobs
Payment orchestrator
Razorpay ⇄ PayU ⇄ PhonePe
Cloudflare R2
Private invoice PDFs
VPS photo server
media.indiaonematrimony.com via nginx
Email & WhatsApp
Resend, ZeptoMail, WhatsApp Cloud API
Growth APIs
Meta CAPI, Google Translate & Sheets
Three separately authenticated areas
Members
Supabase Auth sessions: email OTP, password, Google OAuth
Admin
HMAC-signed cookie + emailed OTP second step
Employees
Own HMAC-signed cookie + emailed OTP second step
BUILT FOR FAMILIES
Everything a member touches, from the first visit to finding a match. Tap through the tabs.
A homepage that converts and plays
Hero, features, pricing, FAQ and a “Meet Real Members” reel the admin hand-picks, showing only safe fields, never a phone or email.
- “Guess the Age” mini-game: 5 random profiles served without ages, every guess checked on the server
- Daily play limit per device, counted in IST days and stored in an httpOnly cookie
- SEO: schema.org JSON-LD, Open Graph & Twitter cards, dynamic sitemap.ts and robots.ts, canonical URLs
- Cookie consent, Google Translate language selector with a client-side cache
- HSTS preload, X-Frame-Options, nosniff and Permissions-Policy on every response
Plan ladder
25+ plans · quotas scale with price
THE PAYMENT ENGINE
Razorpay first, PayU as an automatic fallback, but only after Razorpay confirms it holds no money. Pick a scenario and watch an order move through the state machine.
Primary gateway
Automatic fallback
Final status
…
- 1Order createdCREATED
Server quotes the price, the amount shown is the amount charged.
- 2Razorpay checkout openedINITIATED
Attempt #1 recorded as PRIMARY.
- 3Callback receivedPENDING
Signature verified, then re-checked against the Razorpay API.
- 4Plan activatedSUCCESS
Idempotent activation, a racing webhook can’t double-activate.
- 5Invoice deliveredINVOICED
PDF rendered, stored in R2, sent by email + WhatsApp.
Idempotent webhooks
Razorpay, PayU and PhonePe webhooks are signature-checked, logged to a dedicated table and safe to replay.
One switch
A single environment variable swaps the primary gateway, no code change needed.
Recurring billing, built
PayU Pay & Subscribe with eNACH, UPI and card mandates, driven by pg_cron every 5 minutes. Built and ready, currently switched off as a business decision.
Automated invoicing after every successful payment
Number
Postgres function issues a sequential invoice number
Render
Branded PDF generated on the server with pdf-lib
Store
Saved to a private Cloudflare R2 bucket
Deliver
Email via Resend + WhatsApp document to customer & admin
Each channel is tracked and retried separately, a delivery failure never affects the payment.
ADMIN PANEL
Password + emailed OTP login with HMAC-hashed codes, 10-minute expiry, rate limits and 30-day trusted devices that are revoked when the password changes.
Dashboard
Revenue, profile counts, verification, gender split, payment health, recent activity
Analytics
Visitors, sessions, traffic sources, devices, busiest hours and a full member funnel, from a first-party tracker built on sendBeacon
Verification
Moderation queue: approve, request changes, reject, ban, or message the member as a pop-up
Users
Search & filter, plans, remaining quotas, payments and a minutes-per-day activity chart
Payments
Revenue by day, gateway and plan, checkout success rate and Excel export
Sales Arena
Live leaderboard: race view, Hall of Fame, level ladder and team target
Goals & Messages
Daily, weekly and monthly ₹ targets, broadcasts and DMs with read tracking
Plans & Coupons
Edit plans and quotas, oversee every employee coupon with a sales ledger
SALES, BUT IT'S A GAME
The employee portal turns selling into a game. Scores come only from verified payments attributed to each employee, and every date runs on IST.
Level ladder
Based on lifetime revenue
Quests
- Hat-trick · 3 sales in a day
- Keep the fire · 5-day streak
- Weekly target
- Monthly mission
Targets come from the manager, or are calculated from the employee’s own recent pace.
14 unlockable trophies
Bronze · Silver · Gold · Legend tiers
Plus a live Arena with “just ahead of you / chasing you” nudges, self-service discount coupons with share links and sales ledgers, and full reports, daily, monthly and yearly.
DATABASE DESIGN
Supabase PostgreSQL with Row Level Security, triggers and scheduled jobs, built up through 54 versioned migrations.
-- main tables
- 54 versioned, idempotent migrations (IF NOT EXISTS, IS DISTINCT FROM)
- Row Level Security: privileged access only through server routes using the service role
- Triggers sync auth metadata, cap featured members at 10 and cascade deletes from auth.users
- CHECK constraints guard statuses and gender, so matching can’t run without one
- pg_cron jobs with their secrets stored in Supabase Vault
SECURITY & RELIABILITY
Verified payments
Signature or hash verification on every callback and webhook, with audit logs
Server-side pricing
Prices, discounts and coupon limits are always calculated on the server
Staff 2FA
HMAC-stored OTPs, rate limits, masked emails and password-bound trusted devices
Private by default
Public APIs never expose contact details, access is controlled by quota
Growth stack: Meta Pixel + Conversions API fired from browser and server with shared event IDs for deduplication, referral and employee share links for sales attribution, and hero-form leads written to Google Sheets through a service account.
HARD PROBLEMS
Never charge a customer twice
The orchestrator only falls back to PayU after Razorpay’s API confirms it holds no money for the order. Unknown or pending states never fall back, and plan activation is idempotent across callbacks and webhooks.
Scheduled jobs that never miss
Moved scheduling into the database: Supabase pg_cron + pg_net call the redemption processor every 5 minutes, with secrets kept in Supabase Vault, independent of app restarts and deploys.
Three kinds of users, one codebase
Members use Supabase Auth, while admins and employees each get their own HMAC-signed session with an emailed OTP second step, fully isolated from each other.
Revenue that stays correct
The ₹2 AutoPay trial payment is marked “superseded” by the first real debit, so referral earnings stay accurate without deleting any payment history.
LET'S WORKTOGETHER
Answer 5 quick questions and send your project idea straight to me.
Your idea
Launched
Passenger
···
Project
···
Budget
···
Boarding
···
Mission
···
Flight
···
Seat
1A
Gate
···
PILOT S. MISHRA
Sudhanshu Mishra
typing…
Or email me directly: sudomishra001@gmail.com or WhatsApp