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
+2
View File
@@ -4,9 +4,11 @@
.env.* .env.*
data/ data/
node_modules/ node_modules/
website/.next/
dist/ dist/
release/ release/
*.log *.log
*.tsbuildinfo
logs/ logs/
tmp/ tmp/
!tmp/.gitkeep !tmp/.gitkeep
+27 -2
View File
@@ -325,7 +325,7 @@ docker compose up -d
│ ├── billing/ # 计费逻辑 │ ├── billing/ # 计费逻辑
│ └── notification/ # 通知推送 │ └── notification/ # 通知推送
├── migrations/ # SQLite 迁移 ├── migrations/ # SQLite 迁移
├── src/web/ # 前端源码(React 19 + Vite) ├── src/web/ # 管理台前端源码(React + Vite)
│ ├── authSession.ts # 统一会话工具:commitSession/clearSession/getSessionToken(按 'admin' | 'user' 分桶) │ ├── authSession.ts # 统一会话工具:commitSession/clearSession/getSessionToken(按 'admin' | 'user' 分桶)
│ ├── loginError.ts # 登录错误归一化(resolveLoginErrorMessage) │ ├── loginError.ts # 登录错误归一化(resolveLoginErrorMessage)
│ ├── pages/ │ ├── pages/
@@ -334,6 +334,7 @@ docker compose up -d
│ │ ├── Workflows.tsx # Workflow Studio 入口 │ │ ├── Workflows.tsx # Workflow Studio 入口
│ │ └── ... │ │ └── ...
│ └── components/ │ └── components/
├── website/ # 独立官网(Next.js 16 App Router + React 19)
└── dist/web/ # 前端构建产物(由 Rust serve) └── dist/web/ # 前端构建产物(由 Rust serve)
``` ```
@@ -391,7 +392,8 @@ BOOSAPI_COMFYUI__API_KEY=your-workflow-backend-key
| 协议转换 | OpenAI / Claude / Gemini 全兼容 | | 协议转换 | OpenAI / Claude / Gemini 全兼容 |
| Workflow Studio | 内嵌 ComfyUI 前端 + Cloud / RunningHub / External / BoosAPI 多后端 | | Workflow Studio | 内嵌 ComfyUI 前端 + Cloud / RunningHub / External / BoosAPI 多后端 |
| 视频助手 | SSE 流式 + gpt-image-2 + TTS 自动生成 | | 视频助手 | SSE 流式 + gpt-image-2 + TTS 自动生成 |
| 前端框架 | React 19 + Vite(仅构建工具) | | 管理台前端 | React + Vite(仅构建工具) |
| 独立官网 | Next.js 16 App Router + React 19 + TypeScript |
| 样式 | Tailwind CSS v4 | | 样式 | Tailwind CSS v4 |
| 数据可视化 | VChart | | 数据可视化 | VChart |
| 容器化 | Docker + Docker Compose + K3s | | 容器化 | Docker + Docker Compose + K3s |
@@ -399,6 +401,8 @@ BOOSAPI_COMFYUI__API_KEY=your-workflow-backend-key
> **运行时零 Node.js 依赖**,Node.js 仅用作前端构建工具。生产环境只需 Rust 编译后的单二进制文件。 > **运行时零 Node.js 依赖**,Node.js 仅用作前端构建工具。生产环境只需 Rust 编译后的单二进制文件。
> 独立官网位于 `website/`,可单独部署为 Next.js 服务;BoosAPI 管理台仍由 Rust 静态 serve。若把官网部署在根域名,可设置 `BOSSAI_BACKEND_URL=http://127.0.0.1:4000`,Next 会把 `/boos`、`/user/*`、`/api/*`、`/v1/*`、`/workflow-ui/*` 等路径反代回 Rust 后端。
--- ---
## 🛠️ 本地开发 ## 🛠️ 本地开发
@@ -456,6 +460,27 @@ BOOSAPI_FRONTEND_PM=auto ./build-and-run.sh
> 生产环境不需要 Node.js 进程。`npm run build` 后,Rust 后端直接 serve 静态文件。 > 生产环境不需要 Node.js 进程。`npm run build` 后,Rust 后端直接 serve 静态文件。
> 前端 API 请求通过 Vite 代理(开发)或同域访问(生产)指向 `localhost:4000`。 > 前端 API 请求通过 Vite 代理(开发)或同域访问(生产)指向 `localhost:4000`。
### 独立官网(Next.js)
官网已经从管理台中隔离,使用 Next.js 16 App Router、React 19、TypeScript、Tailwind CSS 4 和自定义 SVG/CSS motion system:
```bash
# 首次安装
npm --prefix website install
# 本地开发
BOSSAI_BACKEND_URL=http://127.0.0.1:4000 npm run website:dev
# 类型检查与生产构建
npm run website:typecheck
npm run website:build
# 生产运行
BOSSAI_BACKEND_URL=http://127.0.0.1:4000 npm run website:start
```
官网默认只渲染 `/`,后台相关路径由 `website/next.config.ts` 反代到 BoosAPI Rust 服务。
### 生产单二进制构建 ### 生产单二进制构建
```bash ```bash
+4
View File
@@ -32,6 +32,10 @@
"typecheck:web": "tsc -p tsconfig.web.json", "typecheck:web": "tsc -p tsconfig.web.json",
"typecheck:web:test": "tsc -p tsconfig.web.test.json", "typecheck:web:test": "tsc -p tsconfig.web.test.json",
"typecheck": "npm run typecheck:web && npm run typecheck:web:test", "typecheck": "npm run typecheck:web && npm run typecheck:web:test",
"website:dev": "npm --prefix website run dev",
"website:build": "npm --prefix website run build",
"website:start": "npm --prefix website run start",
"website:typecheck": "npm --prefix website run typecheck",
"docs:dev": "vitepress dev docs --host 0.0.0.0 --port 4173", "docs:dev": "vitepress dev docs --host 0.0.0.0 --port 4173",
"docs:build": "vitepress build docs", "docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs --host 0.0.0.0 --port 4173", "docs:preview": "vitepress preview docs --host 0.0.0.0 --port 4173",
-205
View File
@@ -1,205 +0,0 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { ReactNode } from 'react';
import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer';
import { MemoryRouter } from 'react-router-dom';
import App from './App.js';
const { apiMock, userApiMock, authSessionMock } = vi.hoisted(() => ({
apiMock: {
getEvents: vi.fn(),
},
userApiMock: {
getAnnouncements: vi.fn(),
},
authSessionMock: {
getSessionToken: vi.fn(),
clearSession: vi.fn(),
},
}));
vi.mock('react-dom', async () => {
const actual = await vi.importActual<typeof import('react-dom')>('react-dom');
return {
...actual,
createPortal: (node: unknown) => node,
};
});
vi.mock('./api.js', () => ({
api: apiMock,
userApi: userApiMock,
}));
vi.mock('./authSession.js', () => ({
getSessionToken: authSessionMock.getSessionToken,
clearSession: authSessionMock.clearSession,
}));
vi.mock('./components/SearchModal.js', () => ({
default: () => null,
}));
vi.mock('./components/NotificationPanel.js', () => ({
default: () => null,
}));
vi.mock('./components/TooltipLayer.js', () => ({
default: () => null,
}));
vi.mock('./components/useAnimatedVisibility.js', () => ({
useAnimatedVisibility: (open: boolean) => ({
shouldRender: open,
isVisible: open,
}),
}));
vi.mock('./i18n.js', () => ({
I18nProvider: ({ children }: { children: ReactNode }) => children,
useI18n: () => ({
language: 'zh',
toggleLanguage: vi.fn(),
t: (text: string) => text,
}),
}));
vi.mock('./pages/Dashboard.js', () => ({
default: () => <div>Dashboard</div>,
}));
vi.mock('./pages/Landing.js', () => ({
default: () => <div>Public Landing Route</div>,
}));
function collectText(node: ReactTestInstance): string {
return (node.children || []).map((child) => {
if (typeof child === 'string') return child;
return collectText(child);
}).join('');
}
function createLocalStorage() {
const store = new Map<string, string>([
['metapi.theme.mode', 'dark'],
['metapi.firstUseDocReminder', '1'],
['metapi.userProfile', JSON.stringify({
name: '管理员',
avatarSeed: 'seed-1',
avatarStyle: 'identicon',
})],
]);
return {
getItem: (key: string) => store.get(key) ?? null,
setItem: (key: string, value: string) => {
store.set(key, String(value));
},
removeItem: (key: string) => {
store.delete(key);
},
};
}
function setupRuntime() {
const matchMedia = (query: string) => ({
matches: query.includes('prefers-color-scheme'),
media: query,
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
addListener: vi.fn(),
removeListener: vi.fn(),
dispatchEvent: vi.fn(),
onchange: null,
});
vi.stubGlobal('localStorage', createLocalStorage());
vi.stubGlobal('window', {
innerWidth: 1280,
matchMedia,
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
});
vi.stubGlobal('document', {
body: { style: {} },
documentElement: {
setAttribute: vi.fn(),
getAttribute: vi.fn(),
},
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
});
}
async function flushMicrotasks() {
await act(async () => {
await Promise.resolve();
await Promise.resolve();
await Promise.resolve();
});
}
describe('App public landing', () => {
beforeEach(() => {
vi.clearAllMocks();
setupRuntime();
apiMock.getEvents.mockResolvedValue([]);
userApiMock.getAnnouncements.mockResolvedValue({ items: [] });
authSessionMock.clearSession.mockImplementation(() => {});
});
afterEach(() => {
vi.unstubAllGlobals();
vi.clearAllMocks();
});
it('renders the public landing route at / when no session exists', async () => {
authSessionMock.getSessionToken.mockReturnValue(null);
let root!: ReactTestRenderer;
try {
await act(async () => {
root = create(
<MemoryRouter initialEntries={['/']}>
<App />
</MemoryRouter>,
);
});
await flushMicrotasks();
const text = collectText(root.root);
expect(text).toContain('Public Landing Route');
expect(text).not.toContain('用户登录后继续');
} finally {
if (root) {
await act(async () => {
root.unmount();
});
}
}
});
it('keeps the admin dashboard at / after admin session exists', async () => {
authSessionMock.getSessionToken.mockImplementation((audience: string) => (
audience === 'admin' ? 'admin-token' : null
));
let root!: ReactTestRenderer;
try {
await act(async () => {
root = create(
<MemoryRouter initialEntries={['/']}>
<App />
</MemoryRouter>,
);
});
await flushMicrotasks();
const text = collectText(root.root);
expect(text).toContain('Dashboard');
expect(text).not.toContain('Public Landing Route');
} finally {
if (root) {
await act(async () => {
root.unmount();
});
}
}
});
});
-12
View File
@@ -21,7 +21,6 @@ import CenteredModal from './components/CenteredModal.js';
import AdminLoginPage from './pages/auth/AdminLoginPage.js'; import AdminLoginPage from './pages/auth/AdminLoginPage.js';
import UserLoginPage from './pages/auth/UserLoginPage.js'; import UserLoginPage from './pages/auth/UserLoginPage.js';
import { SiteAnnouncementContent } from './pages/helpers/siteAnnouncementPresentation.js'; import { SiteAnnouncementContent } from './pages/helpers/siteAnnouncementPresentation.js';
const Landing = lazy(() => import('./pages/Landing.js'));
const Dashboard = lazy(() => import('./pages/Dashboard.js')); const Dashboard = lazy(() => import('./pages/Dashboard.js'));
const Sites = lazy(() => import('./pages/Sites.js')); const Sites = lazy(() => import('./pages/Sites.js'));
const Accounts = lazy(() => import('./pages/Accounts.js')); const Accounts = lazy(() => import('./pages/Accounts.js'));
@@ -698,7 +697,6 @@ function AppShell() {
}; };
const isAdminLoginPage = location.pathname === '/boos'; const isAdminLoginPage = location.pathname === '/boos';
const isPublicUserPage = ['/user/login', '/user/register'].includes(location.pathname); const isPublicUserPage = ['/user/login', '/user/register'].includes(location.pathname);
const isPublicLandingRoot = !authed && !userAuthed && location.pathname === '/';
if (isUserPage && isPublicUserPage) { if (isUserPage && isPublicUserPage) {
if (userAuthed) return <Navigate to="/user/dashboard" />; if (userAuthed) return <Navigate to="/user/dashboard" />;
@@ -715,16 +713,6 @@ function AppShell() {
); );
} }
if (isPublicLandingRoot) {
return (
<Suspense fallback={<RouteLoadingFallback />}>
<Routes>
<Route path="/" element={<Landing />} />
</Routes>
</Suspense>
);
}
if (!authed && !isUserPage) { if (!authed && !isUserPage) {
if (userAuthed) { if (userAuthed) {
return <Navigate to="/user/dashboard" />; return <Navigate to="/user/dashboard" />;
-606
View File
@@ -89,612 +89,6 @@ body {
min-height: 100vh; min-height: 100vh;
} }
/* ===== Public Landing ===== */
.landing-page {
min-height: 100dvh;
overflow: hidden;
background:
radial-gradient(circle at 78% 8%, rgba(31, 111, 235, 0.22), transparent 32%),
radial-gradient(circle at 12% 62%, rgba(14, 165, 145, 0.14), transparent 30%),
linear-gradient(180deg, #08111f 0%, #0b1220 48%, #0f1625 100%);
color: #f7fbff;
}
.landing-page a {
color: inherit;
text-decoration: none;
}
.landing-nav {
width: min(1180px, calc(100% - 40px));
height: 72px;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 24px;
margin: 0 auto;
}
.landing-brand,
.landing-nav-actions,
.landing-nav-links,
.landing-hero-actions {
display: inline-flex;
align-items: center;
}
.landing-brand {
gap: 10px;
font-weight: 780;
letter-spacing: 0.01em;
}
.landing-brand img {
width: 34px;
height: 34px;
border-radius: 10px;
}
.landing-nav-links {
justify-content: center;
gap: 24px;
color: rgba(226, 232, 240, 0.72);
font-size: 13px;
}
.landing-nav-links a:hover {
color: #ffffff;
}
.landing-nav-actions,
.landing-hero-actions {
gap: 10px;
}
.landing-primary-button,
.landing-secondary-button,
.landing-link-button {
min-height: 40px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 999px;
padding: 0 18px;
font-size: 13px;
font-weight: 720;
white-space: nowrap;
transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.landing-primary-button {
background: #f8fafc;
color: #0f172a;
box-shadow: 0 14px 34px rgba(5, 12, 24, 0.32);
}
.landing-secondary-button,
.landing-link-button {
border: 1px solid rgba(226, 232, 240, 0.2);
background: rgba(15, 23, 42, 0.42);
color: #e5edf8;
}
.landing-link-button {
min-height: 36px;
background: transparent;
border-color: transparent;
color: rgba(226, 232, 240, 0.76);
}
.landing-primary-button:hover,
.landing-secondary-button:hover,
.landing-link-button:hover {
transform: translateY(-1px);
}
.landing-secondary-button:hover,
.landing-link-button:hover {
border-color: rgba(226, 232, 240, 0.36);
background: rgba(30, 41, 59, 0.62);
}
.landing-hero {
width: min(1180px, calc(100% - 40px));
min-height: calc(100dvh - 72px);
display: grid;
grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
align-items: center;
gap: 56px;
margin: 0 auto;
padding: 42px 0 58px;
}
.landing-hero-copy {
display: grid;
gap: 22px;
align-content: center;
}
.landing-brand-strip {
width: fit-content;
border: 1px solid rgba(148, 163, 184, 0.24);
border-radius: 999px;
background: rgba(15, 23, 42, 0.46);
color: rgba(226, 232, 240, 0.82);
padding: 8px 12px;
font-size: 12px;
font-weight: 720;
}
.landing-hero h1 {
max-width: 780px;
margin: 0;
font-size: clamp(42px, 6vw, 78px);
line-height: 0.98;
letter-spacing: -0.045em;
}
.landing-hero p,
.landing-section-heading p,
.landing-workflow-main p,
.landing-deploy p,
.landing-final p {
max-width: 62ch;
margin: 0;
color: rgba(203, 213, 225, 0.78);
font-size: 16px;
line-height: 1.75;
}
.landing-visual {
position: relative;
display: grid;
gap: 14px;
border: 1px solid rgba(148, 163, 184, 0.22);
border-radius: 28px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04)),
rgba(9, 18, 32, 0.78);
padding: 18px;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.18),
0 34px 90px rgba(0, 0, 0, 0.42);
}
.landing-visual::before {
content: "";
position: absolute;
inset: 16px;
border-radius: 22px;
border: 1px solid rgba(255, 255, 255, 0.08);
pointer-events: none;
}
.landing-visual-top,
.landing-route-row,
.landing-visual-grid > div,
.landing-node-card,
.landing-deploy-panel,
.landing-capability-card,
.landing-module-row {
border: 1px solid rgba(148, 163, 184, 0.18);
background: rgba(15, 23, 42, 0.58);
}
.landing-visual-top {
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 18px;
padding: 14px 16px;
}
.landing-visual-top span,
.landing-visual-grid span,
.landing-node-card span,
.landing-deploy-panel span {
color: rgba(148, 163, 184, 0.9);
font-size: 12px;
}
.landing-visual-top strong,
.landing-visual-grid strong,
.landing-node-card strong,
.landing-deploy-panel strong {
color: #f8fafc;
font-size: 14px;
}
.landing-route-stack {
display: grid;
gap: 9px;
}
.landing-route-row {
display: grid;
grid-template-columns: 72px minmax(0, 1fr) auto;
align-items: center;
gap: 12px;
border-radius: 16px;
padding: 13px 14px;
}
.landing-route-row span {
color: rgba(125, 211, 252, 0.92);
font-size: 12px;
font-weight: 760;
}
.landing-route-row strong {
overflow: hidden;
color: #f8fafc;
font-size: 14px;
text-overflow: ellipsis;
white-space: nowrap;
}
.landing-route-row em {
color: rgba(203, 213, 225, 0.72);
font-size: 12px;
font-style: normal;
}
.landing-visual-grid,
.landing-node-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
}
.landing-visual-grid > div,
.landing-node-card {
display: grid;
gap: 6px;
min-height: 104px;
align-content: end;
border-radius: 18px;
padding: 14px;
}
.landing-section,
.landing-workflow,
.landing-deploy,
.landing-final {
width: min(1180px, calc(100% - 40px));
margin: 0 auto;
}
.landing-section {
padding: 64px 0;
}
.landing-section-heading {
display: grid;
gap: 12px;
margin-bottom: 24px;
}
.landing-section-heading h2,
.landing-workflow-main h2,
.landing-deploy h2,
.landing-final h2 {
max-width: 760px;
margin: 0;
color: #f8fafc;
font-size: clamp(30px, 4vw, 50px);
line-height: 1.06;
letter-spacing: -0.035em;
}
.landing-capability-grid {
display: grid;
grid-template-columns: 1.15fr 0.85fr;
gap: 14px;
}
.landing-capability-card {
display: grid;
gap: 18px;
min-height: 250px;
border-radius: 24px;
padding: 24px;
}
.landing-capability-card:first-child {
grid-row: span 2;
min-height: 514px;
background:
linear-gradient(135deg, rgba(14, 165, 145, 0.2), rgba(15, 23, 42, 0.58) 46%),
rgba(15, 23, 42, 0.58);
}
.landing-capability-card h3,
.landing-module-row h3 {
margin: 0;
color: #f8fafc;
font-size: 22px;
letter-spacing: -0.02em;
}
.landing-capability-card p,
.landing-module-row p {
margin: 0;
color: rgba(203, 213, 225, 0.76);
line-height: 1.72;
}
.landing-chip-row {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: auto;
}
.landing-chip-row span {
border: 1px solid rgba(148, 163, 184, 0.2);
border-radius: 999px;
background: rgba(2, 6, 23, 0.28);
color: rgba(226, 232, 240, 0.82);
padding: 7px 10px;
font-size: 12px;
}
.landing-workflow {
display: grid;
grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
gap: 18px;
align-items: stretch;
padding: 36px;
border: 1px solid rgba(148, 163, 184, 0.18);
border-radius: 32px;
background:
linear-gradient(135deg, rgba(30, 64, 175, 0.18), transparent 42%),
rgba(15, 23, 42, 0.44);
}
.landing-workflow-main {
display: grid;
gap: 18px;
align-content: center;
}
.landing-mode-list {
display: grid;
gap: 8px;
margin-top: 8px;
}
.landing-mode-list div {
display: grid;
grid-template-columns: 112px minmax(0, 1fr);
gap: 12px;
align-items: center;
color: rgba(203, 213, 225, 0.74);
font-size: 13px;
}
.landing-mode-list code {
border: 1px solid rgba(125, 211, 252, 0.2);
border-radius: 999px;
background: rgba(14, 165, 233, 0.08);
color: rgba(125, 211, 252, 0.96);
padding: 6px 10px;
text-align: center;
}
.landing-workflow-side {
display: grid;
gap: 12px;
}
.landing-node-card.is-wide {
min-height: 150px;
background:
linear-gradient(135deg, rgba(248, 250, 252, 0.1), rgba(14, 165, 145, 0.08)),
rgba(15, 23, 42, 0.58);
}
.landing-module-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14px;
}
.landing-module-row {
min-height: 184px;
display: grid;
align-content: start;
gap: 12px;
border-radius: 22px;
padding: 22px;
}
.landing-deploy {
display: grid;
grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
gap: 28px;
align-items: center;
padding: 56px 0 44px;
}
.landing-deploy > div:first-child {
display: grid;
gap: 14px;
}
.landing-deploy-panel {
display: grid;
gap: 12px;
border-radius: 24px;
padding: 18px;
}
.landing-deploy-panel > div {
display: grid;
gap: 4px;
border-bottom: 1px solid rgba(148, 163, 184, 0.14);
padding: 0 0 12px;
}
.landing-deploy-panel > div:last-child {
border-bottom: 0;
padding-bottom: 0;
}
.landing-final {
display: grid;
justify-items: center;
gap: 16px;
padding: 72px 0 84px;
text-align: center;
}
.landing-final p {
max-width: 48ch;
}
@media (prefers-reduced-motion: no-preference) {
.landing-hero-copy,
.landing-visual,
.landing-capability-card,
.landing-workflow,
.landing-module-row,
.landing-deploy,
.landing-final {
animation: landing-rise 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.landing-visual {
animation-delay: 0.08s;
}
.landing-capability-card:nth-child(2),
.landing-module-row:nth-child(2) {
animation-delay: 0.04s;
}
.landing-capability-card:nth-child(3),
.landing-module-row:nth-child(3) {
animation-delay: 0.08s;
}
}
@keyframes landing-rise {
from {
opacity: 0;
transform: translateY(18px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 960px) {
.landing-nav {
grid-template-columns: 1fr auto;
}
.landing-nav-links {
display: none;
}
.landing-hero,
.landing-workflow,
.landing-deploy {
grid-template-columns: 1fr;
}
.landing-hero {
min-height: auto;
padding-top: 28px;
}
.landing-capability-grid,
.landing-module-grid {
grid-template-columns: 1fr;
}
.landing-capability-card:first-child {
grid-row: auto;
min-height: 280px;
}
}
@media (max-width: 640px) {
.landing-nav {
width: min(100% - 28px, 1180px);
height: auto;
padding: 14px 0;
}
.landing-brand span {
font-size: 15px;
}
.landing-nav-actions {
gap: 4px;
}
.landing-link-button {
display: none;
}
.landing-primary-button,
.landing-secondary-button {
min-height: 38px;
padding: 0 14px;
}
.landing-hero,
.landing-section,
.landing-workflow,
.landing-deploy,
.landing-final {
width: min(100% - 28px, 1180px);
}
.landing-hero {
gap: 30px;
padding-bottom: 42px;
}
.landing-hero h1 {
font-size: clamp(38px, 13vw, 54px);
}
.landing-hero-actions {
align-items: stretch;
flex-direction: column;
}
.landing-visual {
border-radius: 22px;
padding: 14px;
}
.landing-route-row {
grid-template-columns: 1fr;
gap: 5px;
}
.landing-visual-grid,
.landing-node-grid {
grid-template-columns: 1fr;
}
.landing-workflow {
padding: 20px;
border-radius: 24px;
}
.landing-mode-list div {
grid-template-columns: 1fr;
gap: 6px;
}
}
/* ===== Animations ===== */ /* ===== Animations ===== */
@keyframes spin { @keyframes spin {
to { to {
-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>
);
}
+22
View File
@@ -0,0 +1,22 @@
# BossAI Website
Standalone public website for BossAI.
## Stack
- Next.js 16 App Router
- React 19
- TypeScript
- Tailwind CSS 4
- Custom SVG and CSS motion, no animation runtime dependency
## Commands
```bash
npm install
npm run dev
npm run typecheck
npm run build
```
The Rust/Vite management console stays in the repository root. This folder is the isolated marketing website.
+834
View File
@@ -0,0 +1,834 @@
@import "tailwindcss";
:root {
--ink: #07110f;
--ink-soft: #101d19;
--panel: rgba(13, 25, 22, 0.82);
--line: rgba(231, 255, 219, 0.16);
--line-strong: rgba(215, 255, 77, 0.38);
--text: #f8fff4;
--muted: rgba(237, 249, 232, 0.68);
--faint: rgba(237, 249, 232, 0.44);
--acid: #d7ff4d;
--acid-2: #a5ff5f;
--ice: #e9f7ff;
--blue: #8bf6ff;
--radius: 24px;
}
* {
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
min-height: 100vh;
margin: 0;
background: var(--ink);
color: var(--text);
font-family: var(--font-geist), "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: geometricPrecision;
}
a {
color: inherit;
text-decoration: none;
}
button,
a {
-webkit-tap-highlight-color: transparent;
}
::selection {
background: rgba(215, 255, 77, 0.28);
color: var(--text);
}
.site-shell {
position: relative;
min-height: 100dvh;
overflow: hidden;
background:
radial-gradient(circle at 8% 18%, rgba(215, 255, 77, 0.16), transparent 28%),
radial-gradient(circle at 88% 8%, rgba(139, 246, 255, 0.12), transparent 30%),
linear-gradient(145deg, #040807 0%, #08110f 42%, #13221d 100%);
}
.site-shell::before {
position: fixed;
inset: 0;
z-index: 0;
pointer-events: none;
content: "";
background:
linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
background-size: 82px 82px;
mask-image: linear-gradient(to bottom, black, transparent 78%);
}
.site-noise {
position: fixed;
inset: 0;
z-index: 0;
pointer-events: none;
opacity: 0.24;
background-image:
repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 4px);
mix-blend-mode: overlay;
}
.site-nav,
.hero-section,
.platform-section,
.workflow-section,
.factory-section,
.deploy-section,
.final-section {
position: relative;
z-index: 1;
width: min(1180px, calc(100% - 40px));
margin-inline: auto;
}
.site-nav {
min-height: 88px;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 28px;
}
.brand-mark,
.nav-links,
.nav-actions,
.hero-actions {
display: flex;
align-items: center;
}
.brand-mark {
gap: 12px;
font-weight: 800;
letter-spacing: -0.02em;
}
.brand-mark img {
border-radius: 12px;
box-shadow: 0 12px 34px rgba(215, 255, 77, 0.14);
}
.nav-links {
justify-content: center;
gap: 30px;
color: var(--faint);
font-size: 13px;
font-weight: 650;
}
.nav-links a {
transition: color 180ms ease;
}
.nav-links a:hover {
color: var(--text);
}
.nav-actions {
gap: 10px;
}
.ghost-link,
.solid-link,
.primary-cta,
.secondary-cta {
min-height: 42px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 999px;
padding-inline: 18px;
border: 1px solid transparent;
font-size: 13px;
font-weight: 760;
white-space: nowrap;
transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.ghost-link,
.secondary-cta {
border-color: var(--line);
background: rgba(255, 255, 255, 0.03);
color: var(--muted);
}
.solid-link,
.primary-cta {
background: var(--acid);
color: #07110f;
box-shadow: 0 22px 48px rgba(215, 255, 77, 0.16);
}
.ghost-link:hover,
.solid-link:hover,
.primary-cta:hover,
.secondary-cta:hover {
transform: translateY(-2px);
}
.ghost-link:hover,
.secondary-cta:hover {
border-color: var(--line-strong);
color: var(--text);
}
.hero-section {
min-height: calc(100dvh - 88px);
display: grid;
grid-template-columns: minmax(0, 0.96fr) minmax(380px, 1.04fr);
align-items: start;
gap: 52px;
padding: clamp(72px, 10vh, 112px) 0 88px;
}
.hero-copy {
display: grid;
gap: 24px;
align-content: center;
}
.section-kicker {
width: fit-content;
display: inline-flex;
align-items: center;
gap: 9px;
border: 1px solid var(--line);
border-radius: 999px;
background: rgba(255, 255, 255, 0.035);
color: var(--muted);
padding: 8px 12px;
font-size: 12px;
font-weight: 760;
}
.pulse-dot {
width: 7px;
height: 7px;
border-radius: 999px;
background: var(--acid);
box-shadow: 0 0 0 0 rgba(215, 255, 77, 0.55);
animation: pulse-dot 2.4s ease-out infinite;
}
.hero-copy h1 {
max-width: 780px;
margin: 0;
font-size: clamp(48px, 7vw, 92px);
line-height: 0.9;
letter-spacing: -0.07em;
text-wrap: balance;
}
.hero-copy h1 span {
display: block;
color: var(--acid);
}
.hero-copy p {
max-width: 60ch;
margin: 0;
color: var(--muted);
font-size: 16px;
line-height: 1.85;
}
.hero-actions {
gap: 12px;
padding-top: 4px;
}
.primary-cta,
.secondary-cta {
min-height: 48px;
padding-inline: 22px;
font-size: 14px;
}
.hero-console {
position: relative;
margin-top: 14px;
min-height: 500px;
border: 1px solid var(--line);
border-radius: 32px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
rgba(10, 20, 18, 0.84);
padding: 18px;
overflow: hidden;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.16),
0 34px 90px rgba(0, 0, 0, 0.36);
}
.console-orbit {
position: absolute;
width: 420px;
height: 420px;
right: -120px;
top: -130px;
border: 1px solid rgba(215, 255, 77, 0.12);
border-radius: 999px;
background: radial-gradient(circle, rgba(215, 255, 77, 0.12), transparent 60%);
animation: slow-spin 24s linear infinite;
}
.console-orbit::after {
position: absolute;
width: 11px;
height: 11px;
top: 64px;
left: 76px;
border-radius: 999px;
content: "";
background: var(--acid);
box-shadow: 0 0 30px rgba(215, 255, 77, 0.58);
}
.console-bar,
.route-row,
.mini-grid > div,
.node-card,
.deploy-stack > div {
border: 1px solid var(--line);
background: rgba(255, 255, 255, 0.035);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.console-bar {
position: relative;
z-index: 2;
min-height: 54px;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 18px;
padding: 0 16px;
}
.console-bar span,
.route-row em,
.mini-grid span,
.node-card span,
.deploy-stack small {
color: var(--faint);
font-size: 12px;
font-style: normal;
}
.route-list {
position: relative;
z-index: 2;
display: grid;
gap: 10px;
margin-top: 12px;
}
.route-row {
min-height: 58px;
display: grid;
grid-template-columns: 78px 1fr auto;
align-items: center;
gap: 14px;
border-radius: 18px;
padding: 0 14px;
}
.route-row span {
color: var(--blue);
font-size: 12px;
font-weight: 800;
}
.route-row[data-tone="hot"] span {
color: #ffec99;
}
.route-row[data-tone="lime"] span {
color: var(--acid);
}
.route-row[data-tone="blue"] span {
color: var(--blue);
}
.route-row strong,
.mini-grid strong,
.node-card strong,
.deploy-stack strong {
font-weight: 780;
letter-spacing: -0.02em;
}
.mini-grid {
position: relative;
z-index: 2;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
margin-top: 12px;
}
.mini-grid > div {
min-height: 88px;
display: grid;
align-content: end;
gap: 8px;
border-radius: 18px;
padding: 14px;
}
.flow-glyph {
position: absolute;
right: -22px;
bottom: -8px;
width: 92%;
max-width: 520px;
opacity: 0.68;
}
.flow-line {
fill: none;
stroke: url("#lineGradient");
stroke-width: 2.5;
stroke-linecap: round;
stroke-dasharray: 12 18;
animation: flow-dash 8s linear infinite;
}
.flow-line-b {
animation-duration: 10s;
opacity: 0.62;
}
.flow-line-c {
animation-duration: 7s;
opacity: 0.48;
}
.flow-dot {
fill: var(--acid);
}
.dot-b {
fill: var(--blue);
}
.node {
fill: rgba(255, 255, 255, 0.04);
stroke: rgba(215, 255, 77, 0.22);
animation: node-float 5s ease-in-out infinite;
}
.node-b {
animation-delay: -1.5s;
}
.node-c {
animation-delay: -2.5s;
}
.platform-section,
.workflow-section,
.factory-section,
.deploy-section,
.final-section {
padding-block: 72px;
}
.section-heading {
display: grid;
gap: 14px;
margin-bottom: 28px;
}
.section-heading span,
.factory-copy span,
.deploy-section > div:first-child > span {
color: var(--acid);
font-family: var(--font-geist-mono), monospace;
font-size: 12px;
font-weight: 760;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.section-heading h2,
.workflow-panel h2,
.factory-copy h2,
.deploy-section h2,
.final-section h2 {
max-width: 800px;
margin: 0;
font-size: clamp(32px, 4.8vw, 62px);
line-height: 1;
letter-spacing: -0.055em;
text-wrap: balance;
}
.capability-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 14px;
}
.capability-card {
min-height: 260px;
display: grid;
align-content: space-between;
gap: 24px;
border: 1px solid var(--line);
border-radius: var(--radius);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
rgba(255, 255, 255, 0.025);
padding: 20px;
animation: card-rise 700ms ease both;
animation-delay: calc(var(--index) * 80ms);
}
.card-top {
display: flex;
align-items: center;
justify-content: space-between;
}
.card-top span {
color: var(--faint);
font-family: var(--font-geist-mono), monospace;
font-size: 11px;
text-transform: uppercase;
}
.card-top strong {
color: var(--acid);
font-family: var(--font-geist-mono), monospace;
font-size: 13px;
}
.capability-card h3 {
margin: 0 0 12px;
font-size: 22px;
letter-spacing: -0.04em;
}
.capability-card p,
.workflow-panel p,
.factory-copy p,
.deploy-section p,
.final-section p {
margin: 0;
color: var(--muted);
line-height: 1.8;
}
.workflow-section {
display: grid;
grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
gap: 18px;
align-items: stretch;
}
.workflow-panel,
.node-board,
.factory-section,
.deploy-section,
.final-section {
border: 1px solid var(--line);
border-radius: 32px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
rgba(255, 255, 255, 0.025);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.workflow-panel {
padding: 34px;
}
.mode-list {
display: grid;
gap: 10px;
margin-top: 26px;
}
.mode-list div {
min-height: 50px;
display: grid;
grid-template-columns: 120px 1fr;
align-items: center;
gap: 14px;
border-top: 1px solid var(--line);
}
.mode-list code {
color: var(--acid);
font-family: var(--font-geist-mono), monospace;
font-size: 13px;
}
.mode-list span {
color: var(--muted);
}
.node-board {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
padding: 18px;
}
.node-card {
min-height: 134px;
display: grid;
align-content: end;
gap: 8px;
border-radius: 22px;
padding: 18px;
}
.node-card.wide {
grid-column: 1 / -1;
min-height: 156px;
background:
radial-gradient(circle at 80% 0%, rgba(215, 255, 77, 0.18), transparent 36%),
rgba(255, 255, 255, 0.04);
}
.factory-section {
display: grid;
grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
gap: 24px;
align-items: center;
padding: 34px;
}
.module-strip {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.module-strip span {
border: 1px solid var(--line);
border-radius: 999px;
background: rgba(255, 255, 255, 0.035);
color: var(--muted);
padding: 11px 14px;
font-size: 13px;
font-weight: 700;
}
.deploy-section {
display: grid;
grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.72fr);
gap: 24px;
align-items: end;
padding: 34px;
}
.deploy-stack {
display: grid;
gap: 12px;
}
.deploy-stack > div {
min-height: 76px;
display: grid;
align-content: center;
gap: 8px;
border-radius: 20px;
padding: 16px;
}
.final-section {
display: grid;
justify-items: center;
gap: 18px;
margin-bottom: 42px;
padding: 54px 24px;
text-align: center;
}
.final-section p {
max-width: 58ch;
}
@media (max-width: 980px) {
.site-nav {
grid-template-columns: auto auto;
justify-content: space-between;
}
.nav-links {
display: none;
}
.hero-section,
.workflow-section,
.factory-section,
.deploy-section {
grid-template-columns: 1fr;
}
.hero-section {
min-height: auto;
padding-top: 36px;
}
.capability-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 640px) {
.site-nav,
.hero-section,
.platform-section,
.workflow-section,
.factory-section,
.deploy-section,
.final-section {
width: min(100% - 28px, 1180px);
}
.site-nav {
min-height: 74px;
}
.brand-mark img {
width: 34px;
height: 34px;
}
.ghost-link {
display: none;
}
.solid-link {
min-height: 38px;
padding-inline: 14px;
}
.hero-copy h1 {
font-size: clamp(42px, 15vw, 64px);
}
.hero-actions {
align-items: stretch;
flex-direction: column;
}
.hero-console {
min-height: 390px;
border-radius: 26px;
padding: 14px;
}
.route-row {
grid-template-columns: 1fr;
align-items: start;
gap: 6px;
min-height: 72px;
padding-block: 12px;
}
.route-row em {
font-size: 11px;
}
.flow-glyph {
width: 118%;
right: -44px;
bottom: -22px;
}
.mini-grid,
.capability-grid,
.node-board {
grid-template-columns: 1fr;
}
.workflow-panel,
.factory-section,
.deploy-section {
padding: 22px;
border-radius: 26px;
}
.mode-list div {
grid-template-columns: 1fr;
gap: 4px;
padding-block: 10px;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
animation-duration: 1ms !important;
animation-iteration-count: 1 !important;
transition-duration: 1ms !important;
}
}
@keyframes pulse-dot {
0% {
box-shadow: 0 0 0 0 rgba(215, 255, 77, 0.55);
}
70% {
box-shadow: 0 0 0 10px rgba(215, 255, 77, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(215, 255, 77, 0);
}
}
@keyframes slow-spin {
to {
transform: rotate(360deg);
}
}
@keyframes flow-dash {
to {
stroke-dashoffset: -220;
}
}
@keyframes node-float {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-8px);
}
}
@keyframes card-rise {
from {
opacity: 0;
transform: translateY(16px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
+52
View File
@@ -0,0 +1,52 @@
import type { Metadata, Viewport } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
const geist = Geist({
variable: "--font-geist",
subsets: ["latin"],
display: "swap",
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
display: "swap",
});
export const metadata: Metadata = {
title: "BossAI | 聚合多模型多模态的 AI 应用平台",
description:
"BossAI 聚合 API 网关、模型路由、Comfy 工作流、短视频工厂和数字人生产,让团队统一管理多模型多模态 AI 应用。",
applicationName: "BossAI",
icons: {
icon: "/favicon.png",
shortcut: "/favicon-64.png",
},
openGraph: {
title: "BossAI | 聚合多模型多模态的 AI 应用平台",
description:
"统一 API 网关、智能路由、工作流画布和创作应用,让团队管理对话、生图、视频和数字人生产。",
type: "website",
locale: "zh_CN",
},
};
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
colorScheme: "dark",
themeColor: "#07110f",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="zh-CN">
<body className={`${geist.variable} ${geistMono.variable}`}>{children}</body>
</html>
);
}
+284
View File
@@ -0,0 +1,284 @@
import Image from "next/image";
import Link from "next/link";
const platformItems = [
{
title: "统一 API 网关",
eyebrow: "Gateway",
body: "OpenAI、Claude Messages、Gemini、方舟、图像和视频接口统一到一套下游协议。",
metric: "/v1",
},
{
title: "智能模型路由",
eyebrow: "Routing",
body: "按站点、账号、令牌、模型和失败冷却自动调度,保留真实日志和计费链路。",
metric: "Auto",
},
{
title: "Comfy 工作流",
eyebrow: "Workflow",
body: "使用熟悉的 ComfyUI 前端,接入 Cloud、RunningHub、External 或 BoosAPI 执行器。",
metric: "Canvas",
},
{
title: "创作应用生产",
eyebrow: "Studio",
body: "生图助手、视频助手、数字人、短视频工厂和工作空间复用同一套模型能力。",
metric: "Media",
},
];
const routes = [
{ type: "Chat", model: "gpt-5.4", state: "已路由", tone: "hot" },
{ type: "Image", model: "gpt-image-2", state: "生成中", tone: "lime" },
{ type: "Video", model: "seedance", state: "排队中", tone: "blue" },
{ type: "Claude", model: "/v1/messages", state: "流式", tone: "white" },
];
const workflowModes = [
["cloud", "Comfy Cloud API 后端"],
["runninghub", "RunningHub API 后端"],
["external", "外部完整版 ComfyUI"],
["boosapi", "Rust API-native 执行器"],
];
const productionModules = [
"模型广场",
"使用日志",
"工作空间",
"数字人",
"短视频工厂",
"站点公告",
"下游密钥",
"PostgreSQL",
];
function FlowGlyph() {
return (
<svg className="flow-glyph" viewBox="0 0 520 360" role="img" aria-label="BossAI 工作流动态图形">
<defs>
<linearGradient id="lineGradient" x1="0" x2="1" y1="0" y2="1">
<stop offset="0%" stopColor="#D7FF4D" />
<stop offset="55%" stopColor="#8BF6FF" />
<stop offset="100%" stopColor="#FFFFFF" />
</linearGradient>
<filter id="softGlow" x="-30%" y="-30%" width="160%" height="160%">
<feGaussianBlur stdDeviation="6" result="blur" />
<feMerge>
<feMergeNode in="blur" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
<path className="flow-line flow-line-a" d="M48 180 C130 62 232 62 314 180 S438 298 488 154" />
<path className="flow-line flow-line-b" d="M58 236 C154 318 222 286 274 184 S358 24 462 92" />
<path className="flow-line flow-line-c" d="M92 108 C178 164 214 180 260 180 S330 174 424 250" />
<g filter="url(#softGlow)">
<circle className="flow-dot dot-a" cx="48" cy="180" r="7" />
<circle className="flow-dot dot-b" cx="260" cy="180" r="9" />
<circle className="flow-dot dot-c" cx="488" cy="154" r="7" />
</g>
<rect className="node node-a" x="72" y="58" width="128" height="68" rx="18" />
<rect className="node node-b" x="242" y="146" width="140" height="76" rx="20" />
<rect className="node node-c" x="352" y="248" width="120" height="62" rx="17" />
</svg>
);
}
function HeroConsole() {
return (
<div className="hero-console" aria-label="BossAI 路由状态预览">
<div className="console-orbit" />
<div className="console-bar">
<span>Unified Gateway</span>
<strong>路由在线</strong>
</div>
<div className="route-list">
{routes.map((route) => (
<div className="route-row" data-tone={route.tone} key={route.type}>
<span>{route.type}</span>
<strong>{route.model}</strong>
<em>{route.state}</em>
</div>
))}
</div>
<div className="mini-grid">
<div>
<span>Workspace</span>
<strong>只归档产出</strong>
</div>
<div>
<span>Billing</span>
<strong>日志计费</strong>
</div>
</div>
<FlowGlyph />
</div>
);
}
export default function Home() {
return (
<main className="site-shell">
<div className="site-noise" aria-hidden="true" />
<header className="site-nav">
<Link className="brand-mark" href="/" aria-label="BossAI 首页">
<Image src="/logo.png" width={38} height={38} alt="" priority />
<span>BossAI</span>
</Link>
<nav className="nav-links" aria-label="官网导航">
<a href="#platform">平台能力</a>
<a href="#workflow">工作流</a>
<a href="#factory">短视频工厂</a>
<a href="#deploy">部署</a>
</nav>
<div className="nav-actions">
<Link className="ghost-link" href="/user/login">
用户登录
</Link>
<Link className="solid-link" href="/boos">
进入后台
</Link>
</div>
</header>
<section className="hero-section">
<div className="hero-copy">
<div className="section-kicker">
<span className="pulse-dot" />
多模型 · 多模态 · 工作流
</div>
<h1>
聚合多模型
<span>多模态的 AI 应用平台</span>
</h1>
<p>
BossAI 把统一 API 网关、智能路由、Comfy 工作流、数字人和短视频工厂收进一个清晰后台,让团队专注生产,而不是到处切系统。
</p>
<div className="hero-actions">
<Link className="primary-cta" href="/user/register">
开始使用
</Link>
<Link className="secondary-cta" href="#workflow">
查看工作流
</Link>
</div>
</div>
<HeroConsole />
</section>
<section id="platform" className="platform-section">
<div className="section-heading">
<span>Platform</span>
<h2>一套后台,接住 API、工作流和创作应用</h2>
</div>
<div className="capability-grid">
{platformItems.map((item, index) => (
<article className="capability-card" key={item.title} style={{ ["--index" as string]: index }}>
<div className="card-top">
<span>{item.eyebrow}</span>
<strong>{item.metric}</strong>
</div>
<h3>{item.title}</h3>
<p>{item.body}</p>
</article>
))}
</div>
</section>
<section id="workflow" className="workflow-section">
<div className="workflow-panel">
<div className="section-heading">
<span>Workflow</span>
<h2>使用完整版 ComfyUI 前端,后端按你的模式切换</h2>
</div>
<p>
官网和管理台隔离后,Workflow 继续作为产品内能力维护。BossAI 可以代理官方 Cloud、RunningHub、外部 ComfyUI,也能执行 API-native 节点。
</p>
<div className="mode-list">
{workflowModes.map(([key, label]) => (
<div key={key}>
<code>{key}</code>
<span>{label}</span>
</div>
))}
</div>
</div>
<div className="node-board" aria-label="工作流节点预览">
<div className="node-card wide">
<span>Prompt</span>
<strong>文案、角色、镜头、商品信息</strong>
</div>
<div className="node-card">
<span>Image</span>
<strong>生图</strong>
</div>
<div className="node-card">
<span>Video</span>
<strong>视频</strong>
</div>
<div className="node-card">
<span>Voice</span>
<strong>TTS</strong>
</div>
<div className="node-card">
<span>Archive</span>
<strong>工作空间</strong>
</div>
</div>
</section>
<section id="factory" className="factory-section">
<div className="factory-copy">
<span>Creation OS</span>
<h2>从提示词到短视频,从素材到数字人</h2>
<p>
生图助手、视频助手和短视频工厂共享 BoosAPI 模型路由。产出文件自动归档,用户之间隔离,管理员可查看团队级用量与成本。
</p>
</div>
<div className="module-strip">
{productionModules.map((module) => (
<span key={module}>{module}</span>
))}
</div>
</section>
<section id="deploy" className="deploy-section">
<div>
<span>Deploy</span>
<h2>远程模型优先,本机不必有 GPU</h2>
<p>
当图像、视频、语音走上游 API、Comfy Cloud 或 RunningHub 时,BossAI 服务器只负责网关、鉴权、数据库、日志和 Workflow UI 代理。
</p>
</div>
<div className="deploy-stack">
<div>
<small>Backend</small>
<strong>Rust 二进制</strong>
</div>
<div>
<small>Database</small>
<strong>SQLite / PostgreSQL</strong>
</div>
<div>
<small>Website</small>
<strong>Next.js 独立部署</strong>
</div>
</div>
</section>
<section className="final-section">
<h2>把模型、工作流和创作应用收进一个平台</h2>
<p>适合自建 AI 中转、团队模型管理、多模态创作和商业化用户面板。</p>
<div className="hero-actions">
<Link className="primary-cta" href="/user/register">
开始使用
</Link>
<Link className="secondary-cta" href="/boos">
进入后台
</Link>
</div>
</section>
</main>
);
}
+6
View File
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
+29
View File
@@ -0,0 +1,29 @@
import type { NextConfig } from "next";
const backendUrl = process.env.BOSSAI_BACKEND_URL || "http://127.0.0.1:4000";
const nextConfig: NextConfig = {
output: "standalone",
poweredByHeader: false,
turbopack: {
root: __dirname,
},
async rewrites() {
return [
{ source: "/boos", destination: `${backendUrl}/boos` },
{ source: "/user/:path*", destination: `${backendUrl}/user/:path*` },
{ source: "/api/:path*", destination: `${backendUrl}/api/:path*` },
{ source: "/v1/:path*", destination: `${backendUrl}/v1/:path*` },
{ source: "/assets/:path*", destination: `${backendUrl}/assets/:path*` },
{ source: "/workflow-ui/:path*", destination: `${backendUrl}/workflow-ui/:path*` },
{ source: "/comfyui/:path*", destination: `${backendUrl}/comfyui/:path*` },
{ source: "/monitor-proxy/:path*", destination: `${backendUrl}/monitor-proxy/:path*` },
{ source: "/oauth/:path*", destination: `${backendUrl}/oauth/:path*` },
{ source: "/health", destination: `${backendUrl}/health` },
{ source: "/ready", destination: `${backendUrl}/ready` },
{ source: "/metrics", destination: `${backendUrl}/metrics` },
];
},
};
export default nextConfig;
+1817
View File
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
{
"name": "bossai-website",
"version": "0.1.0",
"private": true,
"description": "Standalone BossAI public website built with Next.js App Router.",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"next": "16.2.7",
"react": "19.2.7",
"react-dom": "19.2.7"
},
"devDependencies": {
"@tailwindcss/postcss": "4.3.0",
"@types/node": "^22.10.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"tailwindcss": "4.3.0",
"typescript": "^6.0.3"
},
"engines": {
"node": ">=22.0.0"
}
}
+7
View File
@@ -0,0 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+41
View File
@@ -0,0 +1,41 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": [
"dom",
"dom.iterable",
"es2022"
],
"allowJs": false,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}