PROJECT: Nekomata Multi-Brand Photo Printing Service
BUSINESS MODEL:
- 89mm square photo prints (1051x1051px @ 300DPI)
- Multi-brand platform: neko (cats), tokinoe (Japanese art), dog (future)
- Target: 1000 monthly orders, 4.5/5 customer satisfaction, 30% repeat rate
TECHNICAL ARCHITECTURE:
Frontend: Next.js (web) + React Native (mobile) + Electron (factory admin)
Backend: Cloudflare Workers (BFF pattern)
๐ Queue System: Cloudflare Queues + Workers (IMPLEMENTED) - SOLVES SHOPIFY API LIMITS
Database: Cloudflare D1 (SQLite) - ZERO PII STORAGE
Storage: Cloudflare R2 (images)
Authentication: Firebase Auth
E-commerce: Shopify (Headless) - ALL PII STORED HERE ONLY
CDN: Cloudflare global edge network
PII POLICY (CRITICAL):
- All personal data in Shopify only
- D1 database has zero personal information
- Factory app: temporary API fetch only, no data storage
- Brand isolation via brand column in all D1 tables
API CONSTRAINTS โ ๐ SOLVED BY QUEUE SYSTEM:
- Shopify REST: 40 requests/minute โ โ
QUEUE ELIMINATES 429 ERRORS
- Shopify GraphQL: 1000 cost/minute โ โ
QUEUE MANAGES RATE LIMITS
- Order Processing: โ
<2 SECONDS RESPONSE (immediate + background)
- Cloudflare Workers: 50ms CPU, 128MB memory
- Firebase Auth: 50,000 MAU free tier
DATABASE SCHEMA (D1 - PII-FREE):
photos: id, brand, firebase_uid, shopify_customer_id, image_url, status, metadata
orders: id, brand, firebase_uid, shopify_order_id, photo_ids, print_settings, status
print_jobs: id, brand, order_id, factory_id, status, print_data, timestamps
PERFORMANCE TARGETS:
- Page load: under 100ms
- Order processing: under 2 seconds (Queue System)
- Queue processing: under 30 seconds (background)
- API 429 errors: 0% (Queue System eliminates)
- Uptime: 99.9%
- Concurrent users: 1000
DOMAIN SETUP:
- Main: contents-print.jp (Cloudflare DNS)
- Brands: neko.contents-print.jp, tokinoe.contents-print.jp
- Admin: admin.contents-print.jp
- API: api.contents-print.jp
- Support email: support@contents-print.jp โ iyasakapc@gmail.com
- WIKI: https://contentsprint.pages.dev
SECURITY:
- Firebase Auth โ JWT validation โ Shopify customer mapping
- Complete brand data isolation
- Rate limiting with queue system
- PII compliance: Shopify-only storage
TESTING STRATEGY (5 PHASES):
1. Infrastructure (Cloudflare D1, R2, Workers, DNS)
2. Authentication & Security (Firebase, Access controls)
3. Core Features (Image processing, brand management)
4. External Integrations (Shopify API, email)
5. End-to-end user journeys
OPERATIONS:
- Deployment: npm run deploy:cloudflare
- Monitoring: Real-time metrics, automated alerts
- Quality: <5% duplicate content, 100% link validity
- Maintenance: 30 minutes/week target
BRAND MANAGEMENT:
- Multi-tenant single codebase
- Brand-specific UI/messaging per subdomain
- Shopify email templates with brand detection
- Consistent 89mm print specs across brands
IMPLEMENTATION STATUS:
โ
DNS & infrastructure operational
โ
QUEUE SYSTEM IMPLEMENTED (Cloudflare Queues + Workers)
โ
SHOPIFY API RATE LIMITS SOLVED (429 errors eliminated)
โ
ORDER PROCESSING OPTIMIZED (<2s response)
โ
Documentation AI-optimized
โ
Testing framework defined
โ
Quality standards established
Next: Core application development
KEY SUCCESS FACTORS:
- โ
SHOPIFY API RATE LIMITS SOLVED (Cloudflare Queues)
- โ
429 ERRORS ELIMINATED (Queue System with Idempotency)
- โ
ORDER PROCESSING <2 SECONDS (Immediate response)
- Strict PII compliance (Shopify-only)
- Multi-brand isolation architecture
- Scalable edge computing deployment
- High-quality 89mm print standardization