d15e8815916b01834d4ac196d3b84b2621e7aa14
全量回归测试(test-full-coverage.mjs): - A. 角色权限深度测试(新endpoint权限边界/跨用户隔离) - B. 边界值测试(模板字段极值/角色名/密码边界) - C. 异常路径测试(状态链/冲突/不存在Session/已删模板) - D. 缺陷回归测试(系统角色保护/API Key / token即时变更/幂等) - E. 跨功能交互测试(权限+考核/模板+角色/异常状态) 修复: - assessment.service.ts templateData P2字段显式映射确认 测试结果: 52/52 ✅ + 系统测试 142/142 ✅ + P2专项 20/20 ✅ Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AuraK
Enterprise AI Knowledge Base & Talent Assessment Platform.
For AI assistants (Claude Code / OpenCode / Codex / Gemini CLI): See CLAUDE.md for the complete technical reference — all architecture details, permission entities, guard flow, assessment data model, test patterns, and code conventions are documented there.
✨ Features
| Area | Highlights |
|---|---|
| Multi-Tenant | Strict data isolation, hierarchical org tree, per-tenant settings |
| RBAC | 3 tiers (SUPER_ADMIN / TENANT_ADMIN / USER), 26 granular permissions, custom roles, visual permission matrix |
| AI Assessment | Auto question generation (MC + short answer), adaptive follow-up dialogue, weighted multi-dimension scoring, certificate system |
| Knowledge Base | Dual processing (Fast via Tika / High-Precision via Vision Pipeline), hybrid search (BM25 + vector), multi-format support |
| AI Engine | Multi-model (OpenAI-compatible + Gemini), configurable LLM/Embedding/Rerank/Vision, SSE streaming |
| Feishu Bot | WebSocket integration, interactive message cards, mobile assessment |
🚀 Quick Start
Prerequisites
- Node.js 18+, Yarn, Docker & Docker Compose
1. Install & Start
git clone <repo-url>
cd AuraK
yarn install
cp server/.env.sample server/.env
# Edit server/.env — set JWT_SECRET
# Start infrastructure (optional for basic features)
docker-compose up -d elasticsearch tika libreoffice
# Start development servers
yarn dev
# Frontend: http://localhost:13001
# Backend: http://localhost:3001
2. Quick Start (no Docker)
cd /d/AuraK/server && node dist/main.js &
cd /d/AuraK/web && npx vite --port 13001 &
3. Default Login
Username: admin
Password: admin123
📖 User Guide
User Management
Settings → User Management
| Action | Steps |
|---|---|
| Create user | Fill username, password, display name → Create |
| Edit user | Click Edit icon → Modify info → Select role (USER / TENANT_ADMIN / SUPER_ADMIN) → Save |
| Change password | Click key icon → Enter new password → Confirm |
| Delete user | Click trash icon → Confirm |
| Export/Import | Click Export/Import buttons → XLSX format |
Role changes take effect immediately — the user does not need to log out and back in.
Permission Management
Settings → Permission Management
- Left panel — lists all roles: SUPER_ADMIN, TENANT_ADMIN, USER, and any custom roles
- Click a role — right panel shows the permission matrix organized by category
- Toggle permissions — check/uncheck individual items
- Save — changes take effect immediately
- Custom roles — click "+" to create, set permissions, then assign to users via User Management
System roles (SUPER_ADMIN, TENANT_ADMIN, USER) are protected — their permissions cannot be modified.
Assessment Templates
Settings → Assessment Templates
Two built-in templates:
| Template | Questions | Dimensions | Audience |
|---|---|---|---|
| Technical | 20 | PROMPT 30%, LLM 30%, IDE 20%, DEV_PATTERN 20% | Developers, Engineers |
| Non-Technical | 10 | PROMPT 50%, LLM 30%, WORK_CAPABILITY 20% | Managers, PMs, Designers |
Dimensions are fully customizable — add/remove, adjust weights, change question count.
Running an Exam
As an organizer (admin):
- Go to
Settings → User Management→ create student accounts - Give students their credentials
As a candidate:
- Login → go to Assessment
- Select a template → click Start Assessment
- Multiple choice: click an option → click Confirm
- Short answer: type your answer in the textarea → click Send
- The AI may ask follow-up questions — keep answering
- After all questions, view your score and certificate
Viewing results:
- History — right sidebar on the Assessment page
- Details — click any history entry to see per-question scores
- Certificate — click "View Certificate" for level, total score, dimension scores
- Export — PDF report and Excel download
Tenant Management (SUPER_ADMIN only)
Settings → Tenant Management
- Create/edit/delete tenants with hierarchical parent-child structure
- Manage members: add/remove users, assign roles
- Per-tenant settings (models, knowledge bases, features)
- Data isolation: Tenant A users cannot access Tenant B data
🧪 Testing
# Full system test (142 items)
cd /d/AuraK && node test-systematic.mjs
# Exam organizer scenario (create students → take exam → view results)
cd /d/AuraK && node exam-organizer.mjs
All test scripts are in the project root, prefixed with test-*.mjs.
📁 Project Structure
AuraK/
├── web/ # React frontend (:13001)
│ ├── components/views/ # Main page views
│ ├── src/contexts/ # Auth / Language contexts
│ ├── src/hooks/ # usePermissions
│ └── src/services/ # API clients
├── server/ # NestJS backend (:3001)
│ ├── src/auth/ # Auth + RBAC permission module
│ │ └── permission/ # Role/Permission entities, service, guard
│ ├── src/assessment/ # Assessment subsystem
│ ├── src/user/ # User CRUD
│ ├── src/tenant/ # Multi-tenant
│ └── src/admin/ # Admin API
├── CLAUDE.md # AI assistant reference
├── README.md # This file
├── README_ZH.md # 中文说明
├── test-*.mjs # Playwright test scripts
└── docker-compose.yml # Infrastructure
🏗️ Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React 19, TypeScript, Vite 6, Tailwind CSS v4, Framer Motion |
| Backend | NestJS 11, TypeORM, LangChain, LangGraph |
| Database | better-sqlite3 (metadata) + Elasticsearch 9 (vector/text search) |
| Auth | JWT + API Key |
| AI | OpenAI-compatible (DeepSeek, Claude) + Google Gemini |
| Infra | Docker Compose (ES, Tika, LibreOffice) + Nginx |
🔧 Configuration
| Variable | Default | Purpose |
|---|---|---|
| PORT | 3001 | Backend port |
| DATABASE_PATH | ./data/metadata.db | SQLite path |
| ELASTICSEARCH_HOST | http://127.0.0.1:9200 | Search engine |
| JWT_SECRET | (required) | JWT signing secret |
| UPLOAD_FILE_PATH | ./uploads | File storage |
| MAX_FILE_SIZE | 104857600 | Upload limit (100MB) |
🔗 Related Documents
| Document | Audience | Content |
|---|---|---|
| CLAUDE.md | AI assistants + Developers | Full technical reference: architecture, entities, API, permission system, assessment model, testing patterns |
| README_ZH.md | Chinese-speaking users | Complete Chinese user guide |
| STARTUP.md | Operators | Startup scripts and environment setup |
| VERSION.md | All | Version history and changelog |
Description
Languages
TypeScript
86.6%
JavaScript
10.9%
Python
1.6%
CSS
0.5%
Shell
0.2%
Other
0.1%