feat: isolate BossAI website with Next.js

This commit is contained in:
boos
2026-06-06 05:30:10 +08:00
parent d75daf72d6
commit 03046152fd
21 changed files with 3153 additions and 1085 deletions
-53
View File
@@ -1,53 +0,0 @@
import { describe, expect, it } from 'vitest';
import { create, type ReactTestInstance } from 'react-test-renderer';
import { MemoryRouter } from 'react-router-dom';
import Landing from './Landing.js';
function collectText(node: ReactTestInstance): string {
return (node.children || []).map((child) => {
if (typeof child === 'string') return child;
return collectText(child);
}).join('');
}
describe('Landing page', () => {
it('presents the public BossAI website with product capabilities', () => {
const root = create(
<MemoryRouter>
<Landing />
</MemoryRouter>,
);
try {
const text = collectText(root.root);
expect(text).toContain('聚合多模型多模态的 AI 应用平台');
expect(text).toContain('统一模型网关');
expect(text).toContain('工作流生产台');
expect(text).toContain('短视频工厂');
expect(text).toContain('Comfy Cloud API 后端');
expect(text).toContain('Rust 二进制 + 内置 Web');
expect(text).not.toContain('\u2014');
} finally {
root.unmount();
}
});
it('links to user login, registration and admin access', () => {
const root = create(
<MemoryRouter>
<Landing />
</MemoryRouter>,
);
try {
const links = root.root.findAll((node) => node.type === 'a');
const hrefs = links.map((node) => node.props.href || node.props.to);
expect(hrefs).toContain('/user/login');
expect(hrefs).toContain('/user/register');
expect(hrefs).toContain('/boos');
} finally {
root.unmount();
}
});
});
-207
View File
@@ -1,207 +0,0 @@
import React from 'react';
import { Link } from 'react-router-dom';
const capabilityGroups = [
{
title: '统一模型网关',
body: '把 OpenAI、Claude、Gemini、方舟和各类中转站收束成一个下游入口。',
items: ['/v1/chat/completions', '/v1/messages', '/v1/images/generations', '/v1/videos'],
},
{
title: '工作流生产台',
body: '内嵌 ComfyUI 前端,按配置连接 Comfy Cloud、RunningHub、外部 ComfyUI 或 BoosAPI 执行器。',
items: ['Workflow Studio', 'Comfy Cloud', 'RunningHub', 'External Comfy'],
},
{
title: '多模态创作应用',
body: '生图助手、视频助手、数字人和短视频工厂复用同一套模型路由与用户密钥。',
items: ['生图助手', '视频助手', '数字人', '短视频工厂'],
},
];
const productModules = [
{ name: '模型路由', detail: '按站点、账号、令牌和模型调度,失败冷却后自动切换通道。' },
{ name: '模型广场', detail: '普通用户只看品牌和可用模型,管理员查看完整供应商与账号覆盖。' },
{ name: '使用日志', detail: '记录延迟、模型、计费和调用来源,便于对账和排障。' },
{ name: '工作空间', detail: '归档图片、视频、音频和任务产出,用户之间保持隔离。' },
{ name: '公告系统', detail: '管理员发布公告,普通用户登录后可直接弹窗确认。' },
{ name: '数据库后端', detail: '支持 SQLite 与 PostgreSQL,并保留迁移工具和运行时检测。' },
];
const workflowModes = [
{ mode: 'cloud', label: 'Comfy Cloud API 后端' },
{ mode: 'runninghub', label: 'RunningHub API 后端' },
{ mode: 'external', label: '外部完整版 ComfyUI' },
{ mode: 'boosapi', label: 'Rust API-native 执行器' },
];
const previewRows = [
{ label: 'Chat', model: 'gpt-5.4', status: '已路由' },
{ label: 'Image', model: 'gpt-image-2', status: '生成中' },
{ label: 'Video', model: 'seedance', status: '排队中' },
{ label: 'Claude', model: '/v1/messages', status: '流式' },
];
export default function Landing() {
return (
<main className="landing-page">
<nav className="landing-nav" aria-label="官网导航">
<Link to="/" className="landing-brand" aria-label="BossAI 首页">
<img src="/logo.png" alt="BossAI" />
<span>BossAI</span>
</Link>
<div className="landing-nav-links">
<a href="#platform">平台能力</a>
<a href="#workflow">工作流</a>
<a href="#deploy">部署形态</a>
</div>
<div className="landing-nav-actions">
<Link to="/user/login" className="landing-link-button">用户登录</Link>
<Link to="/boos" className="landing-primary-button">进入后台</Link>
</div>
</nav>
<section className="landing-hero">
<div className="landing-hero-copy">
<div className="landing-brand-strip">多模型 · 多模态 · 工作流</div>
<h1>聚合多模型多模态的 AI 应用平台</h1>
<p>
统一 API 网关、智能路由、Comfy 工作流和创作应用,让团队用一套后台管理对话、生图、视频和数字人生产。
</p>
<div className="landing-hero-actions">
<Link to="/user/register" className="landing-primary-button">开始使用</Link>
<Link to="/user/login" className="landing-secondary-button">用户登录</Link>
</div>
</div>
<div className="landing-visual" aria-label="BossAI 平台预览">
<div className="landing-visual-top">
<span>Unified Gateway</span>
<strong>路由在线</strong>
</div>
<div className="landing-route-stack">
{previewRows.map((row) => (
<div key={row.label} className="landing-route-row">
<span>{row.label}</span>
<strong>{row.model}</strong>
<em>{row.status}</em>
</div>
))}
</div>
<div className="landing-visual-grid">
<div>
<span>Workspace</span>
<strong>归档产出</strong>
</div>
<div>
<span>Billing</span>
<strong>日志计费</strong>
</div>
</div>
</div>
</section>
<section id="platform" className="landing-section landing-capabilities">
<div className="landing-section-heading">
<h2>从 API 到内容生产,一条链路打通</h2>
<p>BossAI 不是只转发请求。它把模型接入、路由、用户、工作流和产出归档放在同一个运行面里。</p>
</div>
<div className="landing-capability-grid">
{capabilityGroups.map((group) => (
<article key={group.title} className="landing-capability-card">
<h3>{group.title}</h3>
<p>{group.body}</p>
<div className="landing-chip-row">
{group.items.map((item) => <span key={item}>{item}</span>)}
</div>
</article>
))}
</div>
</section>
<section id="workflow" className="landing-workflow">
<div className="landing-workflow-main">
<h2>用熟悉的 ComfyUI 前端,接你的云端 API</h2>
<p>
工作流页面可切换 Cloud、RunningHub、External 和 BoosAPI 后端。你继续使用熟悉的节点画布,BossAI 负责鉴权、代理、任务记录和工作空间归档。
</p>
<div className="landing-mode-list">
{workflowModes.map((item) => (
<div key={item.mode}>
<code>{item.mode}</code>
<span>{item.label}</span>
</div>
))}
</div>
</div>
<div className="landing-workflow-side">
<div className="landing-node-card is-wide">
<span>Prompt</span>
<strong>商品文案、角色设定、镜头脚本</strong>
</div>
<div className="landing-node-grid">
<div className="landing-node-card">
<span>Image</span>
<strong>图像生成</strong>
</div>
<div className="landing-node-card">
<span>Video</span>
<strong>视频任务</strong>
</div>
<div className="landing-node-card">
<span>Agent</span>
<strong>视频助手</strong>
</div>
<div className="landing-node-card">
<span>Archive</span>
<strong>工作空间</strong>
</div>
</div>
</div>
</section>
<section className="landing-section">
<div className="landing-module-grid">
{productModules.map((module) => (
<article key={module.name} className="landing-module-row">
<h3>{module.name}</h3>
<p>{module.detail}</p>
</article>
))}
</div>
</section>
<section id="deploy" className="landing-deploy">
<div>
<h2>远程模型优先,本机不必有 GPU</h2>
<p>
当图像、视频和语音能力走上游 API、Comfy Cloud 或 RunningHub 时,BossAI 服务器只负责网关、数据库、Workflow UI 代理、日志和归档。
</p>
</div>
<div className="landing-deploy-panel">
<div>
<span>推荐形态</span>
<strong>Rust 二进制 + 内置 Web</strong>
</div>
<div>
<span>数据库</span>
<strong>SQLite / PostgreSQL</strong>
</div>
<div>
<span>执行能力</span>
<strong>API、Cloud、RunningHub、External</strong>
</div>
</div>
</section>
<section className="landing-final">
<h2>把模型、工作流和创作应用收进一个平台</h2>
<p>适合自建 AI 中转、团队模型管理、多模态创作和商业化用户面板。</p>
<div className="landing-hero-actions">
<Link to="/user/register" className="landing-primary-button">开始使用</Link>
<Link to="/boos" className="landing-secondary-button">进入后台</Link>
</div>
</section>
</main>
);
}