System Architecture

How AstroCapitalX is wired.

A layered architecture: WordPress marketing stays untouched for SEO, a custom Next.js portal houses the product, and a dedicated Astro Engine handles Vedic calculations. CRM and scheduling live inside our own database - no third-party silos.

① User Channels

PRESENTATION
🌐
Marketing Site
astrocapitalx.in
  • Blog · SEO · Press
  • Brochure pages
  • Stays on WordPress
👤
Customer Portal
app.astrocapitalx.in
  • Dashboard · Reports
  • Birth chart · Bookings
  • Payments · Watchlist
Astrologer Console
consultant.astrocapitalx.in
  • Live queue · Bookings
  • Earnings · Reviews
  • Availability manager
Admin Console
admin.astrocapitalx.in
  • CRM · Pipeline
  • Content · Rules engine
  • Analytics · Payouts

② Frontend Application

NEXT.JS 14 · VERCEL
React Components
App Router · RSC
  • Shared design system
  • SSR for SEO routes
  • Edge rendering
🔐
Auth & Sessions
Supabase Auth / Clerk
  • Email OTP · Phone OTP
  • Social login (Google)
  • Role-based: user/astro/admin
📡
Realtime Layer
Supabase Realtime · WS
  • Chat messages
  • Live queue updates
  • Market ticker push

③ API Gateway & Application Services

NEXT.JS API ROUTES · NODE.JS
👥
Users
  • Profile · Natal data
  • KYC · Preferences
  • Tags · Segments
💳
Subscriptions
  • Tiered plans
  • Wallet top-ups
  • Per-minute billing
📅
Bookings
  • Availability engine
  • Slot allocation
  • Reminders · Reschedule
💬
Messaging
  • Chat · Call · Video
  • Transcripts · Recording
  • Per-minute metering
📄
Content Delivery
  • Daily Tips · Reports
  • Signed PDF URLs
  • Access logs
📊
CRM & Pipeline
  • Lead → Paid funnel
  • Activity timeline
  • Internal notes
📣
Campaigns
  • Segmented email blasts
  • WhatsApp broadcasts
  • Push notifications
📈
Analytics
  • MRR · Churn · LTV
  • Funnel reporting
  • Cohort analysis

④ Proprietary Intelligence Layer

OUR MOAT
Astro Engine
Astronomy Engine · Node.js
  • Natal chart computation
  • Transit & aspect engine
  • Vimshottari dasha
  • 32+ yoga detectors
Signal Engine
Rule-based · JSON-tunable
  • Sector-rulership mapping
  • Transit scoring (weights)
  • Bull / Bear / Neutral
  • Admin-editable rules
Content Generator
LLM API · Astrologer review
  • Signal → prose
  • Daily/Weekly tips
  • Human-in-the-loop approval

⑤ Data Layer

SINGLE SOURCE OF TRUTH
🗄
Postgres (Supabase)
  • users, astrologers, admins
  • subscriptions, wallets
  • bookings, messages
  • charts, signals, reports
  • activity, notes, tags
Object Storage
S3 · Cloudflare R2
  • PDF reports
  • Chart images
  • Call recordings
  • Uploaded KYC docs
Redis Cache
Upstash
  • Session tokens
  • Market data cache
  • Rate limiting
  • Live queue state
🔍
Search
Postgres FTS / Meilisearch
  • Stocks · Reports
  • Astrologer directory
  • Knowledge base

⑥ External Integrations

BUY, DON'T BUILD
💰
Razorpay
  • UPI · Cards · Netbanking
  • Recurring subs
  • Settlement
💳
Stripe
  • International cards
  • USD pricing
  • Diaspora users
Postfix Relay
  • Transactional
  • Newsletter · Tips
  • DKIM / SPF
💚
LeadNXT
  • WhatsApp Business API
  • Templates · Broadcasts
  • Daily Tips channel
🎥
Google Meet / Zoom
  • Auto-generated links
  • Optional recording
  • Session transcripts
📆
Google Calendar
  • Astrologer sync
  • Bi-directional
  • Reminders
📉
Market Data
  • TradingView widgets
  • NSE / BSE feeds
  • Global market APIs
🤖
LLM APIs
  • Claude · GPT-4
  • Content drafts
  • Summarisation

Infrastructure & DevOps

CUTTING EDGE
Vercel
Next.js hosting · Edge
🟢
Supabase
Postgres · Auth · Storage
🟧
Cloudflare
CDN · DDoS · DNS · R2
🐙
GitHub Actions
CI/CD · Preview envs
📊
PostHog
Product analytics · Replays
🔔
Sentry
Error tracking · Monitoring
📋
Linear
Issue tracking · Sprints
💬
Slack
Team ops · Alerts
Key Data Flows

Two representative journeys.

🟢 Customer books a consultation

  1. User picks service + astrologer on booking.html
  2. Frontend queries /api/availability → Postgres availability_rules
  3. User picks slot → frontend posts to /api/bookings
  4. Service reserves slot, creates Razorpay order, returns checkout URL
  5. Razorpay webhook → activates booking, generates Google Meet link
  6. Postfix relay sends confirmation email; LeadNXT sends WhatsApp
  7. Cron schedules 24h + 1h reminder notifications
  8. Activity event logged to activity_timeline (visible in CRM)

✦ Daily cosmic forecast

  1. Cron fires at 05:30 IST
  2. Astro Engine computes transits for the day (in-house astronomy engine)
  3. Signal Engine applies rules → sector ratings + stock signals
  4. Content Generator drafts prose via LLM
  5. Senior astrologer reviews & approves via admin console
  6. Content published to daily_tips table
  7. Pro members get WhatsApp push at 06:00 IST
  8. Dashboard widgets pull latest signals via Supabase Realtime

🔒 Security, Privacy & Compliance

Data protection

Postgres RLS, encrypted-at-rest storage, TLS 1.3 everywhere, signed URLs for reports.

Regulatory

DPDP Act compliant, clear SEBI disclaimer (astrological research, not investment advice), 7-yr financial record retention.

Operational

SOC2-aligned controls, quarterly pen-tests, encrypted backups, RBAC with audit trails on admin actions.