← back to Designer Wallcoverings

DW-Agents/dw-agents/agent-shopify-store/README.md

129 lines

# Shopify Store Agent

## Purpose
Comprehensive Shopify store management system that monitors all transactions, assists with product management, and coordinates with other agents for marketing, digital samples, and customer service.

## Core Responsibilities
- Monitor all Shopify store transactions in real-time
- Product catalog management (CRUD operations)
- Order processing and tracking
- Customer data management
- Inventory synchronization
- Marketing campaign support (coordinates with marketing agent)
- Digital sample fulfillment (coordinates with digital-samples agent)
- Customer onboarding support (coordinates with new-client-signup agent)
- Sales analytics and reporting

## Technical Details
- **Port**: 7238
- **Main File**: shopify-store-agent.ts
- **Interface**: Spreadsheet-style web dashboard with chat
- **API**: Full Shopify Admin API access
- **Auto-Recovery**: PM2 managed with auto-restart on crash

## Shopify API Access
- **Store**: designer-laboratory-sandbox.myshopify.com
- **Access**: Full Admin API permissions
- **Endpoints Used**:
  - Products API
  - Orders API
  - Customers API
  - Inventory API
  - Fulfillment API
  - Webhooks API

## Key Features
- Real-time transaction monitoring
- Product management interface
- Order tracking dashboard
- Customer database access
- Inventory management
- Sales analytics
- AI-powered chat assistant (Claude)
- Spreadsheet-style data viewing
- Action log tracking
- Integration with marketing campaigns
- Digital sample coordination

## Web Interface (Port 7238)
- **Dashboard**: Spreadsheet-style transaction view
- **Chat**: Top-mounted AI assistant for queries
- **Tabs**:
  - Transactions
  - Products
  - Orders
  - Customers
  - Inventory
  - Analytics
  - Action Log

## Integration Points
- **marketing agent**: Product promotion coordination
- **digital-samples agent**: Sample fulfillment
- **new-client-signup agent**: Customer onboarding
- **task-orchestrator**: Task routing and tracking
- **needs-attention agent**: Issue escalation
- **accounting agent**: Revenue tracking

## Authentication
- Session-based with shared SSO
- Shopify API token from .env
- Admin access level

## Action Logging
All actions are logged including:
- Product updates
- Order changes
- Customer modifications
- Inventory adjustments
- API calls made
- Integration triggers

## PM2 Configuration
- Auto-restart on crash
- Max memory: 500MB
- Error log: /root/DW-Agents/logs/shopify-store-error.log
- Out log: /root/DW-Agents/logs/shopify-store-out.log

## Chat Capabilities
Ask the agent to:
- "Show me today's orders"
- "Update product inventory for SKU XYZ"
- "Find customer by email"
- "What are the top-selling products?"
- "Create a marketing campaign for new products"
- "Generate sales report for last month"
- "Process digital sample request for customer"

## Mobile Testing & UI Validation

Test the Shopify Store Agent interface on mobile devices:

**Quick mobile test:**
```bash
cd /root/DW-Agents/agent-shopify-store
node test-mobile.js http://localhost:7238
```

**Comprehensive visual regression:**
```bash
npm test                # Run all mobile UI tests
npm run test:mobile     # Mobile devices only
npm run test:update     # Update baseline snapshots
```

**What's tested:**
- Mobile responsiveness (iPhone, Android)
- Touch target sizes (WCAG compliance)
- Dashboard layout on small screens
- Chat interface mobile usability
- Product table scrolling
- Action buttons accessibility

**Recommended testing tools:**
- **Playwright Test** - Visual regression with device emulation
- **Puppeteer** - Quick screenshot comparisons
- **Percy/Chromatic** - Automated visual diffs in CI/CD

See `/root/.claude/skills/webapp-testing/SKILL.md` for detailed mobile testing guide.