Shopify App
The MOOD MNKY Shopify App integrates fragrance oil management, custom blend creation, and product synchronization between Notion databases and Shopify stores. This application enables seamless e-commerce operations for the MOOD MNKY product catalog.Overview
The Shopify App provides a comprehensive interface for managing fragrance products, syncing data from Notion databases to Shopify, creating custom blends, and tracking product lifecycle. The application integrates with multiple services to provide a unified product management experience.Key Features
- Notion Sync: Sync fragrance oils from Notion database to Shopify
- Product Management: Create and manage Shopify products and variants
- Custom Blends: Create custom fragrance blends and sync to Shopify
- Real-time Updates: Track sync status and product updates
- Inventory Management: Monitor stock levels and availability
- Order Processing: Handle custom product orders and fulfillment
Architecture
Technology Stack
- Frontend: Next.js 15, TypeScript, React
- Styling: Tailwind CSS, shadcn/ui components
- Backend: Next.js API routes, Supabase
- Integrations:
- Shopify Admin API
- Notion API
- Supabase (database and real-time)
- OpenAI API (optional AI features)
Application Structure
Getting Started
Prerequisites
- Node.js 18+ and pnpm
- Shopify Partner account and app
- Notion workspace with fragrance database
- Supabase project
- Environment variables configured
Setup
-
Install dependencies:
-
Configure environment variables:
Create
.env.local: -
Verify credentials:
-
Run development server:
- Open http://localhost:3000
Notion Integration
The app syncs fragrance oil data from Notion databases to Shopify:Database Structure
The Notion database should contain:- Fragrance name and description
- Scent notes and profile
- Pricing information
- Inventory levels
- Product images
- Custom metadata
Sync Process
- Fetch from Notion: Retrieve fragrance data from Notion database
- Transform Data: Convert Notion format to Shopify product format
- Create/Update Products: Sync to Shopify store
- Track Status: Monitor sync progress and errors
Shopify Integration
Product Management
- Create Products: Convert Notion entries to Shopify products
- Manage Variants: Handle different sizes, scents, and options
- Inventory Sync: Keep stock levels synchronized
- Image Upload: Sync product images to Shopify
Custom Blends
The app enables creation of custom fragrance blends:- Blend Configuration: User selects base notes and intensity
- Product Creation: Generate custom Shopify product
- Order Processing: Handle custom blend orders
- Production Instructions: Generate formulation details
API Integration
Shopify Admin API
- Product CRUD operations
- Inventory management
- Order processing
- Webhook handling
Notion API
- Database queries
- Page updates
- Property synchronization
Supabase
- Sync status tracking
- Error logging
- Real-time updates
Testing
API Tests
Test Coverage
- API endpoint validation
- Data transformation accuracy
- Error handling
- Sync process integrity
Deployment
Environment Variables
| Variable | Description | Required |
|---|---|---|
SHOPIFY_API_KEY | Shopify app API key | Yes |
SHOPIFY_API_SECRET | Shopify app API secret | Yes |
NOTION_API_KEY | Notion integration token | Yes |
NOTION_DATABASE_ID | Fragrance database ID | Yes |
NEXT_PUBLIC_SUPABASE_URL | Supabase project URL | Yes |
Vercel Deployment
- Connect repository to Vercel
- Set all environment variables
- Configure build settings
- Deploy application
Troubleshooting
Common Issues
Notion Sync Failures
- Issue: Fragrance data not syncing from Notion
- Solution: Verify Notion API key and database ID. Check database permissions. Review sync logs for specific errors.
Shopify Product Creation Errors
- Issue: Products not creating in Shopify store
- Solution: Verify Shopify API credentials and permissions. Check product data format matches Shopify requirements.
Authentication Issues
- Issue: Cannot authenticate with Shopify or Notion
- Solution: Regenerate API keys and verify they’re correctly set in environment variables. Check API rate limits.
Best Practices
- Incremental Syncs: Sync only changed products to reduce API calls
- Error Handling: Implement retry logic for failed syncs
- Data Validation: Validate data before syncing to prevent errors
- Monitoring: Set up alerts for sync failures
Related Resources
- Shopify API Documentation - E-commerce API reference
- Notion Integration - Notion API guide
- Supabase Integration - Database setup
- Supabase Client Package - Database client utilities