Case Study

MyZodiaq

Engineering a bilingual Vedic astrology platform with 50+ calculators, AI-powered birth chart interpretation, real-time Panchang data, and an astrologer consultation marketplace — from architecture to production.

50+

Astrology & Numerology Services

80+

API Endpoints Shipped

2

Languages (EN + HI)

8

Third-Party Integrations

Next.js 15React 19Node.js 20MongoDBAzure OpenAIRazorpayStrapiDocker
The challenge

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.

1

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.

2

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.

3

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.

4

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.

5

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.

6

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.

Architecture

Multi-service system design

Browser
Client
Next.js 15
Vercel Edge
Express.js
Node.js 20 · Azure
80+ ENDPOINTSREST
Strapi Cloud
Headless CMS
Azure OpenAI
GPT-4o
Vedic Astro
Calculations
MSG91
OTP Auth
Razorpay
Payments
MongoDB Atlas
17 Collections
ImageKit
Media CDN
REST / JWT
Frontend

Vercel Edge (SSR + ISR)

Next.js 15 App Router with React Server Components for SEO-critical content and Client Components for interactive calculator forms.

API Layer

Azure App Service

Express.js REST API with three-tier auth middleware (protect, optionalAuth, adminOnly) and UUID-based user tracking across sessions.

Data Layer

MongoDB Atlas

17 collections with compound indexes on high-query tables (Order, Activity, UserSession). Mongoose schemas with built-in analytics static methods.

AI Engine

Azure OpenAI (GPT-4o)

Domain-specific prompt templates for horoscope generation and AI Patrika, with Bhrigu Samhita references encoded into prompt chains.

Frontend engineering

Rendering strategy & performance

Page TypeRenderCacheWhy
Calculator pages (50+)
SSR
None
SEO-critical long-tail keywords. Server renders metadata + structured data; calculator form hydrates as Client Component.
Horoscope content
ISR
300s
Content changes daily but identical for all users. ISR revalidates every 5 minutes without cold rebuilds.
Kundali results
CSR
localStorage
User-specific birth chart data. Results cached in localStorage for instant re-access; no SEO value in personalised output.
Blog/library articles
SSG
1yr
Static editorial content from Strapi CMS. Pre-rendered at build time with on-demand ISR for new posts.
Booking & payment flows
CSR
None
Requires authentication, real-time Razorpay state, and dynamic astrologer availability. No server rendering benefit.
Critical rendering path
Critical CSS inlined via Critters

Above-fold styles injected at build — zero render-blocking CSS

Fonts: next/font with display swap

Roboto preloaded and swapped — zero FOIT, no layout shift

Lazy sections with Suspense

Horoscope, Testimonials, FAQ lazy-loaded with per-section skeleton loaders

Caching architecture
Static assets: 31,536,000s (1 year)

Immutable hashes on JS/CSS bundles — CDN-cached at Vercel edge

API responses: Axios interceptors

Three separate Axios instances with independent cache & error handling per backend

Form data: localStorage persistence

Kundali birth details cached client-side for instant form re-population

SEO engineering
Middleware 301 redirects at edge

Canonical URLs enforced before rendering — crawl budget preserved

Structured data per page type

Organization, LocalBusiness, WebSite schemas with cached helper generation

Hreflang for EN/HI parity

Route-level locale prefixing — /en/ and /hi/ with cross-links in <head>

AVIF / WebPFormat negotiation with fallback
Cloudinary + ImageKitDual CDN with remote pattern allowlist
Responsive srcsetDevice-aware resolution serving
Lazy + priorityAbove-fold priority, below-fold lazy
Backend engineering

Request lifecycle & data flow

How a Kundali calculation request flows

1
Client submits birth detailsFRONTEND

Zod validates DOB, TOB, POB on client. Zustand caches form data in localStorage for re-access.

2
optionalAuth middleware checks JWTMIDDLEWARE

If token present → user ID attached to request. If guest → UUID from cookie used for activity tracking. Request proceeds either way.

3
Controller calls Vedic Astro APICONTROLLER

Birth details forwarded to external astronomical engine. Planetary positions, house placements, and Nakshatra data returned.

4
Response enriched with Dosha detectionSERVICE

Server-side utilities parse raw positions → compute Mangal Dosha, Kaal Sarp Dosha, Raj Yoga. Ashtakvarga strength matrix calculated.

5
Activity logged with full contextANALYTICS

Event type, user/UUID, device info, location, duration, service name — written async. UserSession.servicesUsed[] updated.

6
Kundali rendered with North Indian ChartRENDER

Custom SVG chart component renders planetary positions. React PDF generates downloadable report. Results cached in localStorage.

Three-tier authorization model
protectRequires valid JWT. Used on profile, bookings, saved kundalis. Rejects 401 without token.
optionalAuthAccepts JWT if present but serves guests freely. Powers all 50+ free calculators — the primary acquisition funnel.
adminOnlyRequires isAdmin flag in JWT payload. Gates dashboard analytics, user management, and booking oversight.
UUID-based journey tracking
AssignFirst request → persistent UUID written to cookie. Tracks device across all sessions including incognito.
LinkOn OTP verification → UUID linked to authenticated user. Full history of anonymous calculator usage attributed retroactively.
AnalyseUserSession model exposes getConversionRate(), getRepeatVsNewUsers(), and per-service usage counts as Mongoose static methods.

API Route Architecture

