sveltekit-storefront Svelte Themes

Sveltekit Storefront

Starter project to help you create your Majel or Vendure-powered ecommerce application

SvelteKit eCommerce Store Starter App for Majel or Vendure

Currently, this starter uses Braintree checkout only. Your backend must be configured for Braintree payments.

Creating a project

# install degit
npm install -g degit

# create a new project in my-app
degit https://github.com/pevey/sveltekit-storefront.git my-app

Installing packages

cd my-app
yarn install

Configuring a project

mv .env.example .env
  • Open .env and add any required settings

  • To make development a bit easier, you can change the urls in the EmailPlugin configuration options in majel-config.ts or vendure-config.ts to match the default SvelteKit dev url: http://localhost:5173:

majel-config.ts

verifyEmailAddressUrl: 'http://localhost:5173/verify',
passwordResetUrl: 'http://localhost:5173/auth',
changeEmailAddressUrl: 'http://localhost:5173/account'

Run Codegen

YOU CANNOT SKIP THIS STEP.

To generate the types from your own backend to use in developing your frontend, you need to run codegen. The types cannot be generated against a graphql endpoint in production mode (with introspection turned off). Introsepction must be turned on.

yarn codegen

This will output your types in src/lib/gql.

Running the app

Make sure your backend is running first and that you configure the api urls in your .env file or your shell environment.

yarn dev

Top categories

Loading Svelte Themes