NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Senior0 views

Design a platform for sharing and selling handmade goods, with personalization, delivery, and dispute resolution.

Practice

Asked at

AI answer

Architecture

Start with a modular application and a relational database; as the system grows, split the catalog and search, orders, payments, shipping, notifications, and disputes into separate services. Store photos in object storage behind a CDN, and index the catalog in a search engine. Pass events between services through a queue using a transactional outbox and idempotent handlers.

Core entities and workflows

  • Seller, Product, Variant, PersonalizationOption, Order, OrderItem, Payment, Shipment, Dispute, Evidence.
  • For a personalized item, the order contains its parameters and the agreed version of the design/description. Changes are confirmed by the buyer and saved as history rather than overwriting the original agreement.
  • At checkout, atomically lock in the price, availability or production lead time, and personalization terms. Prevent duplicate charges when a request is retried by using an idempotency key.
  • Process payments through a provider; store tokens and statuses, but not bank card data. Funds can be held until shipment/delivery is confirmed, if permitted by the payment provider's rules and the relevant jurisdictions.
  • Integrate shipping through carrier adapters: rate calculation, shipment creation, tracking number, and webhooks. Change order statuses using an explicit state machine.
  • A dispute can be opened within a specified time limit. Store correspondence, agreement versions, photos, and delivery events; restrict access to this material to the parties involved and moderators. Audit dispute decisions and use them to trigger a refund/payout.

Reliability and security

Check seller and buyer permissions for every object, restrict file uploads, scan files, and protect personal data and addresses. Use change auditing, rate limiting, and antifraud checks. Metrics: conversion rate, payment errors, shipping delays, dispute frequency, and time to resolve disputes. Define SLOs, alerts, and event reprocessing procedures for payments and orders.