|
1 | | -# README |
| 1 | +# Inertia Rails Vue Starter Kit |
2 | 2 |
|
3 | | -This README would normally document whatever steps are necessary to get the |
4 | | -application up and running. |
| 3 | +A modern full-stack starter application with Rails backend and Vue.js frontend using Inertia.js based on the [Laravel Starter Kit](https://github.com/laravel/vue-starter-kit). |
5 | 4 |
|
6 | | -Things you may want to cover: |
| 5 | +## Features |
7 | 6 |
|
8 | | -* Ruby version |
| 7 | +- [Inertia Rails](https://inertia-rails.dev) & [Vite Rails](https://vite-ruby.netlify.app) setup |
| 8 | +- [Vue.js](https://vuejs.org) frontend with TypeScript & [shadcn/vue](https://shadcn-vue.com) component library |
| 9 | +- User authentication system (based on [Authentication Zero](https://github.com/lazaronixon/authentication-zero)) |
| 10 | +- [Kamal](https://kamal-deploy.org/) for deployment |
| 11 | +- Optional SSR support |
9 | 12 |
|
10 | | -* System dependencies |
| 13 | +See also: |
| 14 | +- [React Starter Kit](https://github.com/inertia-rails/react-starter-kit) for Inertia Rails with React |
11 | 15 |
|
12 | | -* Configuration |
| 16 | +<a href="https://evilmartians.com/?utm_source=inertia-rails-vue-starter-kit&utm_campaign=project_page"> |
| 17 | +<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Built by Evil Martians" width="236" height="54"> |
| 18 | +</a> |
13 | 19 |
|
14 | | -* Database creation |
| 20 | +## Setup |
15 | 21 |
|
16 | | -* Database initialization |
| 22 | +1. Clone this repository |
| 23 | +2. Setup dependencies & run the server: |
| 24 | + ```bash |
| 25 | + bin/setup |
| 26 | + ``` |
| 27 | +3. Open http://localhost:3000 |
17 | 28 |
|
18 | | -* How to run the test suite |
| 29 | +## Enabling SSR |
19 | 30 |
|
20 | | -* Services (job queues, cache servers, search engines, etc.) |
| 31 | +This starter kit comes with optional SSR support. To enable it, follow these steps: |
21 | 32 |
|
22 | | -* Deployment instructions |
| 33 | +1. Open `app/frontend/entrypoints/inertia.ts` and uncomment part of the `setup` function: |
| 34 | + ```ts |
| 35 | + // Uncomment the following to enable SSR hydration: |
| 36 | + // if (el.hasChildNodes()) { |
| 37 | + // createSSRApp({ render: () => h(App, props) }) |
| 38 | + // .use(plugin) |
| 39 | + // .mount(el) |
| 40 | + // return |
| 41 | + // } |
| 42 | + ``` |
| 43 | +2. Open `config/deploy.yml` and uncomment several lines: |
| 44 | + ```yml |
| 45 | + servers: |
| 46 | + # Uncomment to enable SSR: |
| 47 | + # vite_ssr: |
| 48 | + # hosts: |
| 49 | + # - 192.168.0.1 |
| 50 | + # cmd: bundle exec vite ssr |
| 51 | + # options: |
| 52 | + # network-alias: vite_ssr |
| 53 | + |
| 54 | + # ... |
| 55 | + |
| 56 | + env: |
| 57 | + clear: |
| 58 | + # Uncomment to enable SSR: |
| 59 | + # INERTIA_SSR_ENABLED: true |
| 60 | + # INERTIA_SSR_URL: "http://vite_ssr:13714" |
| 61 | + |
| 62 | + # ... |
| 63 | + |
| 64 | + builder: |
| 65 | + # Uncomment to enable SSR: |
| 66 | + # dockerfile: Dockerfile-ssr |
| 67 | + ``` |
23 | 68 |
|
24 | | -* ... |
| 69 | +That's it! Now you can deploy your app with SSR support. |
| 70 | + |
| 71 | +## License |
| 72 | + |
| 73 | +The project is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). |
0 commit comments