How mortalmen/first_app_shopify works
This is a Shopify embedded app template with a customer analytics/VIP workflow and a separate product, variant, and metaobject GraphQL demo. Merchants log in, enter the embedded app, browse customer spending and VIP status, and can submit a spending threshold to tag qualifying customers. Shopify authentication uses Prisma-backed session storage. The README also documents webhook, metafield, and metaobject capabilities. Relationships involving unsampled route wiring are omitted; the customer form’s implicit submission target is shown as unverified.
Main entry points: shopify.server.js Shopify setup · app.customers.jsx Customer route · route.jsx Login landing · db.server.js Session database
Components 14
App entry
- Login landing
app/routes/_index/route.jsx - Embedded app shell
app/routes/app.jsx
Authentication
- Login handler
app/routes/auth.login/route.jsx - Shopify setup
app/shopify.server.js - Session database
app/db.server.js
Customer tools
- Customer route
app/routes/app.customers.jsx - Customer queries and VIP tags
app/features/customers/customers.server.js - VIP threshold controls
app/features/customers/VipAutomationBar.jsx - Customer summary card
app/features/customers/CustomerCard.jsx
Shopify integration
- Product and metafield demo
app/routes/app._index.jsx - Scope update webhook
app/routes/webhooks.app.scopes_update.jsx - Uninstall webhook
app/routes/webhooks.app.uninstalled.jsx
Other components
- Merchant
- Shopify Admin API
Connections 18
- Merchant → Login landing: opens app
README.md - Login landing → Login handler: submits login
app/routes/_index/route.jsx - Login landing → Embedded app shell: redirects shop
app/routes/_index/route.jsx - Login handler → Shopify setup: validates login
app/routes/auth.login/route.jsx - Shopify setup → Session database: stores sessions
app/shopify.server.js - Embedded app shell → Shopify setup: authenticates admin
app/routes/app.jsx - Customer route → Shopify setup: authenticates admin
app/routes/app.customers.jsx - Customer route → Customer queries and VIP tags: loads and updates
app/routes/app.customers.jsx - Customer route → VIP threshold controls: renders controls
app/routes/app.customers.jsx - Customer route → Customer summary card: renders customers
app/routes/app.customers.jsx - VIP threshold controls → Customer route: submits threshold
app/routes/app.customers.jsx - Customer queries and VIP tags → Shopify Admin API: queries and tags
app/features/customers/customers.server.js - Product and metafield demo → Shopify setup: authenticates admin
app/routes/app._index.jsx - Product and metafield demo → Shopify Admin API: creates product and metaobject
app/routes/app._index.jsx - Scope update webhook → Shopify setup: uses authentication
app/routes/webhooks.app.scopes_update.jsx - Scope update webhook → Session database: updates sessions
app/routes/webhooks.app.scopes_update.jsx - Uninstall webhook → Shopify setup: uses authentication
app/routes/webhooks.app.uninstalled.jsx - Uninstall webhook → Session database: updates sessions
app/routes/webhooks.app.uninstalled.jsx