Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default defineConfig({
items: [
{ text: 'Server-side', link: '/guide/server-side-setup' },
{ text: 'Client-side', link: '/guide/client-side-setup' },
{ text: 'Starter kits', link: '/guide/starter-kits' },
],
},
{
Expand Down
5 changes: 3 additions & 2 deletions docs/guide/server-side-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Server-side rendering pre-renders your JavaScript pages on the server, allowing

## Add server entry-point

Next, we'll create a `app/frontend/ssr/ssr.js` file within the Rails project that will serve as the SSR entry point.
Next, we'll create a <Vue>`app/frontend/ssr/ssr.js`</Vue><React>`app/frontend/ssr/ssr.jsx`</React><Svelte>`app/frontend/ssr/ssr.js`</Svelte> file within the Rails project that will serve as the SSR entry point.

This file is going to look very similar to your regular inertia initialization file, except it's not going to run in the browser, but rather in Node.js. Here's a complete example.

Expand Down Expand Up @@ -196,6 +196,7 @@ Next, we need to update our Vite configuration to build our new `ssr.js` file. W
## Enable SSR in the Inertia's Rails adapter

```ruby
# config/initializers/inertia_rails.rb
InertiaRails.configure do |config|
config.ssr_enabled = ViteRuby.config.ssr_build_enabled
end
Expand Down Expand Up @@ -249,7 +250,7 @@ createInertiaApp({
== React

```js
// frontend/entrypoints/inertia.js
// frontend/entrypoints/inertia.jsx
import { createInertiaApp } from '@inertiajs/react'
import { createRoot } from 'react-dom/client' // [!code --]
import { hydrateRoot } from 'react-dom/client' // [!code ++]
Expand Down
42 changes: 42 additions & 0 deletions docs/guide/starter-kits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Inertia Rails Starter Kits

## Overview

Inertia Rails starter kits provide modern, full-stack scaffolding for building Rails applications with React, Vue, or Svelte frontends using Inertia.js. These starter kits are inspired by Laravel's starter kit ecosystem and offer the fastest way to begin building Inertia-powered Rails applications.

<script setup>
import { useData } from 'vitepress';

const { isDark } = useData()
</script>

<img :src="`/images/starter-kit-${isDark ? 'dark' : 'light'}.png`" title="Inertia Rails Starter Kit welcome screen">

## Key Features

- [Inertia Rails](https://inertia-rails.dev) & [Vite Rails](https://vite-ruby.netlify.app) setup
- [React](https://react.dev) frontend with TypeScript & [shadcn/ui](https://ui.shadcn.com) component library
- User authentication system (based on [Authentication Zero](https://github.com/lazaronixon/authentication-zero))
- [Kamal](https://kamal-deploy.org/) for deployment
- Optional SSR support

## Available Starter Kits

### React Starter Kit

**Repository:** [inertia-rails/react-starter-kit](https://github.com/inertia-rails/react-starter-kit)

### Vue Starter Kit

**Repository:** [inertia-rails/vue-starter-kit](https://github.com/inertia-rails/vue-starter-kit)

### Svelte Starter Kit

**Repository:** [inertia-rails/svelte-starter-kit](https://github.com/inertia-rails/svelte-starter-kit)

## Getting Started

Each starter kit repository includes detailed setup instructions. The typical workflow:

1. Clone the desired starter kit repository
2. Run `bin/setup`
Binary file added docs/public/images/starter-kit-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/images/starter-kit-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.