DEV Community

Cover image for From Translation to Destiny: Using AI & Next.js to craft authentic Chinese Names
Reeves
Reeves

Posted on

From Translation to Destiny: Using AI & Next.js to craft authentic Chinese Names

Hey DEV community! 👋

Recently, I launched FindChineseName— an AI-powered cultural bridge that helps users find deeply meaningful, authentic Chinese names.

The internet is full of embarrassing translated names. I wanted to build a tool that doesn't just translate, but provides the cultural anatomy, Pinyin, historical clan backgrounds, and even incorporates ancient Chinese philosophy.

While the product is heavily cultural, the tech stack behind it is purely modern web. Here’s a breakdown of the architecture, the bottlenecks we hit when scaling to 10,000+ localized pages, and how we solved them.

🛠 The Tech Stack
Framework: Next.js (App Router)

Styling: Tailwind CSS (Focusing on a premium, oriental aesthetic)

Database: Neon Serverless Postgres + Prisma ORM

AI Engine: Google Gemini (for deep cultural reasoning and logic)

Monetization: Stripe Checkout

Deployment: Vercel

💥 Challenge 1: Melting the Database with 10,000 SSG Pages
Our goal was to build a massive Programmatic SEO net: 2000 boy names, 2000 girl names, 500+ surnames, and localizations in English, French, and German.

When deploying to Vercel, the build machine spun up 29 concurrent workers to generate static pages. Every single page ran a prisma.findMany() query to fetch related names for interlinking.

The result? A catastrophic out of memory (OOM) error on our Neon database. Vercel essentially DDoS'ed our own DB during build time.

The Fix:
Next.js unstable_cache saved the day. Instead of 11,000 database queries, we wrapped the database call in a cache function. The first worker fetched the list, and the remaining 10,999 pages read it directly from Vercel's file system cache. Build times plummeted, and DB CPU usage dropped to near zero.

FindChineseName Native Name Directory

🕷 Challenge 2: The "Double Locale" 404 Nightmare
Since we support multiple languages, our Next.js middleware handles routing (e.g., /fr/names/..., /de/names/...).

Checking our server logs, I noticed Googlebot getting trapped in a massive 404 maze with URLs like /fr/en/names/michael.

The Culprit: Our regex in the localized path generator was stripping /fr/ and /de/, but we forgot to strip the default /en/ prefix! When the or tags generated new URLs, they blindly prepended the new locale to the existing /en/ path.

The Fix:
A surgical update to our getPathWithoutLocale regex to aggressively clean ALL locale prefixes before appending the new one. Clean internal links mean our SEO link equity is no longer bleeding out!

FindChineseName Free English-to-Chinese Name Generator

🧠 Challenge 3: AI as a Cultural API & Digital Artist
Standard translation APIs like Google Translate are terrible for names. Translating "David" directly might give you a phonetic match, but it lacks soul.

We prompt-engineered Gemini to act as a linguistic expert. It breaks down names into "Character Anatomy," providing the radical and historical context. But we wanted to go further into monetization.

We built a $4.99 Premium Service that acts as a digital fortune teller. Instead of basic translations, it uses AI to perform a deep Bazi and Five Elements (Wu Xing) destiny analysis. It generates 3 hand-crafted, premium name options perfectly aligned with the user's destiny, along with a beautiful, high-resolution custom digital seal (stamp) ready for social media.

FindChineseName Premium Chinese Name Generator

🚀 What's Next? (And a small request!)
We just successfully scheduled our launch on Product Hunt!

I would love for you to try out the free generators and the dictionary: FindChineseName.com

Feedback wanted: How does the UI feel? If you have experience with Next.js i18n, how do you handle your localized sitemaps?

Let me know in the comments!

Top comments (0)