Menu

Zero-Backend Astronomy & 1080x1350 Canvas Share Cards in Next.js (Plus a 180 Geometry Bug We Caught)
📰

Zero-Backend Astronomy & 1080x1350 Canvas Share Cards in Next.js (Plus a 180 Geometry Bug We Caught)

DEV Community: nextjs·Felix M·about 7 hours ago
#KRbprFrQ
#devtonextjs#devto#dev#math#const
Long article (1362 words) — no AI summary yet.
Reading 0:00
15s threshold

When building interactive consumer micro-tools in Next.js, the fastest way to kill both profit margin and UX is putting simple deterministic math or share-card rendering behind a serverless function. Cold starts add 800ms–2s of spinner lag, Puppeteer/Satori image endpoints burn compute, and mobile users bounce before the result even appears.

While shipping three new client-side interactive tools on our site—a moon phase soulmate calculator , a soulmate by birth date calculator , and an interactive avoidant no-contact stage locator —we moved 100% of the calculation, SVG visualization, and 1080×1350 PNG share-card export into pure browser TypeScript .

Here are four real engineering lessons (including a subtle 180° geometry bug we only caught through headless Chrome visual screenshots).

1. Real Lunar Elongation in ~25 Lines of Pure TypeScript (No API Calls)

Many birthday moon tools estimate lunar phases by taking (daysSinceKnownNewMoon % 29.53) .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.