XianYuSmart
闲鱼全流程自动化运营系统:从商机挖掘、商品发布,到 AI 客服、固定内容/卡密自动发货、评价与售后跟进一站式完成;支持多账号、多租户、异常恢复和 Docker 自部署。
XianYuSmart automates virtual-goods sales on the Xianyu marketplace
A multi-tenant Java system that handles order discovery, card-key delivery, AI replies, and review follow-up on Xianyu.
What the system automates
XianYuSmart is a multi tenant operations system for selling virtual goods on the Xianyu secondhand marketplace. The README states the goal is to let fixed content or card keys be delivered, answered, and reviewed with as little manual watching as possible, so a seller only handles low stock, dropped accounts, failed sends, and items needing review. After a buyer orders, the platform can deliver fixed resources or card keys automatically, reaching the buyer through a delivery voucher, a private message, or both. Common questions before and after a sale, receipt guidance, and review follow-up are handled by rules. The system connects order discovery, idempotent queuing, inventory reservation, dual channel delivery, failure retry, and human review into one recoverable chain. Fixed content and card key modes are strictly mutually exclusive, and accounts, goods, messages, orders, inventory, tasks, and the AI knowledge base are isolated per tenant. The core task chain depends only on MySQL and does not require Redis or a message queue, which the README presents as a way to keep deployment cheap while leaving room to scale later. The current version named in the README is 2.0.6, and the document frames the seller's change as moving from per order manual work to configuring rules and handling exceptions.
Engineering highlights
The technical highlights table explains how the system stays reliable. Atomic card key delivery uses MySQL row level locks to reserve a whole order, marks the key consumed after a successful send, and releases or routes to human review on failure, which avoids duplicate or missed sends and overselling. The task queue is recoverable: orders and reply tasks are persisted, and worker leases with timeout reclaim and backoff retry let processing continue after a process exit or restart. Dual entry idempotency means WebSocket real time events and the order API both enqueue by order number, so the same order is never delivered twice. Multi tenant data boundaries are enforced by a tenant context, tenant columns, composite unique indexes, and database migrations together. The real time message link uses Java WebSocket with MessagePack decoding and keeps message persistence separate from business processing so long connections are not blocked by slow work. AI customer service is isolatable, using Spring AI with per tenant dynamic clients and a separate vector store, and it can fall back to deterministic rules. A lightweight runtime boundary uses bounded thread pools, limited queues, and batch claiming so the system controls resource use without heavy middleware. External supply integration uses order level idempotency keys and response count checks to avoid double purchasing.
Operations and scope
The README maps the system's scope across business automation, reliable delivery, and multi tenant operations. Connection management is the single place to update cookies, view status, reconnect WebSocket, and run account health checks. Goods management holds sync and editing, auto review rules, review text pools, batch apply, and auto bump. Buyer profiles are built automatically from messages and orders, summarizing interaction, spend, tags, and notes. The dashboard surfaces available card keys, low stock, pending items, items needing review, and failed tasks so exceptions are visible in one place. Deployment is via Docker Compose with health checks and an HTTPS proxy, and the app binds only to a local port with Nginx providing HTTPS, rate limiting, and reverse proxy, which the README offers as a clear public network boundary. Sensitive values such as cookies, API keys, and email passwords are excluded from defaults. Notifications and diagnostics cover multi channel alerts, signature checks, SSRF protection, and a unified exception view. The document closes with a license and disclaimer section and a star history link, and it notes the codebase gives a full loop from the front end workbench and back end state machine through database migration to container deployment rather than a single path snippet. The project invites study of reliable scheduling, event driven automation, and tenant isolation.
Editorial conclusion
The project is published under the PolyForm Noncommercial 1.0.0 license and its most recent commit was on 2026-08-26.
Community notes