Psst — looking for a shareable component template? Go here --> sveltejs/component-template


SAFE Network Tutorial app using Svelte

This is a version of the SAFE NodeJS Tutorial app using the Svelte web app framework. It is based on the Svelte 'hello world' template at https://github.com/sveltejs/template.

Prerequisites

  • you will need to have Node.js v8.15+ for this to work with SAFE Browser.
  • before trying this you should first go through the SAFE Node.js Web Tutorial to ensure you have all pre-requisites

Get started

To create a new project based on this template using degit:

npx degit theWebalyst/safetutorial-svelte safe-svelte-app
cd safe-svelte-app
npm install
cd safe-svelte-app
npm install

...then start Rollup:

npm run dev

Start SAFE Browser (dev build) and navigate to localhost:5000. You should see your app running. Edit a component file in src, save it and the page will reload to show your changes.

Deploying to SAFE Network

  1. Create a production build (in ./public):
   npm run build
  1. Use the Maidsafe Web Hosting Manager or similar application to create a public name and service, and then upload the contents of ./public to your web service folder.

  2. Open your website/app in SAFE Browser

Deploying to the web

With now

Install now if you haven't already:

npm install -g now

Then, from within your project folder:

now

As an alternative, use the Now desktop client and simply drag the unzipped project folder to the taskbar icon.

With surge

Install surge if you haven't already:

npm install -g surge

Then, from within your project folder:

npm run build
surge public

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes