supabase-rb-rb
Inertia + React starter

Inertia + React starter

Rails 8.1 + Inertia + React 19 + TypeScript + Vite + Tailwind v4 + shadcn/ui starter kit, with Supabase Auth via supabase-rails in :web mode and optional Inertia SSR.

The Inertia + React starter is a Rails 8.1 monolith with a typed React frontend served through Inertia.js. Pages are React components rendered against props the Rails controller hands over; navigation goes through Inertia's XHR-driven page swaps. Auth is owned by supabase-rails in :web mode — the browser holds an encrypted sb-session cookie, not a token, and every request reaches the React tree with auth.user already populated.

What is it

A Rails 8.1 + React 19 starter pre-wired for a productive day-one experience:

  • Inertia Rails — controllers render inertia: "pages/<name>" instead of ERB; React resolves the component and renders against props. No separate API tier, no client-side router.
  • Vite + React + TypeScript — Vite drives dev (HMR), build, and (optional) SSR. React 19 with the React Compiler preset turned on, TypeScript across the entire app/javascript/ tree.
  • shadcn/ui (new-york) — full components.json is checked in. @/components/ui/* ships ~25 primitives (button, card, dialog, dropdown-menu, field, input, sidebar, sonner, etc.) built on Radix UI + Tailwind v4 + class-variance-authority.
  • Cookie-backed authsupabase-rails in :web mode issues an encrypted sb-session cookie and exposes Current.user on every controller; an InertiaController parent forwards it to React as a shared auth.user prop.
  • Typed routesTypelizer generates app/javascript/routes/*.ts from Rails routes.rb, so dashboard.index().url, sessions.create(), and settingsPasswords.show() are type-checked.
  • Optional Inertia SSR — shipped wired but disabled. Flip config.ssr_enabled = true and the Puma inertia_ssr plugin boots the Node renderer in-process.
  • Local Supabase — a checked-in supabase/config.toml lets supabase start boot a full Auth + Postgres + Studio + Mailpit stack in Docker.
  • Kamal deployDockerfile and config/deploy.yml are scaffolded; the SSR bundle is gated by a SSR_ENABLED build arg.

Who it's for

Pick this kit when:

  • You want a typed React frontend (TypeScript + shadcn) but no separate Rails API + Next.js split.
  • You're happy with Rails owning routing, controllers, and props — and React owning the view layer.
  • You want Supabase Auth to handle the identity surface (email + password, sign-up with confirmation, password reset, magic-link) and not write that code yourself.
  • You're comfortable holding session state in an encrypted cookie rather than an Authorization header — the browser never sees the Supabase access token.

If you'd rather render server-side HTML with Hotwire and skip the JS build step entirely, look at the Hotwire starter. If your client is a mobile or third-party SPA, the Rails API starter is the JWT-only counterpart.

What's included

LayerWhat ships in the box
Authsupabase-rails in :web mode, Authentication concern, parent InertiaController shares auth.user to React
Auth UIpages/sessions/new.tsx, pages/registrations/new.tsx, pages/passwords/{new,edit}.tsx, pages/otp/{new,verify}.tsx, wrapped in AuthCardLayout
RoutesPublic /, authenticated /dashboard, /settings/{email,password,appearance}, plus the gem's supabase_authentication_routes
React treeapp/javascript/{pages,components,layouts,hooks,lib,routes,types}/ with shadcn/ui primitives under components/ui/
Typed routesTypelizer regenerates app/javascript/routes/*.ts on every server reload
BuildVite + @vitejs/plugin-react + @tailwindcss/vite + @inertiajs/vite + rails-vite-plugin; React Compiler preset enabled
DataSQLite for primary, cache, queue, cable; Supabase Postgres holds auth.users (no domain table out of the box)
TestsRSpec request specs under spec/requests/; system-test infrastructure (Capybara + Selenium) is configured but not exercised by shipped specs
DeployDockerfile (multi-stage, SSR-gated by build arg) and Kamal config/deploy.yml

What's not included

The kit stops short of two large surfaces so you can grow into them:

  • MFA / passkeys / sudo mode. Same shape as the other kits — none of rotp, webauthn, bcrypt are in the Gemfile, and the settings tree has no security section.
  • An ActiveRecord User model. Current.user is a value object built from the verified Supabase claims; InertiaController#current_user_props shapes it for React as auth.user. Run bin/rails generate supabase:user_model when you need a host-app users table.
  • A domain resource. Unlike the Hotwire kit's /notes view, the React dashboard ships empty — three placeholder cards from @/components/placeholder-pattern. Add your own as your first feature; the Architecture and Customization pages walk the pattern.
  • End-to-end test harness. RSpec request specs run against SupabaseAuthHelpers stubs (in spec/support/). There's no bin/e2e equivalent — Inertia request specs verify the JSON props contract, which is usually enough.
  • Per-target deploy guides. Dockerfile and Kamal config are generic; turning them into a Fly / Render / ECS flow is up to you.
  • Production observability. Logs go to STDOUT. Wire APM (Sentry, Datadog, OpenTelemetry) when you need it.

Next

Repository

On this page