---
title: "Deploy SaaS Starter with React, Hono and Better Auth"
description: "Get accounts and organisations with Turborepo, Drizzle and Postgres"
category: "Starters"
url: https://railway.com/deploy/saas-starter-with-react-hono-and-better-
---

# Deploy SaaS Starter with React, Hono and Better Auth

Get accounts and organisations with Turborepo, Drizzle and Postgres

**[Deploy SaaS Starter with React, Hono and Better Auth on Railway](https://railway.com/template/saas-starter-with-react-hono-and-better-)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/saas-starter-with-react-hono-and-better-/manifest.json

- **Creator:** withSeismic
- **Category:** Starters
- **Total deploys:** 1

## Template content

### web

- **Source:** https://github.com/dougwithseismic/react-saas-starter
- **Health check:** /
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### server

- **Source:** https://github.com/dougwithseismic/react-saas-starter
- **Health check:** /health/ready

## Documentation

# Deploy and Host SaaS Starter with React, Hono and Better Auth on Railway

Start with a React SPA on Vite, a separate Hono API and Better Auth accounts and organisations. This open source TypeScript starter includes Drizzle on Postgres and shared Zod contracts in a Turborepo monorepo. I start my SaaS products from it. Read [the starter write-up](https://withseismic.com/library/starter?utm_source=railway) or [get the source on GitHub](https://github.com/dougwithseismic/react-saas-starter).

## About Hosting SaaS Starter with React, Hono and Better Auth

Deploy with no input: the template creates `Postgres`, `server` and `web` on one private network, generating the database password and `BETTER_AUTH_SECRET`. Caddy serves the SPA from `web`, the only public domain, and proxies requests to the private Hono API. Auth cookies stay first-party on one HTTPS origin, with no CORS setup. Before every deploy, `server` runs database migrations; `/health/ready` checks database connectivity. Sign-up, sign-in, sessions and organisations work immediately. Add the Loops variables for verification, password reset and invitation emails; these cannot be delivered until configured. Add PostHog variables on `server` and `web` for analytics. Redeploy `web` after changing its compiled-in analytics variables.

## Common Use Cases

- **SaaS products:** accounts and organisations; no billing or payments.
- **React SPAs:** Vite frontend with a separate API.
- **Coding agents:** `AGENTS.md` and a copyable setup prompt.

## Dependencies for SaaS Starter with React, Hono and Better Auth Hosting

- `Postgres`: Postgres 18 with SSL and a volume.
- `server`: Node.js, Hono and Better Auth.
- `web`: Caddy and the built React SPA.
- Optional: Loops and PostHog accounts.

### Deployment Dependencies

- [Starter write-up](https://withseismic.com/library/starter?utm_source=railway)
- [GitHub repo](https://github.com/dougwithseismic/react-saas-starter)
- [Railway setup](https://github.com/dougwithseismic/react-saas-starter/blob/main/deploy/RAILWAY.md)
- [Free library](https://withseismic.com/library?utm_source=railway)
- [withSeismic](https://withseismic.com/?utm_source=railway)

### Implementation Details

Public domain → `web` → `server`: `/api`, `/docs`, `/openapi.json`, `/health`.

Custom domain:

1. Add it to `web`.
2. Set `BETTER_AUTH_URL` and `APP_ORIGIN` on `server` to your domain, for example `https://app.example.com`.
3. Redeploy `server`.

Optional variables on `server`:

```env
LOOPS_API_KEY=
LOOPS_RESET_PASSWORD_TEMPLATE_ID=
LOOPS_VERIFY_EMAIL_TEMPLATE_ID=
LOOPS_INVITATION_TEMPLATE_ID=
POSTHOG_PROJECT_KEY=
POSTHOG_HOST=
```

On `web`, add `VITE_POSTHOG_PROJECT_KEY` and `VITE_POSTHOG_HOST`; redeploy `web`.

## Why Deploy SaaS Starter with React, Hono and Better Auth on Railway?

<!-- Recommended: Keep this section as shown below -->
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 SaaS Starter with React, Hono and Better Auth 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.
<!-- End recommended section -->

## Similar templates

- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [caring-vibrancy](https://railway.com/deploy/caring-vibrancy) — Deploy and Host caring-vibrancy with Railway
- [Appsmith](https://railway.com/deploy/appsmith-1) — Low-code platform for internal tools, dashboards, and admin panels.

Open this page in a browser: https://railway.com/deploy/saas-starter-with-react-hono-and-better-
