svelte-firebase-starter Svelte Themes

Svelte Firebase Starter

Currently converting to Svelte Kit. Template for Svelte apps with firebase for a basic social network website.

Why

An SPA example for people to quickly start churning out fullstack apps in Svelte with firebase. The Svelte app uses JavaScript while the firebase functions use TypeScript

Videos!

Best way to get up to speed is to watch these videos:

IMAGE ALT TEXT HERE

svelte app

This is a project template for Svelte apps. It lives at https://github.com/sveltejs/template.

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

npx degit sveltejs/template svelte-app
cd svelte-app

Note that you will need to have Node.js installed.

Get started

Install the dependencies...

npm install

...then start Rollup:

npm run dev

Navigate to localhost:5000. You should see your app running. Edit a component file in src, save it, and reload the page to see your changes.

By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0.

Building and running in production mode

To create an optimised version of the app:

npm run build

You can run the newly built app with npm run start. This uses sirv, which is included in your package.json's dependencies so that the app will work when you deploy to platforms like Heroku.

Running emulators

Assuming you have firebase emulation for Realtime DB and Cloud functions you can pass this env variable in to run EMULATION="true" npm run dev

And your production data will not be touched

You can also get chrome to open up with no security as there are some cars issues with local emulation or functions with npm run chrome. You can then test the local app with the new Chrome window

Top categories

Loading Svelte Themes