A project that integrates R Shiny with a modern UI framework using Svelte and ViteJS.
This project combines the power of R Shiny for server-side computations with Svelte for creating modern, interactive front-end user interfaces. The development setup is powered by ViteJS for fast bundling and hot-module reloading.
Ensure you have the following installed:
Clone the repository and install dependencies:
# Clone the repository
git clone https://github.com/StellarFX/shiny-svelte.git
# Navigate into the project directory
cd shiny-svelte
# Install dependencies
yarn install
yarn dev
Starts both the UI and Shiny server in development mode. This allows you to develop the front-end and back-end simultaneously with hot reloading.
yarn dev:ui
Starts the Vite development server for the Svelte UI.
yarn dev:shiny
Launches the Shiny server by running the global.R
script.
yarn build:ui
Builds the Svelte UI for production.
yarn preview
Previews the production build locally.
yarn check:ui
Runs static type checks for the Svelte components and TypeScript files.Start the development servers:
yarn dev
This will start the UI and Shiny servers in parallel.
Open the application in your browser:
http://localhost:7000
http://localhost:5173
Make changes to the Svelte components or R scripts, and the application will reload automatically.
Build the UI for production:
yarn build:ui
The production-ready files will be in the dist
directory.
Deploy the dist
directory alongside your Shiny server for full integration.