What the client needed
MyZodiaq required a platform that could handle the complexity of Vedic astronomical calculations while delivering a consumer-grade experience with payments, AI content, and bilingual support.
Complex astronomical calculations
Vedic astrology demands precise planetary position math — Kundali generation, Dasha period computation, Dosha detection, and Panchang data — all requiring sub-second response times.
Bilingual SEO parity
English and Hindi content needed to rank independently on search engines with proper hreflang tags, locale-prefixed routes, and server-rendered metadata for each language.
Payment lifecycle tracking
Consultation bookings required end-to-end Razorpay integration with order creation, payment capture, webhook reconciliation, refund handling, and audit-grade event logging.
AI-powered content at scale
Generating daily horoscope content for 12 zodiac signs across 2 locales (24 pieces/day) with domain-accurate Vedic astrology interpretations, not generic LLM output.
Anonymous-to-authenticated journey
Most users interact with free calculators before registering. The system needed to track user journeys across sessions and link them upon authentication for conversion analysis.
Independent service scaling
CPU-bound calculator endpoints, read-heavy blog content, and horoscope data have fundamentally different scaling profiles — a monolith would bottleneck all three.
Rendering strategy & performance
Above-fold styles injected at build — zero render-blocking CSS
Roboto preloaded and swapped — zero FOIT, no layout shift
Horoscope, Testimonials, FAQ lazy-loaded with per-section skeleton loaders
Immutable hashes on JS/CSS bundles — CDN-cached at Vercel edge
Three separate Axios instances with independent cache & error handling per backend
Kundali birth details cached client-side for instant form re-population
Canonical URLs enforced before rendering — crawl budget preserved
Organization, LocalBusiness, WebSite schemas with cached helper generation
Route-level locale prefixing — /en/ and /hi/ with cross-links in <head>
Request lifecycle & data flow
How a Kundali calculation request flows
Zod validates DOB, TOB, POB on client. Zustand caches form data in localStorage for re-access.
If token present → user ID attached to request. If guest → UUID from cookie used for activity tracking. Request proceeds either way.
Birth details forwarded to external astronomical engine. Planetary positions, house placements, and Nakshatra data returned.
Server-side utilities parse raw positions → compute Mangal Dosha, Kaal Sarp Dosha, Raj Yoga. Ashtakvarga strength matrix calculated.
Event type, user/UUID, device info, location, duration, service name — written async. UserSession.servicesUsed[] updated.
Custom SVG chart component renders planetary positions. React PDF generates downloadable report. Results cached in localStorage.
MongoDB schema design
User & Auth Domain
Phone-unique users with birth details (DOB, TOB, POB), astrological profile (moonSign, nakshatra), role-based access (user/astrologer/admin), and astrologer expertise metadata.
Payment & Booking Domain
Full payment state machine (created → attempted → paid/failed), HMAC signature storage, webhook event arrays, refund tracking with reason codes, and multi-currency support (INR, USD, EUR, GBP).
Analytics Domain
UUID-based cross-session tracking with 100+ event types, device/location data, conversion funnel methods (getConversionRate, getRepeatVsNewUsers), and compound indexes for aggregation.
Content Domain
AI-generated horoscope blogs with zodiac/locale/period indexing, versioned AI Patrika reports, and service-linked testimonials and FAQ content.
Eight services, one platform
Each integration is purpose-built for its domain — payments, AI, authentication, astronomical calculations, content, and media delivery.
Razorpay
Full lifecycle — order creation, payment capture, HMAC SHA256 signature verification, webhook event sourcing, and refund tracking with audit trail.
Azure OpenAI (GPT-4o)
Automated horoscope generation with domain-specific prompt templates encoding Vedic astrology knowledge. Scheduled daily, weekly, and yearly content runs.
MSG91
Phone-based OTP authentication — no passwords. Template-driven SMS delivery with send/resend flows for the Indian market.
Vedic Astro API
External astronomical engine for planetary positions, Kundali charts, Dasha periods, Dosha detection, compatibility matching, and Panchang data.
Strapi Cloud
Headless CMS for blog articles and editorial content. Locale-aware content delivery with time-filtered queries for daily vs. monthly horoscopes.
ImageKit
Image optimisation, transformation, and CDN delivery for astrologer profiles, blog thumbnails, and marketing assets with AVIF/WebP support.
Authentication & payments
OTP Authentication Flow
Three-tier authorization:
Razorpay Payment Flow
Order state machine:
Supports card, UPI, netbanking, and wallet. Webhook events appended as raw data for audit trails. Refunds tracked with amount, reason, and Razorpay ID.
Key trade-offs we made
Every architecture decision is a trade-off. Here are the six that shaped the platform most significantly.
Multi-service backend over monolith
Three independent services — main API (Azure), blog CMS (Strapi Cloud), horoscope API (Azure) — each behind a dedicated Axios instance with independent interceptors and failure isolation.
OTP-only authentication
Phone-based OTP via MSG91 with no password option. The Indian market has high mobile penetration and familiarity with OTP flows. Eliminates credential-stuffing attack surface entirely.
UUID-based cross-session tracking
Persistent device UUID assigned on first visit, tracked across sessions, and linked to user account upon registration. Enables full journey attribution from anonymous calculator usage to paid consultation.
Optional auth on calculators
All 50+ calculators accept unauthenticated requests via optionalAuth middleware. Free tools drive organic search traffic; authentication unlocks result persistence and booking.
Middleware-level SEO redirects
Canonical URL 301 redirects handled in Next.js middleware (edge) rather than rewrites. Search crawlers get proper redirect signals without wasting server compute on rendering non-canonical URLs.
Event-sourced payment audit trail
Every Razorpay webhook event is appended to the Order document as raw data. Supports dispute resolution, financial reporting, and debugging payment edge cases without external logging infrastructure.
By the numbers
50+ services delivered
Deployment topology
What we delivered
Full-stack platform delivery
50+ Vedic astrology and numerology services accessible without registration, with bilingual (EN/HI) content across 100+ indexable service pages.
End-to-end consultation flow
Astrologer search, scheduling, and Razorpay payment with support for card, UPI, netbanking, and wallet — including webhook reconciliation and refund processing.
Automated content engine
Azure OpenAI generates 24 horoscope content pieces daily (12 signs x 2 languages) via scheduled cron jobs, with domain-specific prompt templates encoding Vedic astrology knowledge.
SEO-first architecture
Server-rendered pages with structured data markup (Organization, LocalBusiness, WebSite schemas), automated sitemaps, canonical redirects, and hreflang tags across both locales.
Full journey analytics
UUID-based tracking from anonymous calculator usage through registration to paid consultation — 100+ event types enabling conversion funnel optimisation and service popularity analysis.
Independent scaling
Calculator traffic spikes don't affect content delivery or payments. Strapi outages don't impact core calculators. Each service scales and deploys independently.
Ready to build something like this?
Whether it's a full-stack platform, an AI integration, or a payment system — let's talk about what your product needs.