Full-Stack · AI SaaS · Music Generation · 2 weeks

AI Music SaaS — hitdlaciebie.pl

Personalized AI-generated songs in Polish — from a one-line idea to a finished track with vocals, instrumentation, and production. Two-model lyrics pipeline (Gemini 2.5 Flash + Claude Sonnet 4.6), four music APIs tested, Suno V5.5 in production. Full-stack SaaS with Shopify payments, magic link auth, personal cabinet. Shipped in 2 weeks.

2 weeksFrom idea to live paying product — full SaaS, not a prototype
2-modelLyrics pipeline: Gemini 2.5 Flash for structure, Claude Sonnet for quality
4 APIs testedEvaluated Suno, Udio, and others — Suno V5.5 won on quality and reliability
Full-stackPayments, auth, personal cabinet, VPS hosting — complete production system

How it's built

  • Two-model lyrics pipeline: Gemini 2.5 Flash generates structure and rhyme candidates, Claude Sonnet 4.6 refines for quality and emotional impact.
  • Suno V5.5 API for music generation — selected after testing 4 different music APIs.
  • Shopify for payments — embedded checkout without custom payment infrastructure.
  • Magic link auth — no passwords, frictionless for non-technical users.
  • Personal cabinet: order history, track downloads, status tracking.

Key choices

  • Tested Suno, Udio, and two others — chose Suno V5.5 for consistent output quality at scale.
  • Two LLMs for lyrics instead of one — Gemini is faster and cheaper for drafts, Claude is better at emotional nuance for final output.
  • Shopify over custom payments — 2 weeks is not enough time to build payment infrastructure properly.
  • VPS over serverless — predictable costs for a music generation workload that has long API response times.

Capabilities shown

  • End-to-end full-stack AI product delivery — from idea to paying customers in 2 weeks.
  • Multi-LLM pipeline design: using different models for different strengths in the same workflow.
  • Third-party API integration: music generation, payments, auth — combined into one product.
  • Production-grade: real users, real payments, real infrastructure.

Need a SaaS product?

  • This project shows I can take an AI product from zero to production fast.
  • If your business needs a customer-facing AI tool — I can build the full stack.
  • Custom AI SaaS, internal tools, client-facing automation platforms.
  • Germany and EU focus — GDPR-aware architecture from the start.

Two-Stage LLM Pipeline & Asynchronous Audio Generation Architecture

Two-tier prompt decomposition for creative lyrics: Generative audio tools like Suno require tightly structured lyrical prompts with verse, chorus, and bridge breakdowns, tagged musical cues, and strict rhyme meters. Standard single-pass prompts often yield either melodically rigid or emotionally generic lyrics. This architecture divides lyric generation into two coordinated LLM stages: Gemini 2.5 Flash acts as a high-speed idea expander, producing four distinct lyrical structures, meter options, and genre hooks in under 500ms. Claude Sonnet then reviews the selected candidate, elevating emotional subtlety, refining syllable stress for vocal cadence, and ensuring pristine genre fit.

Non-blocking asynchronous audio workers: Generative audio synthesis runs between 25 and 65 seconds per track. Holding open synchronous HTTP client connections on mobile browsers leads to client timeouts and dropped requests. The backend leverages an asynchronous job queue backed by PostgreSQL task states and webhook callbacks. When the Suno API completes audio rendering, the asset is automatically mirrored to persistent storage, and the client browser receives an instant notification via SSE (Server-Sent Events) without full-page reloads.

Transactional idempotency & token accounting: Managing paid customer generations requires rock-solid financial safeguards. The system implements an append-only token ledger in PostgreSQL where generation attempts and Shopify order webhooks are cryptographically validated with HMAC signatures. Webhook deduplication guarantees that customers are never charged twice for retry attempts or interrupted streaming sessions.

Frequently Asked Questions

How long does it take to build a full-stack AI SaaS product from scratch?
This AI Music SaaS was built and shipped to production in 2 weeks using AI-assisted engineering workflows. The architecture includes a Next.js 14 frontend, Python API backend, dual-LLM lyric processing (Gemini 2.5 Flash + Claude Sonnet), Suno V5.5 music generation, Shopify embedded checkout, and magic link authentication.
What AI models power the music and lyrics generation pipeline?
The system combines a two-stage LLM workflow: Gemini 2.5 Flash handles fast structural ideation and rhyme drafting, while Claude Sonnet refines nuance and poetic cadence. The final conditioned prompt feeds into the Suno V5.5 audio engine for studio-quality multi-instrumental arrangement and vocal rendering.
How does the platform handle long-running generative audio requests?
Because audio synthesis requires 30–60 seconds, the backend decouples generation into asynchronous job queues. The client receives an instant task ID, and background workers listen for API webhooks. Once rendering is complete, real-time SSE updates notify the frontend, eliminating connection drops.
Can this architecture be adapted for other generative AI media products?
Yes. The decoupling of synchronous user sessions from long-running background generative tasks, combined with webhook-driven payment ledgers, applies directly to AI video synthesis, podcast generation, automated avatar production, and large-scale marketing asset creation.

Tools used

Next.js 14TypeScriptGemini 2.5 FlashClaude Sonnet 4.6Suno V5.5 APIPostgreSQLShopifyDockerGoogle Cloud Run
Need a full-stack AI product built fast?

I build end-to-end AI SaaS products and internal tools for businesses in Germany and EU. From idea to production — no handoffs, one engineer. Let's talk.

Contact me Read the article All projects
← Back to projects