Kashuab / elysia-shopify

A template for building Shopify apps with Elysia. This app in particular contains a SPA with Vite.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elysia Shopify App Template

The app is a SPA designed to integrate with Shopify.

This is not production ready

While it may work, I can't recommend production usage. This is relatively bare-bones, but there are some things that work:

  • Installation flow
  • Billing
  • Shopify Admin GQL API queries
  • Shopify app bridge
  • Shopify CLI integration

Stack

  • Bun (of course)
  • Elysia
  • MongoDB w/ Typegoose
  • Vite

Get stated

  1. Clone the repo
  2. cd client
  3. bun install
  4. Run bun install in both web/client and web/server
  5. Copy and paste .env.example to .env in both web/client and web/server, filling out applicable variables
  6. Run bun dev in the project root which will invoke the Shopify CLI

Notes

Server:

  • The elysiaShopify plugin uses derive to provide a shop and session object for your routes

Client:

  • There's a useEden hook to make dispatching requests to your API easier to work with in your React components
  • The edenTreaty initialization uses withShopifyAuth and withAbortControllers fetch composers for your convenience

TODOs

  • There are a few interesting type issues (See // @ts-ignore comments)
  • Better README for setup
  • Add better front-end boilerplate with Shopify Polaris, and some more app bridge examples
  • All-in-one docker development environment (easier set up)
  • Document an example deployment process (GCS static front-end, Cloud Run server)

About

A template for building Shopify apps with Elysia. This app in particular contains a SPA with Vite.


Languages

Language:TypeScript 99.8%Language:CSS 0.1%Language:JavaScript 0.1%Language:HTML 0.0%