Developer 7e741651db test: 系统性测试142项全通过 + 修复GET /users/:id缺失
测试架构(10大类142项):
┌──────────────────────────────────────────────────────┐
│ 1. 环境准备       4项  环境可达性 + 残留清理          │
│ 2. 身份认证      15项  登录/错误密码/空/篡改JWT      │
│ 3. 用户CRUD正常  11项  创建/查询/编辑/升降级/删除    │
│ 4. 用户CRUD异常  17项  重复/空/短密码/不存在/权限    │
│ 5. 边界测试       7项  并发/超长/空权限/幂等         │
│ 6. 权限矩阵RBAC  49项  3层角色权限/API校验/系统保护  │
│ 7. 租户隔离       1项  跨租户不可见                  │
│ 8. 缺陷回归       5项  系统角色保护/幂等删除          │
│ 9. 前端UI一致    22项  登录/导航/Tab/弹窗/3角色      │
│ 10.用户故事完整  14项  SA/TA/USER闭环/升降级即时生效 │
└──────────────────────────────────────────────────────┘

发现并修复:
- 系统角色权限可被任意修改(isSystem 保护缺失)
- GET /users/:id 端点不存在

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:01:04 +08:00
2026-05-13 23:15:18 +08:00

AuraK

AuraK is a multi-tenant intelligent AI knowledge base platform. Built with React + NestJS, it's a full-stack RAG (Retrieval-Augmented Generation) system with external API support, RBAC, and tenant isolation.

Features

  • 🔐 User System: Complete user registration, login, and permission management
  • 🤖 Multi-Model Support: OpenAI-compatible interfaces + Google Gemini native support
  • 📚 Intelligent Knowledge Base: Document upload, chunking, vectorization, hybrid search
  • 💬 Streaming Chat: Real-time display of processing status and generated content
  • 🔍 Citation Tracking: Clear display of source documents and related segments for answers
  • 🌍 Multi-Language Support: Japanese, Chinese, and English for interface and AI responses
  • 👁️ Vision Capabilities: Supports multimodal models for image processing
  • ⚙️ Flexible Configuration: User-specific API keys and inference parameter customization
  • 🎯 Dual-Mode Processing: Fast mode (Tika) + High-precision mode (Vision Pipeline)
  • 💰 Cost Management: User quota management and cost estimation

🏗️ Tech Stack

Frontend

  • Framework: React 19 + TypeScript + Vite
  • Styling: Tailwind CSS
  • Icons: Lucide React
  • State Management: React Context

Backend

  • Framework: NestJS + TypeScript
  • AI Framework: LangChain
  • Database: SQLite (metadata) + Elasticsearch (vector storage)
  • File Processing: Apache Tika + Vision Pipeline
  • Authentication: JWT
  • Document Conversion: LibreOffice + ImageMagick

🏢 Internal Network Deployment

This system supports deployment in internal networks. Main modifications include:

  • External Resources: KaTeX CSS moved from external CDN to local resources
  • AI Models: Supports configuring internal AI model services without external API access
  • Build Configuration: Dockerfiles can be configured to use internal image registries

See Internal Deployment Guide for detailed configuration instructions.

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Yarn
  • Docker & Docker Compose

1. Clone the Project

git clone <repository-url>
cd simple-kb

2. Install Dependencies

yarn install

3. Start Basic Services

docker-compose up -d elasticsearch tika libreoffice

4. Configure Environment Variables

# Backend environment setup
cp server/.env.sample server/.env
# Edit server/.env file (set API keys, etc.)

# Frontend environment setup
cp web/.env.example web/.env
# Edit web/.env file (modify frontend settings as needed)

See the comments in server/.env.sample and web/.env.example for detailed configuration.

5. Start Development Server

yarn dev

Access http://localhost:5173 to get started!

📖 User Guide

1. User Registration/Login

  • Account registration is required for first-time use.
  • Each user has their own independent knowledge base and model settings.

2. AI Model Configuration

  • Add AI models from "Model Management".
  • Supports OpenAI, DeepSeek, Claude and other compatible interfaces.
  • Supports Google Gemini native interface.
  • Configure LLM, Embedding, and Rerank models.

3. Document Upload

  • Supports various formats: PDF, Word, PPT, Excel, etc.
  • Choose between Fast mode (text-only) or High-precision mode (image + text mixed).
  • Adjustable chunk size and overlap for documents.
  • Select embedding model for vectorization.

4. Start Intelligent Q&A

  • Ask questions based on uploaded documents.
  • View search and generation process in real-time.
  • Check answer sources and related document fragments.

🔧 Configuration Guide

Model Settings

  • LLM Model: Used for dialogue generation (e.g., GPT-4, Gemini-1.5-Pro)
  • Embedding Model: Used for document vectorization (e.g., text-embedding-3-small)
  • Rerank Model: Used for re-ranking search results (optional)

Inference Parameters

  • Temperature: Controls answer randomness (0-1)
  • Max Tokens: Maximum output length
  • Top K: Number of document segments to search
  • Similarity Threshold: Filters low-relevance content

📁 Project Structure

simple-kb/
├── web/                 # Frontend application
│   ├── components/      # React components
│   ├── services/        # API services
│   ├── contexts/        # React Context
│   └── utils/          # Utility functions
├── server/             # Backend application
│   ├── src/
│   │   ├── auth/       # Authentication module
│   │   ├── chat/       # Chat module
│   │   ├── knowledge-base/ # Knowledge base module
│   │   ├── model-config/   # Model configuration module
│   │   └── user/       # User module
│   └── data/           # Data storage
├── docs/               # Project documentation
└── docker-compose.yml  # Docker configuration

📚 Documentation

🐳 Docker Deployment

Development Environment

# Start basic services
docker-compose up -d elasticsearch tika

# Local development
yarn dev

Production Environment

# Build and start all services
docker-compose up -d

🤝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is provided under the MIT license. See the LICENSE file for details.

🙏 Acknowledgments

📞 Support

For questions or suggestions, please submit an Issue or contact the maintainers.

S
Description
No description provided
Readme MulanPSL-2.0 11 MiB
Languages
TypeScript 86.6%
JavaScript 10.9%
Python 1.6%
CSS 0.5%
Shell 0.2%
Other 0.1%