Deploy Generative Media Starter
Ship with auth, credits, storage, and generation.
generative-media-starter
Just deployed
Deploy and Host Generative Media Starter on Railway
Generative Media Starter is a deployable SaaS baseline for BabySea-powered media generation with auth, prepaid credits, and private output storage. It gives product builders a working Next.js app with Supabase Auth, Stripe Checkout, a credit ledger, BabySea SDK execution, and signed Supabase Storage previews.
Use it when you need the billing and settlement path before building your own creative surface. The starter sells one-time credit packs, grants credits through verified Stripe webhooks, reserves credits before dispatch, and charges or refunds the reservation after the generation reaches a terminal state.
About Hosting Generative Media Starter
The user signs in through Supabase Auth and enters a private dashboard that routes them to Generate and Billing. Supabase owns the user records, balances, generations, Stripe customer links, and ledger entries while service-role keys, Stripe secrets, and the BabySea API key remain server-side.
In Billing, the user chooses Starter, Builder, or Production credit packs. The app creates a Stripe Checkout session, then the webhook verifies the completed payment and grants credits idempotently through grant_paid_credits, leaving an auditable ledger row.
In Generate, the app loads the BabySea model schema, shows normalized fields such as prompt, ratio, output format, output count, and provider order, then checks the current balance against the configured generation cost. On submit, the server rate-limits the user, creates a generation record, and reserves credits atomically before dispatching to BabySea.
When BabySea returns an output, the server copies the asset into private Supabase Storage and creates a signed display URL for the dashboard. The ledger then records a charge for successful work or a refund for failed work, so the UI shows both the generated media and the complete balance history in one flow.
Common Use Cases
- A signed-in generation dashboard backed by Supabase Auth and user-owned records.
- A BabySea SDK generation form using the
bfl/flux-schnellmodel and normalized schema fields. - Prepaid Stripe Checkout credit packs for Starter, Builder, and Production balances.
- A Supabase credit ledger with grant, reserve, charge, and refund events.
- Private generated media storage with signed URLs shown in the dashboard.
Dependencies for Generative Media Starter Hosting
- Next.js for the signed-in dashboard, route handlers, and server actions.
- Supabase for Auth, Postgres tables, database functions, RLS, and the private generated-media bucket.
- Google OAuth for dashboard sign-in through Supabase Auth.
- BabySea for server-side SDK execution with
BABYSEA_API_KEY. - Stripe for Checkout, webhook verification, and one-time credit pack prices.
- Upstash for Redis-backed generation rate limiting.
- Sentry for optional production observability.
- For hosting, you can deploy using Netlify, Railway, Render, or Vercel.
Deployment Dependencies
https://github.com/babysea-community/generative-media-starter
Implementation Details
[Include any code snippets or implementation details. This section is optional. Exclude if nothing to add.]
Why Deploy Generative Media Starter on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Generative Media Starter on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
generative-media-starter
babysea-community/generative-media-starterBABYSEA_API_KEY
STRIPE_SECRET_KEY
SUPABASE_SECRET_KEY
NEXT_PUBLIC_SITE_URL
STRIPE_WEBHOOK_SECRET
UPSTASH_REDIS_REST_URL
NEXT_PUBLIC_SUPABASE_URL
UPSTASH_REDIS_REST_TOKEN
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY
