This is a starter template for Rails developers who want to integrate Svelte into their applications without setting everything up from scratch. It provides a structured foundation with essential tools and libraries for building modern, reactive UIs within a Rails ecosystem.
- Svelte - A modern JavaScript framework for building user interfaces.
- Ruby on Rails - A powerful web application framework for building server-side applications.
- Inertia.js - Enables single-page applications using classic Rails routing and controllers.
- ShadcnUI - A collection of UI components for Svelte.
- Tailwind CSS - A utility-first CSS framework for building custom designs.
- Phosphor Icons - A versatile icon library for user interfaces.
- JS Routes - A library for generating JavaScript routes in Rails applications.
- Rails Authentication - Built-in authentication using the default Rails 8 authentication system.
- Vite - A fast and modern frontend bundler.
- Use this repository as a template.
- Clone your new repository:
git clone git@github.com:georgekettle/rails_svelte.git <your-repo-name> cd <your-repo-name>
- Install dependencies:
bundle install npm install
- Setup the database:
rails db:setup
- Start the development server:
bin/dev
- Open in browser at localhost:3100
This template integrates Svelte with Rails using Inertia.js to manage front-end routing while keeping Rails' backend structure. It uses Vite for asset bundling, and all frontend code is located in the app/frontend directory. Place assets such as images and fonts inside the app/frontend/assets folder.
Feel free to fork this repository and submit pull requests with improvements, fixes, or additional features.
This project is open-source and available under the MIT License.
