Skip to content

sachinbhutani/svelte-cr

Repository files navigation

Svelte-cr

Starter template for Svelte frontend apps with Crystal-Lang Kemal backend server.

Requirements

NodeJs - Install

Crystal-Lang - Install

Get started

Create a new project based on this template using degit and install the dependencies...

npx degit sachinbhutani/svelte-cr svelte-cr
cd svelte-cr
npm install
shards install

...then start Kemal server and Rollup in two different terminals

Terminal 1: (To run the kemal/crystal server)

crystal run src/svelte-cr.cr --progress

Terminal 2: (To build and hot reload svelte components)

npm run dev  

Navigate to localhost:3000. You should see your app running. All svelte component live in client directory. Save any changes live-reloading. All Crystal code lives in src directory. To rebuild Crystal code use crystal run after saving your changes. All static files are served from public direcotry. Including the JS code compiled by Svelte Compiler.

screenshot

Building and running in production mode

To create an optimised version of the app:

npm run build
crystal build src/svelte-cr.cr --release

Built With

Crystal

Kemal

Svelte

YRV

Bulma

Change Log

v0.1.0: Initial Release