Architecture
AIGCS system architecture overview
Overview
The current version of AIGCS (V1) is defined as a highly cohesive, standard Node.js Monorepo. It focuses primarily on stability within traditional server environments and local SQLite file databases. Although the structure reserves deployment compatibility for Edge Functions (e.g., Tencent Cloud EdgeOne) in the packages/edgeone directory for future development, a comprehensive cloud-native (Serverless/Distributed) refactoring has been deferred to the next major phase. Our current philosophy is "treating the present as a stable V1."
AIGCS is a monorepo containing five core packages under packages/ and plugins under packages/plugins/:
Data Flow
Request Lifecycle
- Widget loads via
<script>on the user's website - Widget fetches comments from the Server API
- Server checks the page cache:
- Cached: returns existing AI comments immediately
- Not cached: fetches page content → sends to AI provider → generates comment → caches
- Comments are displayed in the Widget (CDN-cached with ETag)
Plugin System
Plugins hook into the server lifecycle via a hook system:
Each hook receives a context object (PluginHookContext) with access to request data, comments, and server configuration.