Guides / Stacks
Launch a SaaS on Railway, Supabase, Cloudflare and OpenAI with Supabase Auth
This is the full setup for a product hosted on Railway with Supabase as the database, a domain from Cloudflare Registrar, sign-in through Supabase Auth, Stripe for payments, Resend for email and OpenAI as the model your app calls.
What this stack is
- Hosting: Railway (web service, worker and postgres in one project)
- Database: Supabase (postgres in its own project, pooled connection)
- Domain registrar: Cloudflare Registrar (at-cost pricing, dns included)
- DNS and CDN: Cloudflare
- Transactional email: Resend
- Mailbox for the domain: Forward to my inbox (cloudflare email routing, forward-only)
- Payments: Stripe (starts in test mode)
- Analytics: Google Analytics 4
- Search: Google Search Console
- Error tracking: Sentry
- Auth: Supabase Auth (needs supabase as the database)
- File storage: Cloudflare R2 (s3-compatible, no egress fees)
- AI provider: OpenAI
- Code: GitHub (required)
The 9 accounts you connect once
Each is connected with a token you create yourself. Tokens stay in your computer's keychain.
- GitHub: Administration: Read and write; Contents: Read and write; Metadata: Read-only
- Supabase: A personal access token
- Railway: Account token, or a token for one workspace
- Cloudflare: Zone: Zone: Edit; Zone: DNS: Edit; Account: Registrar: Domains: Admin; Zone: Email Routing Rules: Edit; Account: Email Routing Addresses: Edit; Account: Workers R2 Storage: Edit; Account: API Tokens: Edit
- Resend: Full access
- Stripe (test mode): Products, prices and coupons; Webhook endpoints; Customers and events; Checkout sessions and subscriptions
- Google (Analytics and Search Console): analytics.edit; siteverification; webmasters
- Sentry: project:read, project:write; project:admin; team:read, org:read
- OpenAI: A project key, restricted to the endpoints your app uses if you like
Before your first launch
Do these once at the providers, or a step will stop and tell you which one is missing.
- GitHub: If your repos live in an organisation: allow fine-grained tokens there (Organisation settings, Personal access tokens, Allow access via fine-grained personal access tokens). Without it the token cannot see the organisation.
- Supabase: Create an organisation if you have none. The free plan allows two active projects: pause or delete one if you already have two.
- Railway: Add a payment method and choose the Hobby plan ($5 a month). A trial account cannot attach a custom domain.
- Railway: Install the Railway GitHub app on the account that owns your repos, with access to all repositories, so Railway can deploy from them.
- Cloudflare: Add a card and make it the default payment method.
- Cloudflare: To buy domains: on the Registrations page press Create default contact and fill in your name, address, email and phone. Write the phone as +country code, a dot, then the number without its leading 0, for example +31.612345678. Cloudflare may email a verification link to that address: click it. There is no separate agreement to accept after that. Do not buy a domain there and skip its Create Registrar API token button: Shipyard's token needs more permissions than that one has.
- Cloudflare: Switch R2 on once. It uses the card above; the first 10 GB are free.
- Resend: The free plan holds one domain. If you already have one there, remove it or move to a paid plan, or the new domain is refused.
- Stripe (test mode): Nothing for test mode. To take real payments later, finish Stripe's business verification; it can take a day or more, so start it now.
- Google (Analytics and Search Console): Create a Google Analytics account and accept its terms. Shipyard adds a property to it; it cannot create the account.
- OpenAI: Add credit. A key on an account without credit passes the check and then fails in your app.
What a launch does, in order
- Checks the web address is free at Cloudflare Registrar, shows the price and waits for you to type buy.
- Creates the DNS zone at Cloudflare and the GitHub repository.
- Creates the Railway project and the Supabase project, and deploys on every push.
- Points the domain at the site and waits for the certificate.
- Verifies the sending domain at Resend and adds the DNS records for it.
- Creates the Stripe product, prices and webhook in test mode.
- Writes every key and ID into the host as environment variables, then checks the site, the database, email and the payment webhook.
- Hands your coding tool a build prompt that names this exact stack, including the OpenAI key the app reads.
What stays manual
- GitHub: Creating the GitHub account and verifying its email.
- Supabase: Creating the Supabase account and an organisation. The free plan allows two active projects and pauses a project after a week without use.
- Railway: Creating the Railway account and adding a payment method (Hobby plan, $5 a month).
- Cloudflare: Creating the Cloudflare account and verifying its email.
- Cloudflare: Clicking the confirmation link Cloudflare emails to your inbox before it forwards mail there.
- Resend: Creating the Resend account and verifying its email.
- Stripe (test mode): Creating the Stripe account.
- Stripe (test mode): Stripe business verification before live payments.
- Google (Analytics and Search Console): Creating the Google Analytics account and accepting its terms.
- Google (Analytics and Search Console): Google's review of the OAuth consent screen, if your app offers Google sign-in.
- Sentry: Creating the Sentry account.
- OpenAI: Creating the OpenAI account and adding credit.
- Product Hunt and every launch directory: you submit the post yourself. Shipyard prepares every field.
Start with this stack
After installing Shipyard, this one line opens the setup page with this stack already chosen:
shipyard start --stack S101000000002010Have this set up for you
Shipyard connects your accounts once and then does all of this for every new product, in about an hour.
See how it works