The Day My Fortune-Telling App Started Lying to Users
## The Bug That Shouldn't Exist
It's 10 PM. I'm staring at two fortune-telling charts that should be identical.
They're not.
One says "Tử Vi star is in Dần palace." The other says "Tử Vi star is in Thân palace."
That's 6 palaces apart. In a 12-palace system.
For context: In Vietnamese astrology (Tử Vi Đẩu Số), getting the Tử Vi star wrong is like building a house and placing the foundation in the wrong city. Everything else collapses.
And my app — LaKinh — has been confidently placing it in the wrong palace since day one.
## How Did We Get Here?
Let me rewind.
Three months ago, I decided to build LaKinh: a Tử Vi fortune-telling app. Not because I'm superstitious (I'm a designer-turned-developer, remember?), but because I saw a gap.
The gap: Every Tử Vi app uses ONE school of calculation. But there are THREE major schools:
- >Trung Châu (中州派) - Hong Kong style, most popular
- >Nam Phái (南派三合) - Traditional Taiwan, 108 stars
- >Bắc Phái (北派欽天) - Ancient imperial, flying stars
They calculate differently. Sometimes drastically.
Think of it like programming languages. JavaScript vs Python vs Rust. Same goal (making software), different philosophies.
My vision: Build the first app that supports ALL THREE schools. Let users compare. Let them decide.
Bold vision. Terrible execution.
Because first, I had to get ONE school working correctly.
## The Test That Changed Everything
Today, I decided to test LaKinh against Kabala.vn (a popular Vietnamese Tử Vi site).
Test case: Trương Bá Chi (張柏芝)
- >Born: May 24, 1980, 7:33 AM
- >Gender: Female
I plugged the data into both apps.
LaKinh said:
Cung Mệnh: Sửu
Tử Vi star: Thân palace
Thiên Cơ star: Mùi palace
Thiên Lương star: Sửu palace (life palace)
Kabala said:
Cung Mệnh: Sửu ✅
Tử Vi star: Thìn palace ❌
Thiên Cơ star: ??? ❌
Wait. They agreed on the Life Palace (Cung Mệnh). But the 14 major stars? Zero matches.
Not "slightly off."
Zero. Out. Of. Fourteen.
## The Panic Phase
As a designer-turned-developer, my first instinct was: "I broke something."
My second instinct: "Maybe I broke EVERYTHING."
I pulled up my conversation with Kai (my AI coding assistant — one of the 5 AI tools I use every day). We'd been building LaKinh together for weeks. Kai handles the complex calculations, I handle the design and user experience.
Me: "Kai, we have a problem. LaKinh doesn't match Kabala. At all."
Kai: "Let me check the calendar conversion first."
Kai verified: The lunar calendar conversion was perfect. The Can-Chi (天干地支) calculation was perfect. The Life Palace (Cung Mệnh) calculation was perfect.
But the 14 major stars? All wrong.
The culprit: The getTuViIndex() function.
The function that places Tử Vi — the MOST IMPORTANT star — in its palace.
I had implemented it based on... honestly, I don't remember. Some forum post? A half-translated PDF? The fog of "ship fast, iterate later"?
It was completely, mathematically, embarrassingly wrong.
## The Fix (With A Plot Twist)
Kai: "Let me compare LaKinh with iztro."
iztro is an open-source Tử Vi calculation library. Well-tested. Community-verified. The gold standard for Trung Châu school calculations.
Result: 0/14 stars matched.
LaKinh wasn't even calculating the same SCHOOL correctly.
The fix: Replace my DIY algorithm with iztro's proven formula.
Time to fix: 30 minutes (Kai wrote it in Claude Code CLI)
Result after fix: 14/14 stars matched iztro. Perfect.
But here's the plot twist:
When we went back to compare with Kabala... Kabala was also wrong.
Or more accurately: Kabala was using a DIFFERENT school. Possibly Nam Phái (southern school) instead of Trung Châu (middle school).
Which meant:
- >LaKinh was broken (fixed ✅)
- >Kabala wasn't wrong, just using different rules
- >My original vision — supporting multiple schools — was MORE important than I thought
Because even the "authoritative" sources don't agree!
## The Refactor (26 Minutes to Glory)
With LaKinh finally calculating correctly, Kai proposed something ambitious:
Kai: "Let's refactor the entire engine. Multi-school architecture. Right now."
Me: "Right now? It's 10 PM."
Kai: "Right now."
The plan:
- >Create a
SchoolEngineinterface - >Extract current logic into
TrungChauEngine - >Build a
TuViCalculatorfacade that can switch schools - >Make it extensible for future schools
Time estimate: 2-3 hours.
Actual time: 26 minutes and 57 seconds.
Kai (Claude Code CLI) churned out:
- >8 new files
- >Clean interfaces
- >Backward compatibility
- >Passing tests
I just watched. Occasionally saying "yes" or "that looks good."
This is what I mean by "designer lost in code land."
I can't write this kind of code at 10 PM. But with Kai? We ship production-ready architecture in under 30 minutes.
## What I Learned Today
### 1. Never Trust Your First Implementation
Especially when dealing with domain knowledge you don't fully understand.
I'm not a Tử Vi master. I'm a designer who thought "how hard can ancient astrology be?"
Answer: Harder than React state management.
### 2. AI as a Safety Net
Kai didn't just write code. Kai:
- >Caught my bugs
- >Researched the correct algorithms
- >Explained why my approach was wrong
- >Refactored the entire architecture
- >Made it extensible for the future
This is the AI workflow I've been evangelizing. Not "AI does everything." But "AI makes your ambitious ideas actually achievable."
### 3. Build in Public Means Showing the Bugs
I could've hidden this. Quietly fixed it. Pretended LaKinh was always correct.
But that's not the point.
The point is: Solo makers make mistakes. What matters is how fast you catch them.
Today I caught a critical bug. Fixed it. And refactored into something better than before.
In one evening.
That's the superpower.
### 4. Multiple Sources of Truth = Feature, Not Bug
The fact that different Tử Vi schools calculate differently? That's not a problem to solve.
That's the PRODUCT.
LaKinh will let you:
- >Choose your school (Trung Châu, Nam Phái, Bắc Phái)
- >Compare two schools side-by-side
- >Understand WHY they differ
- >Decide which you trust
Nobody else is doing this.
Because it's hard. And confusing. And most apps want to be "authoritative."
But I'm a designer. I know users don't want authority. They want understanding.
## What's Next for LaKinh
This Week:
- >Document Trung Châu school (done ✅)
- >Implement Nam Phái school (108 stars instead of 50)
- >Test against Kabala's "Nam Phái" mode
Next Week:
- >Implement Bắc Phái school (flying stars logic)
- >Build the comparison UI
- >Beta testing with real users
By End of Month:
- >Launch: "The world's first multi-school Tử Vi app"
- >Blog series: "How each school differs and why"
- >Open-source the engine (maybe?)
## The Meta Lesson
Here's what today really taught me:
Building with AI isn't about replacing skills. It's about AMPLIFYING ambition.
Three months ago, building a Tử Vi app seemed hard but doable.
Today, building a multi-school Tử Vi app — something that requires deep domain knowledge in THREE different calculation systems — is ALSO doable.
Same timeline. Same solo developer. Just with AI.
That's the unlock.
Not "AI writes code for you."
But "AI makes your impossibly ambitious ideas suddenly possible."
## For the Curious
If you're interested in:
- >How the Tử Vi calculation actually works
- >The architecture of the multi-school engine
- >The differences between the three schools
I'm planning a technical deep-dive series. Subscribe to my newsletter if you want it. (Or just build your own using Claude Code CLI — the tools are there.)
For now, I'm going to sleep.
Tomorrow, I teach an AI to calculate fortunes in THREE different ancient systems.
Because apparently, that's my life now.
Follow the build: Twitter/X @gianghaison | Newsletter: The AI Builder
Try LaKinh (when it's ready): lakinh.vn
P.S. If you're a Tử Vi master and I got something wrong... please tell me GENTLY. I'm just a designer trying my best. 🙏