Shopify embedded app for CLEVER. The delivery backend now lives in the separate clever-route-server repository; this repo keeps only the Shopify app and its app-server/BFF loader/action code.
apps/shopify-app— React Router Shopify embedded app.
The Shopify app calls the operating delivery API through CLEVER_DELIVERY_API_URL.
On EC2 compose, Shopify app containers join the external route-server Docker network and call http://clever-route-api:3000.
API request correlation and the bounded /perf capture contract are documented
in docs/api-observability.md.
Production/App Store runtime:
- App URL:
https://clever-route-app.cleversystem.ai - Redirect URL:
https://clever-route-app.cleversystem.ai/auth/callback - Delivery API:
https://clever-route-api.cleversystem.ai - App scope:
CLEVER_APP_ID=clever - Legacy host alias:
https://clever-admin.cleversystem.aiduring staged host migration
Dev preview/runtime:
- App URL:
https://clever-route-app-dev.cleversystem.ai - Redirect URL:
https://clever-route-app-dev.cleversystem.ai/auth/callback - Delivery API:
https://clever-route-api.cleversystem.ai - App scope:
CLEVER_APP_ID=clever-route-dev
KFood custom/runtime:
- App URL:
https://clever-kfood-app.cleversystem.ai - Redirect URL:
https://clever-kfood-app.cleversystem.ai/auth/callback - Delivery API:
https://clever-route-api.cleversystem.ai - App scope:
CLEVER_APP_ID=clever-route-kfood
Public URL hostnames must not contain shopify or example.
npm run setup
npm run build
npm run typecheck
npm test
npm run check:public-urlsCompose validation:
docker compose -f infra/compose/docker-compose.shopify-main.yml config --quiet
docker compose -f infra/compose/docker-compose.shopify-dev.yml config --quiet
docker compose -f infra/compose/docker-compose.shopify-kfood.yml config --quietSee NAMING.md for the canonical distinction between brand/display name, Shopify handle, Admin path, and hosted app URLs.
The repo contains three Shopify app config files:
apps/shopify-app/shopify.app.toml— production/public app config (CLEVER, handleclever-route).apps/shopify-app/shopify.app.dev.toml— dev/custom-store app config (CleverRoute Dev, handleclever-route-dev).apps/shopify-app/shopify.app.kfood.toml— KFood custom-store app config (CLEVER K-Food, handleclever-route-kfood).
Use explicit Shopify CLI config selection:
npm --prefix apps/shopify-app run dev→shopify app dev -c devnpm --prefix apps/shopify-app run dev:local -- --store clever-test-syhae28n.myshopify.com→ same dev config plus required local delivery env. Seedocs/runbooks/shopify-app-dev.md.npm --prefix apps/shopify-app run deploy:prod→ production confignpm --prefix apps/shopify-app run deploy:dev→ dev/custom confignpm --prefix apps/shopify-app run deploy:kfood→ KFood custom config
Do not run Shopify Dashboard mutations, shopify app deploy, shopify app config link/use, or shopify app dev --reset against a live app without an explicit release decision.
The runtime distribution is selected with SHOPIFY_APP_DISTRIBUTION:
app_storefor the public runtime.single_merchantfor the dev/custom and KFood custom runtimes.
Order webhooks use CLEVER_ORDER_WEBHOOK_ADMISSION_MODE=session_free. During a
manual rollback, set it to retry to keep Shopify retries active while refusing
to acknowledge any webhook that has not reached the Delivery API durable inbox.
The repository is intended to stay private under the EVNSolution GitHub Free organization. Private GitHub-hosted workflow runs consume the org Actions quota, so the workflow is intentionally split:
- PR and
mainpushes run lightweight CI: install, build, typecheck, tests, public URL hostname guard, Shopify submission readiness, and compose config validation. - Deploys are manual only: run the
Deploy Shopify appworkflow on a validatedmaincommit. - Select
production,clever-route, orkfoodwith the requiredtargetinput. - The deploy workflow verifies that the exact
maincommit passed CI and does not repeat install, build, typecheck, or tests. - Production image builds happen on the EC2 host during deploy instead of on a GitHub-hosted runner.
The EC2 release transaction, SQLite backup evidence, and automatic rollback
contract are documented in
docs/runbooks/ec2-shopify-release-rollback.md.
Shopify app containers run on the existing route server EC2 and attach to the route-server Docker network:
docker-compose.shopify-main.yml→shopify-clever-main-clever-route-app-1docker-compose.shopify-dev.yml→shopify-clever-dev-clever-route-app-dev-1docker-compose.shopify-kfood.yml→shopify-clever-kfood-clever-kfood-app-1
Runtime env files are intentionally not committed:
infra/env/shopify-app.envinfra/env/shopify-app-clever-route.envinfra/env/shopify-app-kfood.env
Required GitHub repository variables for deployment:
EC2_HOSTEC2_USERDEPLOY_PATH
Optional variables for temporary GitHub-hosted runner SSH ingress:
EC2_SSH_SECURITY_GROUP_IDAWS_REGION— defaults toap-northeast-2if omitted
Required GitHub repository secret:
EC2_SSH_KEY
Optional secrets for temporary GitHub-hosted runner SSH ingress:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY