Skip to content
All works

2026LiveProduct

Fuma Platform

fuma-platform

A thin local wrapper that turns Fuma's web console into a programmable, cacheable platform — one registry, four interfaces.

Role
Design & development, solo
Year
2026
Status
Live
Stack
TypeScriptNode.jsFastifySQLite

Fuma is the CRM my company uses every day. Its web console is built for a human: multiple accounts, DingTalk QR login, sessions that expire, no SDK, rate limits to respect. I use it during the day to look up customers, browse the open-sea pool, run duplicate checks and query customs data. At night I started wondering whether the repetitive half could be handled by scripts and agents instead.

The problem

Every action in the console is tied to a browser session. Scripts that hit the endpoints directly lose the session quickly, and two scripts sharing one account fight over the same browser. The business also has hard rules: check for duplicates before claiming from the open sea, a three-day cooldown after release, a cap on customer volume. Rules that only live in someone’s head go wrong sooner or later.

What I built

fuma-platform is a resident local Node service. It does not rewrite Fuma’s business logic — it is a thin wrapper around the browser contracts. Each of the 43 capabilities is defined once in a registry, then emitted as a CLI command, a REST v1 route (Fastify, loopback only), an MCP stdio tool and a SKILL document. There is no path where the CLI can do something REST cannot.

Writes land in a local SQLite transaction plus an outbox, then sync upstream asynchronously. When upstream disagrees, a reconciler records the difference instead of silently overwriting, so callers always get a definite local fact. Login is DingTalk SSO via QR; tokens are encrypted with AES-256-GCM, a heartbeat keeps them alive, and a re-login queue handles the 24-hour expiry.

Architecture notes

  • Session pool plus request pool: serialised per account, QPS limits with jitter; the browser only starts for login or refresh.
  • Local fact store plus event bus: the truth of a write exists locally first, then travels upstream.
  • Customs cache: force-cached with TTL, invalidation from the upstream change log, an LRU bound and permission-domain isolation. A cold lookup takes about a second; a hit is measured in tenths of a millisecond.
  • Operations: systemd service, health checks, 600 permissions on secrets and tokens.

What I learned

The registry is the product. When four interfaces come from one definition, maintenance drops from four jobs to one. I also learned to put limits in the README: the contract for creating a follow-up is not fully confirmed yet, and deleting a customer needs permissions my test account did not have. Writing that down is cheaper than pretending.

53 tests pass; the project is MIT licensed. The bigger lesson: the browser is a contract you did not get to design, and the value of wrapping it is turning that contract into local, verifiable facts.

43

Capabilities

53

Tests passing

4

Entry points

Next projectFeige Outbound Platformfeige-outbound-platformView project