nextjs, #ai, #database, #webdev
This is the technical journey of Growl, a small SaaS I built to automate marketing for local businesses. As a self-taught creator, my stack is optimized for speed, low cost, and AI-assisted development:
Frontend: Next.js 14 App Router + Tailwind CSS
Database & Auth: Supabase (PostgreSQL)
AI: Gemini 1.5 Flash (Primary) ➔ Groq Llama 3 (Fallback)
Payments: Stripe Checkout Sessions
It sounds clean, but here are the three real failures we encountered during development and how we fixed them.
Failure 1: AI Cut Off Mid-Sentence (500 Server Errors)
The Problem: The AI would generate a weekly marketing plan, but the JSON output would occasionally stop abruptly in the middle of a paragraph, causing the frontend parser to crash.
The Struggle: I thought my API code was broken and spent two days rewinding commits.
The AI Solution: The maxOutputTokens limit was set too low (1,500). We bumped it to 3,000 and injected a structural language key (_language: "en") directly into the JSON schema template. Now the output is stable and complete.
Failure 2: The Shared API Key Rate Limit
The Problem: I shared a single Groq and Gemini API key across my local testing environment, the main app, and my background social media automation scripts. If I tested too heavily during the day, the automated posts would fail at night due to 429 rate limits.
The Struggle: My background scripts were silently failing, and I only noticed when followers asked why we stopped posting.
The AI Solution: We split the API keys into separate environments and rewrote the AI tasks to execute sequentially with a 300ms throttle.
Failure 3: The Stripe checkout language mismatch
The Problem: English users visiting the pricing page were redirected to JPY payment links showing Japanese descriptions ("LINEで届く..."). Payment Links from Stripe do not dynamically translate based on browser locale.
The Struggle: I was losing potential global signups because the payment page looked untrustworthy to non-Japanese speakers.
The AI Solution: We replaced Stripe Payment Links with the Stripe Checkout Sessions API (/api/create-checkout). We now pass the user's browser language locale dynamically to Stripe, showing USD and English to global users.
The Future
Solo development is a series of small, daily failures. The key is setting up robust error fallbacks (like Gemini automatically falling back to Groq Llama 3 when it hits a rate limit).
Check out the working code in action: growl-ai.com
Top comments (0)