|
1 | 1 | # ShopFlare |
2 | 2 |
|
3 | | -> Minimalist Shopify app using React Router (v7) running on cloudflare (worker). Only required features, no future changes other than core upgrades & platform alignment. |
| 3 | +> Minimalist Shopify app using React Router (v7) running on cloudflare (worker, kv, analytics). Only essential features, no future changes other than core upgrades & platform alignment. |
4 | 4 |
|
5 | 5 | ## Rationale |
6 | 6 |
|
7 | | -- @shopify/shopify-app-remix to complex (to much abstraction) |
8 | | -- Needed simple boilerplate, than only does the basics with minimal abstraction |
| 7 | +- @shopify/shopify-[api,app-remix] to complex (to much abstraction) |
| 8 | +- Needed a simple starter, than only does the basics |
9 | 9 | - Small code surface, easier audit |
10 | 10 | - Stability over feature completeness |
11 | 11 | - Minimally opinionated, by supporting only: |
|
18 | 18 | 1. Cloudflare account |
19 | 19 | 2. cloudflared cli `brew install cloudflared` |
20 | 20 | 3. Node.js & NPM see package.json#engines `brew install node@22` |
| 21 | +4. Github cli `brew install gh` (optional) |
21 | 22 |
|
22 | 23 | ## Setup |
23 | 24 |
|
24 | 25 | ```sh |
25 | | -cp .env.example .env # update values |
| 26 | +npm install |
| 27 | +cp .env.example .env # update vars to match your env |
| 28 | +# vi [wrangler.json, shopify.app.toml] # update vars[SHOPIFY_API_KEY, SHOPIFY_APP_URL] |
| 29 | +npx wrangler secret put SHOPIFY_API_SECRET_KEY # value from shopify partners |
| 30 | +gh secret set --app=actions CLOUDFLARE_API_TOKEN # value from cloudflare |
| 31 | +gh variable set SHOPIFY_API_KEY |
26 | 32 | ``` |
27 | 33 |
|
28 | | -- copy .env.example vars to Cloudflare workers > Environment variables |
29 | | -- create Workers > KV store key \_SESSION_STORAGE & attach it to workers > Settings > KV namespace bindings |
30 | | -- copy .env{ SHOPIFY_API_KEY, CLOUDFLARE_API_TOKEN } vars to Github > secrets (and variables) |
31 | | - |
32 | 34 | ## Development |
33 | 35 |
|
34 | 36 | ```sh |
35 | | -npm install |
36 | 37 | npm run dev |
37 | | -# open -a Safari {cloudflared.url} |
| 38 | +# open -a Safari ${SHOPIFY_APP_URL} |
38 | 39 | ``` |
39 | 40 |
|
40 | 41 | ## Production |
|
0 commit comments