Self-hosted service
zhinianboke/xianyu-auto-reply avatar
zhinianboke/xianyu-auto-reply

zhinianboke/xianyu-auto-reply: six services, six ports, and one compose file

An automated customer-service management system for Xianyu (Idle Fish), built with Python and FastAPI. It connects to Xianyu's servers via WebSocket to receive and process messages in real time and provides smart auto-replies. It also integrates automatic shipping, automatic reviews and automatic listing "polishing" to automate the virtual-goods workflow on Xianyu.

8,273 stars2,093 forksPythonAGPL-3.0

At a glance

What is it?
xianyu-auto-reply automates a Xianyu seller's shop with FastAPI services, a React front end, MySQL, Redis and Playwright. The main system splits into a web API, a websocket service and a scheduler on three ports, a separate rebate subsystem runs outside the root compose orchestration, and the compose file ships default database passwords and a default login.
Who is it for?
The system fits a seller who runs one shop and wants keyword replies, scheduled auto-delivery and order fetching without watching the chat window, and who can host Docker on a server. It does not fit someone who needs the main and rebate systems deployed by a single compose file, or who wants defaults that are safe on a public host, since the shipped passwords and the admin login are meant to be changed first.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • zhinianboke/xianyu-auto-reply8,273 ★ · +991
Star history
Repository2026-09-232026-11-15
zhinianboke/xianyu-auto-reply7.3k8.3k

991 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Six services share a dependency chain and three health endpoints

The main system is deliberately split. The service table assigns one port and one job to each: the front end on 9000, the web API on 8089, the websocket service on 8090 for the live Xianyu connection, message handling, scan-code login and order linkage, the scheduler on 8091 for timed work, and the rebate subsystem's back end and front end on 8092 and 9001. All three main back end services expose a `/health` endpoint, which is what a compose file needs for ordering. The stated Docker dependency chain is mysql and redis first, then backend-web, then websocket, then scheduler, with the front end depending only on backend-web. A shared `common/` module holds models, database access, self-checks and utilities for both halves of the project.

The rebate subsystem sits outside the root compose orchestration

One structural note is easy to miss and changes how you deploy. The rebate subsystem lives under `promotion/` with its own back end and front end, and it is currently not part of the root docker-compose orchestration. That means a compose based install brings up the main system only, and the promotion half has to be started separately. Its module list is its own: rebate accounts with login, state management and cookie maintenance, selection rules that pull candidate products and write them into the material library automatically, that library of titles, images, details, referral codes, short links, stock and publish status, publish rules that schedule publishing and reuse the public publish capability, delete rules that remove published products on a schedule, and compensation tasks that write product IDs back, repair short links and reissue card codes.

Playwright handles login, and patchright is installed beside it

The browser automation layer is where the platform interaction happens. Playwright is listed for login, cookie refresh and publishing, which is also why cookie maintenance and login renewal appear in the multi-account module rather than in the message module: accounts are kept logged in by a scheduled task, not by a person. The local development steps make the cost visible, because each of the three back end services is started the same way, with a virtual environment, an editable install, and two browser downloads in sequence:

bash
python -m playwright install chromium
python -m patchright install chromium
python main.py

The second line is the detail that catches people. patchright is a separate download, so an environment set up with only Playwright installed will be missing it when the login or publishing path runs.

The compose file ships default passwords and a default login

Running the bundled compose file as it stands means running with the author's defaults. MySQL comes from a registry in Shanghai, `registry.cn-shanghai.aliyuncs.com/zhinian-software/xianyu-mysql:8.0`, and its environment defaults include a root password, a database user, and the database name `xianyu_data`, with the server configured for utf8mb4, a default of 4000 connections, a 256MB packet limit and a default time zone of plus eight. Redis comes from the same registry as a 7-alpine image with a required password, 256MB of memory, an allkeys-lru eviction policy and append-only persistence. Both have healthchecks based on `mysqladmin ping` and `redis-cli ping`, and both restart unless stopped. The first login the deployment notes mention is `admin` with the password `admin123`.

