Design and Implementation of a Scalable Article Publishing Tool for Xianyu Community
The project designs a scalable Xianyu article publishing tool that uses a compressed JSON schema based on DingTalk’s we‑editor to store and render extensible, high‑fidelity content, separating text and images, adding plugin‑based cards, and optimizing performance to halve first‑screen load time while supporting future interactive features.
Background: Xianyu community needs a dedicated article publishing tool because the current marketing platform produces static pages that cannot be audited or extended, and external creators cannot contribute.
Research: Similar platforms (Zhihu, Juejin, WeChat Official Accounts) offer rich content, excellent browsing experience, and third‑party templates. The goal is to align Xianyu articles with these standards while respecting its own brand style.
Goals: 1) 100% information fidelity; 2) extensible content structure; 3) instant page load.
Solution: Define a JSON‑based schema protocol that records all article information. The publisher generates the schema; the viewer parses it to render the article. The protocol is built on DingTalk’s we‑editor rich‑text format.
Protocol Design: Simple, extensible rules; supports arbitrary future content types; stores structured data in three fields (text, image array, custom extension). Compression is applied to fit database limits.
Extension: New plugins are added as card subclasses with metadata; the client renders them according to the card type.
Storage: Text and images are extracted to separate tables; the full JSON string is stored in a custom field after compression.
Publisher: Uses DingTalk’s we‑editor as the core editor. Handles paste scenarios by stripping inline styles and re‑hosting external images/video to internal storage.
Plugin Extension: Basic editing features are retained; video and link capabilities are provided via custom plugins that insert idleVideoCard cards.
Function Service Layer: A FAAS layer performs security‑related structured extraction on the server side, ensuring a unified JavaScript implementation.
Article Display: The viewer restores the schema into visual components, parses it, and applies performance optimizations.
Protocol Parsing: Pseudocode shows how the schema is transformed back into rich‑text components.
Performance Optimization: Combines resources, lazy‑loads images, caches static assets, pre‑fetches data, and removes the native loading indicator, reducing first‑screen time from ~1700 ms to ~1000 ms.
Outlook: The tool is now at 0→1 and will evolve to support richer interactive elements (polls, bullet screens, templates) and a full creator platform covering text, video, analytics, and content discovery.
Xianyu Technology
Official account of the Xianyu technology team
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.