How alimangoes/invoice-tab-shopify works
This is a Shopify embedded app template with invoice-related routes and an invoices-tab extension. The user-facing path begins with shop login, continues into the authenticated embedded app, and exposes invoice functionality alongside a product/metafield/metaobject demonstration. Shopify authentication and webhook handling share Prisma-backed session storage. The API route and extension are represented as distinct invoice components; the available excerpts do not establish a connection between them.
Main entry points: shopify.server.ts Shopify app setup · db.server.ts Prisma client · _index/route.tsx Landing and routing · auth.login/route.tsx Shop login
Components 16
Access and embedded app
- Landing and routing
app/routes/_index/route.tsx - Shop login
app/routes/auth.login/route.tsx - Login errors
app/routes/auth.login/error.server.tsx - Embedded app shell
app/routes/app.tsx - Admin auth route
app/routes/auth.$.tsx
App features
- Product and custom data demo
app/routes/app._index.tsx - Additional app page
app/routes/app.additional.tsx
Invoice experience
- Invoices API
app/routes/api.invoices.tsx - Invoices tab extension
extensions/invoices-tab/src/Invoices.jsx
Shopify platform and state
- Scope update webhook
app/routes/webhooks.app.scopes_update.tsx - Uninstall webhook
app/routes/webhooks.app.uninstalled.tsx - Shopify app setup
app/shopify.server.ts - Prisma client
app/db.server.ts - Session database
prisma/schema.prisma
Other components
- Shop admin
- Shopify platform
Connections 17
- Shop admin → Landing and routing: opens app
app/routes/_index/route.tsx - Landing and routing → Shop login: submits login
app/routes/_index/route.tsx - Landing and routing → Embedded app shell: redirects shop
app/routes/_index/route.tsx - Shop login → Shopify app setup: calls login
app/routes/auth.login/route.tsx - Shop login → Login errors: formats errors
app/routes/auth.login/route.tsx - Embedded app shell → Shopify app setup: authenticates admin
app/routes/app.tsx - Admin auth route → Shopify app setup: authenticates admin
app/routes/auth.$.tsx - Product and custom data demo → Shopify app setup: authenticates admin
app/routes/app._index.tsx - Product and custom data demo → Shopify platform: queries products and custom data
app/routes/app._index.tsx - Invoices API → Shopify app setup: uses Shopify integration
app/routes/api.invoices.tsx - Scope update webhook → Shopify app setup: authenticates webhook
app/routes/webhooks.app.scopes_update.tsx - Scope update webhook → Prisma client: updates session
app/routes/webhooks.app.scopes_update.tsx - Uninstall webhook → Shopify app setup: authenticates webhook
app/routes/webhooks.app.uninstalled.tsx - Uninstall webhook → Prisma client: deletes sessions
app/routes/webhooks.app.uninstalled.tsx - Shopify app setup → Prisma client: configures session storage
app/shopify.server.ts - Prisma client → Session database: persists sessions
- Shopify app setup → Shopify platform: configures app integration
app/shopify.server.ts