Four deployment paths, two of them pipe a script into bash

The quick start offers four ways in and then a fifth for local development. On a server with Docker installed, the recommended path is one curl into bash that generates the configuration, pulls images, removes old containers and starts services, with a matching update script for later runs. The clone path runs `bash deploy.sh` in the repository, which generates a `.env` file and a `docker-compose.deploy.yml`, pulls prebuilt images, and cleans up any encrypted-edition containers it detects while keeping the data volumes. The remote database path exists for when MySQL and Redis are external, and it is the only one that needs a second run: the first execution generates `.env.remote` and exits so you can fill in real hosts, the second validates the file and generates `docker-compose.remote.yml` before starting the four application services.

A remote database can ban your host and you clear it by hand

The remote database section carries the most operational detail in the readme. The remote MySQL instance must have the database created in advance, `xianyu_data` by default, and must authorise the deploying machine's address, with tables and columns added automatically at application start. It recommends setting `max_connect_errors=100000` persistently, and names the failure that follows otherwise: error code 1129, cleared by running `FLUSH HOSTS` on the database server. The compose file already sets that variable for the bundled MySQL, so the advice applies to the database you bring yourself. The other trap is a host address: if the database or cache is on the host machine itself, the readme says to use `host.docker.internal` or the host's LAN address and explicitly not `localhost` or `127.0.0.1`.

build.sh is the local control panel for images and services

For anyone building from source, one script covers the container lifecycle, with subcommands for a full rebuild that deletes old containers and images first, start, stop, restart, logs and status, plus separate scripts for rebuilding only the front end, the web API, the websocket service or the scheduler. Running the services outside containers follows a fixed sequence: start the infrastructure with `docker compose up -d mysql redis`, create a `.env` such as the one below, then bring up each back end service, and finally the front end with `npm install` and `npm run dev`.

env
ENVIRONMENT=development
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_DATABASE=xianyu_data
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
WEBSOCKET_SERVICE_URL=http://127.0.0.1:8090
TZ=Asia/Shanghai

The tree also holds a Windows desktop launcher packaged as an executable with Nuitka, a `xianyu-mobile/` directory, and two batch files for packaging, one of them for offline dependency packaging. The root `package.json` declares a single dependency, so the front end's own manifest lives inside `frontend/` rather than at the root.

Editorial conclusion

The system fits a seller who runs one shop and wants keyword replies, scheduled auto-delivery and order fetching without watching the chat window, and who can host Docker on a server. It does not fit someone who needs the main and rebate systems deployed by a single compose file, or who wants defaults that are safe on a public host, since the shipped passwords and the admin login are meant to be changed first. Before the first run, read the .env the script generates, replace the default credentials, and decide whether the rebate subsystem belongs in the same deployment.

Frequently asked questions

What services does zhinianboke/xianyu-auto-reply run, and on which ports?

Six: the front end on 9000, the web API on 8089, the websocket service on 8090, the scheduler on 8091, and the rebate back end and front end on 8092 and 9001. The three main back end services each expose a /health endpoint.

How do I install xianyu-auto-reply on a server?

With Docker and Docker Compose already installed, run the one click deployment script from the update host, or clone the repository and run deploy.sh, which generates a .env file and a deploy compose file and pulls prebuilt images. The default login after deployment is admin with the password admin123.

Can xianyu-auto-reply use a remote MySQL and Redis?

Yes, through deploy_remote.sh, which starts only the four application services and takes connection details from a .env.remote file. The remote database must exist in advance, and error 1129 after too many connection errors is cleared by running FLUSH HOSTS on the database server.

Official sources

  1. Issues
  2. License: AGPL-3.0
  3. Project website
  4. README
  5. zhinianboke/xianyu-auto-reply on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/zhinianboke-xianyu-auto-reply.svg)](https://hysenlabs.com/projects/zhinianboke-xianyu-auto-reply)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/zhinianboke-xianyu-auto-reply.svg)](https://hysenlabs.com/projects/zhinianboke-xianyu-auto-reply)

Was this useful?