/api/v1/
POST
/users
Auth, OTP, profile management4
GET
/services
Service catalog (free / premium)2
POST
/bookings
Consultation lifecycle + Razorpay6
GET
/astrologers
Professional profiles3
POST
/moon-sign
Astrology calculation endpoints50+
POST
/kundali
Birth chart generation + matching4
POST
/numerology
Numerology calculators8
GET
/blogs
AI-generated horoscope content5
GET
/client-crm
Astrologer CRM data2
GET
/admin
Dashboard analytics + management6

Middleware Pipeline

CORSHeadersWebhook BodyJSON ParseCookiesUUID TrackRoutes
Data layer

MongoDB schema design

User & Auth Domain

UserRoleAstrologers

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

OrderBookingFormService

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

ActivityUserSessionAnalyticsData

UUID-based cross-session tracking with 100+ event types, device/location data, conversion funnel methods (getConversionRate, getRepeatVsNewUsers), and compound indexes for aggregation.

Content Domain

HoroscopeBlogAIPatrikaFAQTestimonial

AI-generated horoscope blogs with zodiac/locale/period indexing, versioned AI Patrika reports, and service-linked testimonials and FAQ content.

Integrations

Eight services, one platform

Each integration is purpose-built for its domain — payments, AI, authentication, astronomical calculations, content, and media delivery.

Payments

Razorpay

Full lifecycle — order creation, payment capture, HMAC SHA256 signature verification, webhook event sourcing, and refund tracking with audit trail.

AI / LLM

Azure OpenAI (GPT-4o)

Automated horoscope generation with domain-specific prompt templates encoding Vedic astrology knowledge. Scheduled daily, weekly, and yearly content runs.

Authentication

MSG91

Phone-based OTP authentication — no passwords. Template-driven SMS delivery with send/resend flows for the Indian market.

Calculations

Vedic Astro API

External astronomical engine for planetary positions, Kundali charts, Dasha periods, Dosha detection, compatibility matching, and Panchang data.

Content CMS

Strapi Cloud

Headless CMS for blog articles and editorial content. Locale-aware content delivery with time-filtered queries for daily vs. monthly horoscopes.

Media CDN

ImageKit

Image optimisation, transformation, and CDN delivery for astrologer profiles, blog thumbnails, and marketing assets with AVIF/WebP support.

System flows

Authentication & payments

OTP Authentication Flow

Phone Number → Backend → MSG91 (6-digit OTP) OTP Code → Backend → MSG91 (Verify) → Generate JWT (30-day) Token + User ← Backend ← Cookie Storage

Three-tier authorization:

protectProfile, bookings, saved data — rejects without JWT
optionalAuthCalculators, horoscopes — serves guests freely
adminOnlyDashboard, management — requires isAdmin flag

Razorpay Payment Flow

Book Consultation → Backend → Razorpay (Create Order) ← Order ID Razorpay Modal → Payment → Razorpay ← Backend (HMAC SHA256 Verify) Confirmation ← Backend ← Webhook (Async Reconciliation)

Order state machine:

createdattemptedpaidfailedrefunded

Supports card, UPI, netbanking, and wallet. Webhook events appended as raw data for audit trails. Refunds tracked with amount, reason, and Razorpay ID.

Engineering decisions

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.

Trade-off: Increased operational complexity offset by independent scaling and fault boundaries.

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.

Trade-off: Full dependency on MSG91 uptime for all authentication.

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.

Trade-off: Device-bound tracking; no cross-device attribution.

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.

Trade-off: Server resources consumed by unauthenticated traffic.

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.

Trade-off: Middleware logic grows with each redirect rule.

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.

Trade-off: Document size grows with payment activity.
Platform scale

By the numbers

50+

Vedic astrology & numerology services

80+

REST API endpoints shipped

17

MongoDB collections designed

120+

React components built

9

Zustand state stores

100+

Activity event types tracked

24

AI-generated content pieces/day

8

Third-party integrations

Service coverage

50+ services delivered

Vedic Astrology — Free Calculators
Moon Sign Calculator
Sun Sign Calculator
Ascendant / Lagna Sign
Birth Nakshatra
Daily Nakshatra
Love Compatibility
Friendship Compatibility
Mole Analysis
Baby Name Suggestions
Rudraksha Recommendation
Gemstone Recommendation
Pitra Dosha Check
Vedic Astrology — Premium Reports
Kaal Sarpa Dosha Report
Sade Sati (Saturn Transit)
Mangal Dosha Report
Laal Kitaab Remedies
Vimshottari Dasha (Planetary Periods)
Raj Yoga Report
Laal Kitaab Debts
Puja Suggestions
Numerology
Life Path Number
Personality Number
Expression Number
Soul Urge Number
Destiny Number
Career Number
Karmic Debt Number
Maturity Number
Attitude Number
Challenge Number
Advanced Services
Kundali Generation (Birth Chart)
Kundali Milan (36-Point Matching)
Multiple Kundali Analyzer
AI Patrika (LLM Interpretation)
Panchang (Hindu Calendar)
Hora & Choghadiya Muhurta
Consultation Booking
Astrologer Portal
Infrastructure

Deployment topology

FrontendNext.js 15, React 19, TypeScriptVercel Edge Network
Primary APINode.js 20, Express.js 4Azure App Service
Horoscope APINode.js, Express.jsAzure App Service
CMSStrapi (Headless)Strapi Cloud
DatabaseMongoDB 7.5+MongoDB Atlas
AI / LLMGPT-4oAzure OpenAI
PaymentsRazorpayRazorpay Cloud
Media CDNImageKitImageKit CDN
Outcomes

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.

Your project

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.

Start a conversationChat on WhatsApp