Files
NebulaShell/website/docs/architecture.html
Falck a615b2af0f 重构文档中心与视差效果
- 删除旧版 docs.html API 文档,改为手写 6 个独立 HTML 页面
  (index/why-python/architecture/quickstart/plugins/development)
- 新增 css/docs.css 文档页样式(左侧导航树 + 右侧内容区)
- 添加左下角固定 "获取更多信息" 按钮跳转 Gitee Wiki
- dock.js 增加 getPathPrefix() 自动计算相对路径,修复子页面导航跳转
- 首页 3D 立方体:替换 logo 为纯白交互正方体,悬停弹出对话框展示项目特点
- parallax.js 自动检测文档页和首页,统一景深速度为 1.0 (100px 最大移动)
- 删除 logo.svg、旧版构建脚本及 API 版文档文件
2026-04-06 16:09:00 +08:00

106 lines
6.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>架构设计 - Future OSS 文档</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="../css/main.css" />
<link rel="stylesheet" href="../css/dock.css" />
<link rel="stylesheet" href="../css/docs.css" />
</head>
<body>
<canvas id="particles"></canvas>
<div id="dock-container"></div>
<main class="page-docs">
<header class="docs-header">
<div class="docs-header-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" width="22" height="22">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
<span>文档中心</span>
</div>
<div class="docs-header-breadcrumb">入门 · 架构设计</div>
<div class="docs-header-actions">
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-link">完整 Wiki</a>
</div>
</header>
<div class="docs-layout">
<aside class="docs-sidebar">
<div class="docs-nav-section">
<div class="docs-nav-section-title">入门</div>
<a href="index.html" class="docs-nav-item">什么是 FutureOSS<span class="nav-path">/ 项目介绍</span></a>
<a href="why-python.html" class="docs-nav-item">为什么选择 Python<span class="nav-path">/ 技术选型</span></a>
<a href="architecture.html" class="docs-nav-item active">架构设计<span class="nav-path">/ 三层架构</span></a>
</div>
<div class="docs-nav-section">
<div class="docs-nav-section-title">快速开始</div>
<a href="quickstart.html" class="docs-nav-item">三步运行<span class="nav-path">/ 安装部署</span></a>
</div>
<div class="docs-nav-section">
<div class="docs-nav-section-title">插件</div>
<a href="plugins.html" class="docs-nav-item">官方插件列表<span class="nav-path">/ 12+ 插件</span></a>
<a href="development.html" class="docs-nav-item">插件开发指南<span class="nav-path">/ 开发基础</span></a>
</div>
</aside>
<div class="docs-content-wrapper">
<article class="docs-content">
<h1>🏗️ 架构设计</h1>
<h2>三层架构</h2>
<p><strong>核心层 (oss/)</strong> — 插件管理、事件总线、消息总线、配置系统、日志系统。框架的核心基础设施。</p>
<p><strong>插件层 (store/)</strong> — 协议插件HTTP/WS/TCP、工具插件依赖解析、存储、桥接、中间件插件熔断、热重载、生命周期</p>
<p><strong>应用层 (data/)</strong> — 第三方插件HTML 渲染、Web 工具包)+ 运行时数据(配置文件、共享存储)。</p>
<h2>启动流程</h2>
<ol>
<li>加载 <code>config.yaml</code> → Config 对象</li>
<li>初始化 Logger</li>
<li>创建 PluginManager只加载 <code>plugin-loader</code></li>
<li><code>plugin-loader</code> 扫描 <code>store/</code> 目录,加载所有插件</li>
<li>使用 <code>dependency</code> 插件进行拓扑排序</li>
<li>按拓扑顺序 init() → start() 所有插件</li>
<li>HTTP 服务器启动,注册路由</li>
<li>信号监听 → Ctrl+C 时优雅关闭(逆序 stop</li>
</ol>
<h2>目录结构</h2>
<pre><code>FutureOSS/
├── oss/ # 核心框架
│ ├── cli.py # CLI 入口
│ ├── config/ # 配置加载
│ ├── logger/ # 日志系统
│ ├── plugin/ # 插件核心
│ │ ├── types.py # 类型定义
│ │ ├── loader.py # 动态加载器
│ │ ├── manager.py # 插件管理器
│ │ └── event_bus.py # 事件总线
│ └── server/ # HTTP 服务器
├── store/ # 本地插件仓库
│ └── @{FutureOSS}/ # 官方插件
└── data/ # 运行时数据</code></pre>
</article>
</div>
</div>
</main>
<a href="https://gitee.com/starlight-apk/feature-oss/wikis" target="_blank" class="docs-wiki-btn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
<span>获取更多信息</span>
</a>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
<script src="../js/dock.js"></script>
<script src="../js/particles.js"></script>
<script src="../js/parallax.js"></script>
<script src="../js/animations.js"></script>
</body>
</html>