Commit Graph

12 Commits

Author SHA1 Message Date
Jeff Emmett 4b75464b93 fix: handle non-JSON error responses in design pipeline
Frontend was crashing with "Unexpected token 'I'" when the backend
returned plain text errors (e.g. "Internal Server Error" from proxy).
Now safely falls back to response.text() when JSON parsing fails.
Also prevents backend from swallowing HTTPException in catch-all.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:48:14 -08:00
Jeff Emmett 9c9c070fbd fix: handle Printful v2 API list response format
v2 returns {data: [...]} (array) not {data: {...}} (object).
Also fixes mockup task polling to use ?id= query param and
extracts mockup_url from nested catalog_variant_mockups structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:08:53 -08:00
Jeff Emmett e5317dab27 feat: update Printful client to v2 mockup-tasks API format
The v2 API uses products array with catalog source, nested layers in
placements, and GET /mockup-tasks/{id} for polling. Also removes
hardcoded domain in favor of PUBLIC_URL setting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:57:04 -08:00
Jeff Emmett a794f4732a fix: enlarge shirt print area for more realistic sizing
Design box expanded from 370x370 to 500x450 and repositioned
higher on the chest for typical t-shirt print proportions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:48:03 -08:00
Jeff Emmett eda9a0df23 fix: luminance-masked screen blend + cache bypass param
- Screen blend now uses brightness mask from the design so only
  non-dark pixels show through. Prevents visible dark rectangle
  when design has its own dark background (e.g. DefectFi tee).
- Add ?fresh=1 query param to /mockup endpoint for cache bypass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:46:26 -08:00
Jeff Emmett 067e14ed0c feat: photorealistic mockups and professional storefront
Backend:
- Replace tiny placeholder templates with photorealistic 1024x1024 product
  photos (blank t-shirt, sticker with peeling corner, framed print)
- Rewrite Pillow compositing: screen blend for dark garments (design looks
  printed on fabric), direct paste for stickers/prints
- Add PRINTFUL_STORE_ID config + X-PF-Store-Id header to Printful client
  (unblocks existing account-level tokens)

Frontend:
- Product listing: rounded cards with shadows, category badges, hover
  animations, lazy loading, empty state
- Product detail: skeleton loading, mockup type switcher with loading
  indicator, raw design preview, inline price in Add to Cart button,
  shipping/quality info section
- Homepage: featured products now show mockups instead of raw designs,
  professional card layout matching products page
- Client-side mockups: updated coordinates for new templates, screen
  blend support via Canvas globalCompositeOperation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:43:49 -08:00
Jeff Emmett 54d064f3fa feat: add full Printful API v2 integration (mockups + fulfillment)
- PrintfulClient: catalog variants (cached 24h), mockup generation
  (async create+poll), order submission, variant ID resolution
- Mockup endpoint tries Printful API first for Printful-provider designs,
  falls back to Pillow compositing for others (e.g. Prodigi stickers)
- Order service routes items by provider from design metadata:
  provider=printful → Printful API, provider=prodigi → Prodigi API
- Sandbox mode creates draft orders on Printful (not fulfilled)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:00:40 -07:00
Jeff Emmett acfe6cc350 feat: add Prodigi POD client + server-side product mockup previews
- Prodigi v4 API client for order fulfillment (create/get orders, quotes)
- Server-side mockup generation: Pillow composites designs onto product
  templates (shirt, sticker, print) at GET /api/designs/{slug}/mockup
- Product listing and detail pages now show designs ON products
- Mockup type switcher on product detail page (T-Shirt/Sticker/Art Print)
- Order service submits to Prodigi after successful payment
- POD webhook endpoint for fulfillment status updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:29:47 -07:00
Jeff Emmett b437709510 feat: replace Stripe with Mollie payments + TBFF revenue split to bonding curve
- Swap stripe SDK for mollie-api-python (Dutch data residency, PCI-DSS L1)
- Mollie redirect checkout flow: create payment → hosted page → webhook
- Rename DB columns: stripe_session_id → payment_id, add payment_provider
- Add revenue split: configurable fraction of each sale deposits to
  flow-service TBFF funnel → Transak on-ramp → bonding curve ($MYCO)
- Add checkout success page with cart cleanup
- Add backlog tasks for remaining work
- Remove @stripe/stripe-js from frontend, Stripe env vars from Docker

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:16:39 -07:00
Jeff Emmett 54ccbbc350 feat: add Upload Swag page with product mockup previews
Users can upload their own logo/design, see instant mockup previews on
shirts, stickers, and art prints via client-side Canvas compositing,
then save and activate the design to the store for ordering.

- Backend: POST /api/design/upload with file validation (type, size,
  dimensions), Pillow processing, saves to designs/uploads/
- Frontend: /upload page with drag-and-drop, real-time mockup gallery,
  activate/discard flow matching existing Design Swag pattern
- Fix: activate/delete endpoints now scan all category dirs instead of
  hardcoding stickers/
- Nav: "Upload Swag" button added to header and homepage CTAs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 12:38:58 -07:00
Jeff Emmett 7be99d37d0 feat: add multi-tenant spaces with Fungi Flows storefront
Add subdomain-based spaces system for branded storefronts. Each space
has its own theme, product catalog, and isolated cart via scoped
localStorage keys.

- Backend: SpaceService loads YAML configs, new /api/spaces endpoints,
  design filtering by space, CORS regex for *.rswag.online
- Frontend: Next.js middleware detects subdomain and sets space_id cookie,
  dynamic CSS variable injection for theming, space-aware API calls
- Spaces: _default (rSwag hub, cyan/orange) and fungiflows (gold/green/purple)
- Docker: Traefik wildcard HostRegexp for subdomain routing
- Designs: Placeholder Fungi Flows sticker and logo tee

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 12:20:19 -07:00
Jeff Emmett 72f072f233 Initial commit: rSwag - merch store for the rSpace ecosystem
Forked from mycopunk-swag-store and rebranded for rSpace:
- Next.js 15 + FastAPI + PostgreSQL + Stripe
- Printful + Prodigi POD integration
- AI design generation via Gemini API
- rSpace color scheme (cyan/orange) and branding
- In-repo designs directory (stickers, shirts, misc)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:24:22 -07:00