• Stars
    star
    209
  • Rank 182,669 (Top 4 %)
  • Language
    TypeScript
  • Created almost 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An e-commerce storefront starter built with Qwik and Vendure

Vendure Qwik Storefront Starter๏ธ

An e-commerce storefront for Vendure built with Qwik & Qwik City.

๐Ÿ‘‰ qwik-storefront.vendure.io

Core Web Vitals


pagespeed.web.dev


To do

  • Cart โœ…
  • Checkout flow โœ…
  • Search facet filters โœ…
  • Login โœ…
  • Account creation โœ…
  • Customer account management โœ…
  • SPA-mode navigation โœ…
  • Set up GraphQL code generation โœ…

Contributions welcome!

Development

Development mode uses Vite's development server. During development, the dev command will server-side render (SSR) the output.

npm start # or `yarn start`

Note: during dev mode, Vite may request a significant number of .js files. This does not represent a Qwik production build.

Preview

The preview command will create a production build of the client modules, a production build of src/entry.preview.tsx, and run a local server. The preview server is only for convenience to locally preview a production build, and it should not be used as a production server.

npm run preview # or `yarn preview`

Production

The production build will generate client and server modules by running both client and server build commands. Additionally, the build command will use Typescript to run a type check on the source code.

npm run build # or `yarn build`

i18n

Marking string for translation

Any string can be marked for translation by using the $localize template function like so:

export default component$((props: { name: string }) => {
	return <span>{$localize`Hello ${props.name}!`}</span>;
});

Extracting string for translation

The first step in translation is to build the application. Once the artifacts are build the strings can be extracted for translation.

npm run build.client
npm run i18n-extract

The result of the commands is src/locale/message.en.json.

Translating strings

Take the resulting string and send them for translation. Produce a file for each language. For example:

src/locale/message.en.json    # Original strings
src/locale/message.es.json

Sorting translations

Qwik hashes bundles based on the content of the files. This means that if a file changes, the order of i18n translations will be lost and can be difficult to manage manually.

npm run i18n-sort

The i18n-sort script will sort by first appearance in the src folder to keep a consistent order.

Testing translations

The resulting language should match your browser language. You can also override the language by adding ?lang=es to the URL.


Related