DEV Community

Cover image for How I Built a Lightning-Fast Eastern Astrology & Bazi Engine with Astro
Fedora
Fedora

Posted on

How I Built a Lightning-Fast Eastern Astrology & Bazi Engine with Astro

If you've ever explored traditional Eastern metaphysics (like Four Pillars of Destiny / Bazi, Zi Wei Dou Shu, or Zhougong Dream Interpretation), you've probably noticed a common problem:

Almost every astrology and fortune-telling site on the web today is painfully slow, riddled with invasive pop-up ads, clunky forms, and forced paywalls.

As an engineer fascinated by algorithmic culture and psychology, I wanted to fix this. I set out to build a modern, aesthetic, and privacy-first web platform: FunTestHub (funtesthub.com).

Here is a quick look behind the architecture and how I approached the engineering challenges.


1. Why Astro for a Heavy Content & Calculation Matrix?

When building personal tools like Bazi Natal Chart and 80-year Life Energy Curves, the core priority was speed and zero tracking bloat.

Traditional single-page apps (SPAs) often ship megabytes of JavaScript just to render static tables and basic forms. With Astro:

  • Island Architecture: All static text, tables, and SEO Schemas (FAQPage, Article) are pre-rendered into pure HTML at build time.
  • Zero JS by default: Pages load instantaneously across global CDNs (Cloudflare Pages), achieving near-perfect 100/100 Lighthouse performance scores.
  • Interactive Islands: Dynamic features (like interactive divination and date converters) only hydrate lightweight JavaScript islands when needed.

2. Modeling 80-Year Life Energy Curves

One of the most complex modules was calculating 80-year life curves. In classical Bazi theory, each year's stem-branch interacts with a person's natal chart across four fundamental dimensions:

  1. Spirit / Mental Resilience (精神)
  2. Wealth & Resource Capacity (财富)
  3. Fame & Recognition (名声)
  4. Emotion & Relationships (感情)

Instead of relying on heavy third-party canvas or charting libraries that would tank Core Web Vitals, I generated inline responsive SVGs directly during build time. This ensures instant rendering with zero client-side layout shifts (CLS).


3. Privacy-First Philosophy

Most spiritual or personality test websites demand your email, phone number, or date of birth stored in opaque databases.

At FunTestHub:

  • No account registration required.
  • Zero tracking of private data.
  • Everything runs transparently and is 100% free.

Try it Out & Feedback Welcome!

You can check out the live project at:

👉 https://funtesthub.com

Whether you are curious about your Bazi chart, exploring your 2027 zodiac energy, or just taking a quick MBTI assessment, I'd love to hear your feedback on the UI/UX and calculation speed!

What other traditional cultural algorithms would you like to see modernized with web technologies? Let me know in the comments below!

Top comments (0)