How openaispace/ai-trend-publish works
Based on both the file tree and the README, TrendPublish is a backend system built using Deno and TypeScript that focuses on trend discovery and automated content publishing (especially for Weixin/微信公众号). Its purpose is to scrape data from multiple sources (e.g., Twitter, websites via FireCrawl), process this data through AI-based summarization and ranking, convert content (using Markdown converters and templates), and finally publish articles automatically, while also providing notifications for task status and errors.
Main Components
• Scraping & Data Source Modules: Capture the modules under src/modules/scrapers and src/data-sources. These components are responsible for retrieving raw content from external sources.
• AI & Content Processing:
• Markdown Converter: Include a clear component for the Markdown conversion (with detailed sub-components for the various renderers in src/modules/md-converter) that translates source content into formatted text.
• Template Rendering & Publishing:
• Notification Services: Outline the notify modules (e.g., Dingding and Bark) that are used to push alerts and status messages.
• Workflow Orchestration: Represent scheduled tasks and workflows from src/controllers/cron.ts, src/works, and services (such as weixin-article.workflow.ts). This flows the overall process—from data collection to publication.
• Configuration & Database:
• Config Manager: Include a component for the configuration management (src/utils/config) that loads .env and other configuration details.
• Database: Show the local database integration managed via Drizzle in the drizzle folder and src/db, used for storing state, publication history, or content data.
• External AI/Image Providers: Mark the LLM and image generation providers (from src/providers) as external integration points that offer AI services and image generation capabilities.
Relationships and Interactions
• Content Transformation: From content processing flow, the output is then passed into the Markdown Converter. Once converted, it moves into the Template Rendering modules for final formatting.
• Publication: After rendering, the Publisher module pushes the formatted articles to the Weixin API (or potentially other publication channels).
• Notifications: In parallel or on specific outcomes (success or error), the Notification Services are called to alert users/administrators.
• Workflow Coordination: Show orchestration by a central Workflow Manager that triggers these steps at scheduled intervals (using the cron controller or workflows from src/works).
• Configuration & External Integration: Always denote that components such as AI services, image generators, and even the database are configured centrally through the config module.