**PHASE 1: Shopify Accounts and Prerequisites**
1. Create Shopify Partner (Developer) Account
Section titled “1. Create Shopify Partner (Developer) Account”This is mandatory for building apps.
-
Go to
-
Click Join now
-
Sign in with email or Google
-
Choose:
- Account type: Developer
- Company name: your product or company name
- Purpose: Build apps for the Shopify App Store
After signing up, you land in the Shopify Partner Dashboard.
This dashboard is where:
- You create apps
- Create development stores
- Manage API keys
2. Create a Development Store (Test Store)
Section titled “2. Create a Development Store (Test Store)”You need at least one dev store to test the app.
- In Partner Dashboard
- Go to Stores
- Click Add store
- Select Development store
- Store details:
- Store name: something like appifire-ai-chat-test
- Password protection: enabled (default)
- Click Create store
You now have:
- A real Shopify store
- Free access
- No payment required
- Full admin permissions
Important:
- This store can install unpublished apps
- Perfect for testing extensions and billing
PHASE 2: Local Development Environment Setup
Section titled “PHASE 2: Local Development Environment Setup”3. Install Required Tools
Section titled “3. Install Required Tools”Node.js
Section titled “Node.js”- Install Node.js 18 or later
- Verify:
node -vnpm -vShopify CLI
Section titled “Shopify CLI”This is mandatory.
npm install -g @shopify/cli @shopify/appVerify:
shopify version4. Login Shopify CLI
Section titled “4. Login Shopify CLI”shopify loginThis opens browser, login with:
- Same email used for Partner account
Once done, CLI can:
- Create apps
- Deploy extensions
- Run local dev server
PHASE 3: Create Shopify App (Correct Way)
Section titled “PHASE 3: Create Shopify App (Correct Way)”5. Create a New Shopify App
Section titled “5. Create a New Shopify App”Run:
shopify app init(Or use npm init @shopify/app@latest.) Choose options carefully:
- App type: Public app
- App name: AppiFire AI Chat
- Package manager: npm or pnpm
- Template: Remix or React Router (Shopify often recommends React Router for new apps)
This will:
- Create app in Partner Dashboard
- Generate API key and secret
- Create local codebase
Your folder structure will look like:
ai-product-chatbot/ app/ extensions/ prisma/ shopify.app.toml6. Understand What You Just Created
Section titled “6. Understand What You Just Created”Out of the box, Shopify gives you:
- Embedded Admin App (inside Shopify Admin)
- OAuth flow
- Webhook handling
- App Bridge setup
This is NOT yet visible on storefront. That comes next.
PHASE 4: Create Theme App Extension (Chat Widget)
Section titled “PHASE 4: Create Theme App Extension (Chat Widget)”This is what renders the chatbot on storefront.
7. Generate Theme App Extension
Section titled “7. Generate Theme App Extension”Inside app folder:
shopify app generate extensionChoose:
- Extension type: Theme app extension
- Name: ai-chat-widget
This creates:
extensions/ ai-chat-widget/ blocks/ assets/ snippets/This extension:
- Can inject chat widget
- Can be enabled via Shopify theme editor
- Is the correct approach (ScriptTags are deprecated)
8. Add Chat Widget UI
Section titled “8. Add Chat Widget UI”Inside:
extensions/ai-chat-widget/blocks/chat.liquidExample minimal placeholder:
<div id="ai-chatbot-root"></div><script src="{{ 'chat.js' | asset_url }}"></script>Add JS file in:
assets/chat.jsLater, this JS will:
- Load React widget
- Call your backend RAG API
PHASE 5: Running and Testing Locally
Section titled “PHASE 5: Running and Testing Locally”9. Run App in Development Mode
Section titled “9. Run App in Development Mode”From root folder:
shopify app devWhat happens:
- App server runs locally
- Shopify creates a temporary tunnel
- App auto installs on your dev store
- Theme extension is available
You will see:
- Admin app open inside Shopify admin
- Terminal shows URLs
10. Enable Chat Widget in Storefront
Section titled “10. Enable Chat Widget in Storefront”- Go to your dev store admin
- Online Store -> Themes
- Click Customize
- Click Add section
- Find your app extension
- Enable AI Chat Widget
- Save
Now your widget renders on storefront.
PHASE 6: API Access and Product Reading
Section titled “PHASE 6: API Access and Product Reading”11. Configure App Scopes
Section titled “11. Configure App Scopes”Open:
shopify.app.tomlAdd required scopes:
scopes = "read_products,read_inventory,read_content,read_themes"Then run again:
shopify app devShopify will ask to reauthorize.
12. Fetch Products from Shopify
Section titled “12. Fetch Products from Shopify”Inside your backend:
Use Admin API:
const products = await admin.rest.resources.Product.all({ session, limit: 250});Store in your DB:
- Product title
- Description
- Variants
- Tags
- Price
- Images
- Metafields
Trigger ingestion:
- On app install
- On product update webhook
PHASE 7: Webhooks Setup (Critical)
Section titled “PHASE 7: Webhooks Setup (Critical)”13. Register Webhooks
Section titled “13. Register Webhooks”Register these:
- products/create
- products/update
- products/delete
- app/uninstalled
Shopify CLI auto registers webhooks if defined.
Purpose:
- Keep RAG knowledge in sync
- No manual reindex needed
PHASE 8: Testing Strategy
Section titled “PHASE 8: Testing Strategy”14. Local Testing
Section titled “14. Local Testing”Test:
- Install and uninstall app
- Product sync
- Widget render
- API calls from storefront
Use:
- ngrok tunnel via Shopify CLI
- Browser dev tools
- Shopify admin logs
15. Multiple Store Testing
Section titled “15. Multiple Store Testing”Create:
- 2–3 dev stores
- Different catalogs
- Different languages
Ensure:
- Tenant isolation
- Correct data separation
PHASE 9: Preparing for Production
Section titled “PHASE 9: Preparing for Production”16. App Configuration
Section titled “16. App Configuration”Before submission:
- App listing assets
- Privacy policy URL
- Terms URL
- Support email
17. App Review Readiness
Section titled “17. App Review Readiness”Shopify will check:
- OAuth correctness
- No hardcoded store URLs
- Proper data usage
- GDPR compliance
PHASE 10: Deployment Flow
Section titled “PHASE 10: Deployment Flow”- Push code to GitHub
- Use CI/CD to deploy backend
- Run:
shopify app deployThis:
- Deploys extensions
- Locks config
- Prepares for App Store submission
COMMON MISTAKES TO AVOID
Section titled “COMMON MISTAKES TO AVOID”- Using ScriptTags instead of theme extensions
- Not handling webhooks
- Re-ingesting full catalog every request
- Blocking UI on AI response
- Storing Shopify tokens insecurely
WHAT I CAN DO NEXT FOR YOU
Section titled “WHAT I CAN DO NEXT FOR YOU”If you want, I can:
- Design exact database schema for RAG
- Create product ingestion pipeline
- Write RAG prompt templates
- Prepare Shopify App Store listing
- Create Sprint-wise development tasks
Just tell me what you want next.