|
|
2 settimane fa | |
|---|---|---|
| .. | ||
| .marscode | 3 settimane fa | |
| components | 2 settimane fa | |
| constants | 3 settimane fa | |
| contexts | 2 settimane fa | |
| public | 3 settimane fa | |
| services | 2 settimane fa | |
| src | 2 settimane fa | |
| utils | 2 settimane fa | |
| .dockerignore | 3 settimane fa | |
| .env | 3 settimane fa | |
| .env.example | 3 settimane fa | |
| .gitignore | 3 settimane fa | |
| App.tsx | 2 settimane fa | |
| Dockerfile | 3 settimane fa | |
| README.md | 2 settimane fa | |
| index.css | 2 settimane fa | |
| index.html | 2 settimane fa | |
| index.tsx | 2 settimane fa | |
| metadata.json | 3 settimane fa | |
| package.json | 2 settimane fa | |
| postcss.config.js | 2 settimane fa | |
| tsconfig.json | 3 settimane fa | |
| types.ts | 2 settimane fa | |
| used_keys.txt | 3 settimane fa | |
| vite.config.ts | 2 settimane fa | |
| yarn.lock | 3 settimane fa | |
A modern multi-tenant knowledge base and AI assistant platform built with React 19, Vite, and Tailwind CSS.
The frontend uses React Router for navigation with a clean role-based routing structure:
| Route | Access | Description |
|---|---|---|
/login |
Public | Password or API Key sign-in |
/ |
All users | Workspace overview |
/chat |
All users | AI Chat with scope selection |
/knowledge |
All users | Document (Knowledge Base) management |
/notebooks |
All users | Notebooks and notes |
/settings |
All users | Model and app settings |
/admin |
TENANT_ADMIN+ | Team management, share approvals |
/admin/tenants |
SUPER_ADMIN | Global tenant management |
/admin/models |
TENANT_ADMIN+ | Model configuration |
The app supports two login methods:
/api/v1/auth/login, receives an apiKey backAll API calls include x-api-key: <key> in the request headers automatically via services/apiClient.ts.
cn() utility)cd web
yarn install
Copy .env.example to .env and set the backend URL if needed:
VITE_API_BASE_URL=http://localhost:13000
The Vite dev server proxies /api/* to http://localhost:13000 by default (see vite.config.ts).
yarn dev
# โ http://localhost:13001
yarn build
# Output: dist/
web/
โโโ index.tsx # App root โ BrowserRouter + all routes
โโโ index.html
โโโ src/
โ โโโ contexts/
โ โ โโโ AuthContext.tsx # User auth state (apiKey, user, role)
โ โโโ components/
โ โ โโโ layouts/
โ โ โโโ WorkspaceLayout.tsx # Sidebar + header for main workspace
โ โ โโโ AdminLayout.tsx # Admin console layout
โ โโโ pages/
โ โ โโโ auth/
โ โ โ โโโ Login.tsx # Dual-mode login (password + API key)
โ โ โโโ workspace/
โ โ โ โโโ ChatPage.tsx
โ โ โ โโโ KnowledgePage.tsx
โ โ โ โโโ NotebooksPage.tsx
โ โ โ โโโ SettingsPage.tsx
โ โ โโโ admin/
โ โ โโโ SuperAdminPage.tsx # Tenant management (SUPER_ADMIN)
โ โ โโโ TenantAdminPage.tsx # Team management (TENANT_ADMIN)
โ โโโ utils/
โ โโโ cn.ts # clsx + twMerge helper
โโโ components/ # Legacy rich view components (still used)
โ โโโ views/
โ โโโ ChatView.tsx
โ โโโ KnowledgeBaseView.tsx
โ โโโ NotebooksView.tsx
โ โโโ SettingsView.tsx
โโโ services/ # API service layer
โโโ apiClient.ts # Base HTTP client (auto-injects x-api-key)
โโโ chatService.ts # Streaming chat
โโโ knowledgeBaseService.ts
โโโ ...
After running the backend migration, a default super admin is seeded:
admin@system.localadmin123The /api/v1/auth/api-key endpoint returns your API key after login.
/login automatically.uploads/ directory is writable./settings or /admin/models.