内容
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/CodeAtlas-00F0FF?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMjAgM0wzNyAxMEwxMCAyMEwzNyAzMEwyMCAzNyIgc3Ryb2tlPSIjMDBGMEZGIiBzdHJva2Utd2lkdGg9IjIiLz48cGF0aCBkPSJNMjAgMTBMMzAgMTVMMjAgMjVMMTAgMTV6IiBmaWxsPSIjMDBGMEZGIi8+PC9zdmc+">
<img alt="CodeAtlas AI" src="https://img.shields.io/badge/CodeAtlas-00F0FF?style=for-the-badge">
</picture>
</p>
<h1 align="center">🗺️ CodeAtlas AI</h1>
<p align="center">
<strong>AI-Powered Codebase Intelligence Platform</strong><br>
MCP Server · AST Code Analysis · Knowledge Graph · Oracle 26ai Memory
</p>
<p align="center">
<a href="https://github.com/giauphan/codeatlas-platform/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
<a href="#"><img src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js" alt="Node.js 20+"></a>
<a href="#"><img src="https://img.shields.io/badge/TypeScript-5.4-3178C6?logo=typescript" alt="TypeScript 5.4"></a>
<a href="https://www.oracle.com/database/"><img src="https://img.shields.io/badge/Oracle-26ai%20Native-red?logo=oracle" alt="Oracle 26ai"></a>
<a href="https://www.npmjs.com/package/codeatlas-enterprise"><img src="https://img.shields.io/npm/v/codeatlas-enterprise?label=MCP%20Server&logo=npm" alt="MCP Server"></a>
<a href="https://github.com/giauphan/codeatlas-platform/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/giauphan/codeatlas-platform/ci.yml?branch=main&logo=github" alt="CI"></a>
<a href="#"><img src="https://img.shields.io/badge/Vite-5-646CFF?logo=vite" alt="Vite 5"></a>
</p>
---
<p align="center">
<b>CodeAtlas AI</b> transforms your codebase into a living <b>Knowledge Graph</b> — powered by <b>Oracle 26ai</b> vector search, property graphs, and AI embeddings. It provides deep architectural reasoning, automated security scanning, persistent AI memory, and seamless integration with every major AI code editor via the <b>Model Context Protocol (MCP)</b>.
</p>
---
## 📖 Table of Contents
- [✨ Features](#-features)
- [🏗️ Architecture](#️-architecture)
- [🚀 Quick Start](#-quick-start)
- [Prerequisites](#1-prerequisites)
- [Installation](#2-installation)
- [Environment Configuration](#3-environment-configuration)
- [Running the Server](#4-running-the-server)
- [🔌 AI Editor Integration](#-ai-editor-integration)
- [Claude Desktop / Code](#claude-desktop--code)
- [Cursor AI](#cursor-ai)
- [VS Code (Cline / Continue)](#vs-code-cline--continue)
- [Windsurf](#windsurf)
- [Custom MCP Clients](#custom-mcp-clients)
- [🛠️ MCP Tools Reference](#️-mcp-tools-reference)
- [Code Analysis & Discovery](#-code-analysis--discovery)
- [Dependency & Flow Visualization](#-dependency--flow-visualization)
- [AI Memory & Knowledge Graph](#-ai-memory--knowledge-graph)
- [Security & Architecture Scanning](#-security--architecture-scanning)
- [🌐 REST API Reference](#-rest-api-reference)
- [📁 Project Structure](#-project-structure)
- [🧠 Memory Architecture](#-memory-architecture)
- [🏠 Multi-Tenant Architecture](#-multi-tenant-architecture)
- [📊 Dashboard](#-dashboard)
- [🧪 Testing](#-testing)
- [📄 License](#-license)
- [🤝 Contributing](#-contributing)
---
## ✨ Features
### 🏗️ Knowledge Graph Reasoning
- **Architectural Smell Detection** — Automatically detect circular dependencies, God objects, and dead code using Oracle 26ai SQL Property Graph queries (`GRAPH_TABLE` match recursion).
- **Tri-Layer Memory** — Episodic (business rules & change logs), Semantic (vector embeddings via NVIDIA NIM), and Relational (property graph) all stored natively in Oracle 26ai.
- **AI Vector Search** — Semantic code search using 4096-dimensional embeddings and `VECTOR_DISTANCE` cosine similarity.
### 🛡️ Security Scanner
- **Hardcoded Secrets Detection** — Identifies potential API keys, tokens, passwords, and credentials in variable declarations with intelligent false-positive suppression.
- **Unsafe Function Detection** — Flags dangerous calls (`eval`, `exec`, `system`, `child_process`, etc.) at CRITICAL severity.
- **SQL Injection Risk Analysis** — Detects dynamic query construction patterns with database context verification.
- **Enterprise Security Scoring** — Cross-project vulnerability scoring with risk-level classification (LOW / HIGH / CRITICAL).
### 🔍 AST Code Analysis
- **Multi-Language Support** — Analyzes **JavaScript/TypeScript**, **Python**, **PHP**, and more via AST parsing.
- **Entity Extraction** — Discovers modules, classes, functions, variables, and their relationships (imports, calls, containment, inheritance).
- **Smart Filtering** — Automatically excludes `node_modules`, `venv`, `.venv`, and `site-packages` for clean, actionable results.
- **Fuzzy Search** — Search entities by name with partial matching across entire projects.
### 🧠 AI Semantic Memory
- **Dreaming Memory System** — Persist learned patterns, mistakes, user preferences, and project knowledge as "dreams" with importance scoring (1–10).
- **NVIDIA NIM Embeddings** — Enterprise-grade vector embeddings via `nvidia/nv-embed-v1` for semantic code understanding.
- **Oracle 26ai Native Vectors** — Native `VECTOR(4096, FLOAT32)` data type for high-performance similarity search.
- **Auto-Synced Documentation** — Automatically sync business rules and change logs to the Oracle Knowledge Graph.
### 📊 Interactive Dashboard
- **Force-Directed Knowledge Graph** — Interactive SVG canvas with physics simulation, zoom/pan, node dragging, and glow effects.
- **Real-Time Analysis** — View project statistics, entity counts, and dependency metrics.
- **Glassmorphic UI** — Premium design system with frosted glass panels, neon cyan accents, and dark space theme.
- **Full-Screen Mode** — Immersive codebase visualization with native HTML5 Fullscreen API.
### 🔌 MCP Protocol Integration
- **Dual Transport** — Supports both **stdio** (local IDE integration) and **SSE** (remote server deployment) transports.
- **Dynamic Session Isolation** — Per-connection MCP server instances for zero-contention concurrent access.
- **Works With** — Claude Desktop/Code, Cursor AI, VS Code (Cline, Continue), Windsurf, and any MCP-compatible client.
### 🌐 REST API
- **Full HTTP API** — Express-based REST endpoints for project management, analysis, settings, dreams, and memory.
- **Rate Limiting** — Built-in per-tenant rate limiter (60 req/min) to protect against abuse.
- **CORS Support** — Configurable cross-origin policies for dashboard and remote access.
### 🏠 Multi-Tenant Support
- **Oracle VPD/RLS** — Row-level security using Oracle Virtual Private Database for complete tenant data isolation.
- **Firestore Isolation** — Tenant-scoped telemetry documents (`${tenantId}_${projectName}`) in Firebase.
- **Sandboxed Workspaces** — Each tenant operates within their own directory sandbox (`tenants/{tenantId}/`).
---
## 🏗️ Architecture
CodeAtlas AI follows a **Clean Architecture** pattern with clear separation of concerns:
```
┌──────────────────────────────────────────────────┐
│ MCP Clients │
│ Claude Cursor VS Code Windsurf Custom CLI │
└────────────────────┬─────────────────────────────┘
│
┌────────────────────▼─────────────────────────────┐
│ Presentation Layer │
│ ┌──────────────────┐ ┌──────────────────────┐ │
│ │ MCP Server │ │ Express HTTP API │ │
│ │ (stdio / SSE) │ │ (REST Endpoints) │ │
│ │ mcpServer.ts │ │ httpServer.ts │ │
│ │ mcpTools.ts │ │ dreamingRoutes.ts │ │
│ └──────────────────┘ └──────────────────────┘ │
└────────────────────┬─────────────────────────────┘
│
┌────────────────────▼─────────────────────────────┐
│ Service Layer │
│ ┌────────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Project │ │ Memory │ │ Security │ │
│ │ Service │ │ Service │ │ Scanner │ │
│ │ │ │ │ │ │ │
│ │ project │ │ Oracle │ │ Security │ │
│ │ Service.ts │ │ Memory │ │ Scanner.ts │ │
│ │ │ │ .ts │ │ │ │
│ └────────────┘ │ .ts │ │ │ │
│ │ │ └────────────────┘ │
│ ┌────────────┐ │ ┌──────┐ │ │
│ │ Dreaming │ │ │Embed │ │ │
│ │ Service │ │ │-ding │ │ │
│ │ │ │ │Service││ │
│ │ dreaming │ │ │.ts ││ │
│ │ Service.ts │ │ └──────┘ │ │
│ └────────────┘ └──────────┘ │
└────────────────────┬─────────────────────────────┘
│
┌────────────────────▼─────────────────────────────┐
│ Infrastructure Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Oracle │ │ Firebase │ │ File System │ │
│ │ 26ai DB │ │ Admin │ │ (codeatlas/ │ │
│ │ │ │ │ │ analysis.json) │ │
│ │ .connect │ │ .auth │ │ │ │
│ │ .memory │ │ .firestore│ │ projectService │ │
│ │ .schema │ │ │ │ .ts │ │
│ └──────────┘ └──────────┘ └──────────────────┘ │
└──────────────────────────────────────────────────┘
```
### Data Flow
```
1. User opens IDE (Claude / Cursor / VS Code)
2. IDE connects to CodeAtlas via MCP (stdio or SSE)
3. MCP tools query local .codeatlas/analysis.json AST data
4. sync_system_memory pushes embeddings & relationships to Oracle 26ai
5. Dashboard fetches analysis results via REST API
6. Security Scanner runs against analysis data for vulnerability detection
7. Knowledge Graph queries (Oracle Property Graph) identify architectural smells
```
---
## 🚀 Quick Start
### 1. Prerequisites
- **Node.js**: v20.0.0 or higher
```bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
```
- **npm** (comes with Node.js) or **pnpm** (recommended)
```bash
npm install -g pnpm
```
- **Oracle Instant Client** — Required for Thick Mode connectivity to Oracle 26ai. Download from [Oracle Instant Client Downloads](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) and extract to `/opt/oracle/instantclient`.
- **Firebase Project** — For API key authentication and telemetry storage.
- **NVIDIA API Key** — For embedding generation (sign up at [NVIDIA AI Foundation](https://build.nvidia.com/explore/discover)).
### 2. Installation
```bash
# Clone the repository
git clone https://github.com/giauphan/codeatlas-platform.git
cd codeatlas-platform
# Install dependencies
pnpm install
# Build the TypeScript project
pnpm run build
```
### 3. Environment Configuration
Create a `.env` file in the project root:
```bash
# Server Configuration
PORT=8080
NODE_ENV=production
LOG_LEVEL=info
# Authentication
CODEATLAS_API_KEY=your_admin_secret_key
GOOGLE_APPLICATION_CREDENTIALS=/path/to/firebase-service-account.json
# Oracle 26ai Database (Thick Mode)
ORACLE_USER=admin
ORACLE_PASSWORD=your_password
ORACLE_CONN_STRING=your_db_connection_string
ORACLE_LIB_DIR=/opt/oracle/instantclient
ORACLE_WALLET_DIR=/opt/oracle/wallet # For mTLS connections
# NVIDIA Embeddings
NVIDIA_API_KEY=nvapi-your-key-here
# Multi-Tenant (optional)
CODEATLAS_MULTI_TENANT=false
CODEATLAS_PROJECTS_ROOT=./tenants
# CORS (optional, defaults to localhost origins)
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
```
### 4. Running the Server
#### Development Mode (with hot reload)
```bash
pnpm run dev
```
#### Production Mode
```bash
pnpm run build
pnpm run start
```
#### PM2 (Production Process Manager)
```bash
npm install -g pm2
pm2 start dist/src/index.js --name codeatlas-platform
pm2 save
pm2 startup
```
#### Initialize Oracle Database Schema
```bash
pnpm run db-init
```
The server auto-detects the runtime mode:
- If `PORT` is set → starts in **SSE Mode** (remote HTTP server)
- If `PORT` is unset → starts in **Stdio Mode** (local MCP server for IDE integration)
---
## 🔌 AI Editor Integration
CodeAtlas AI works with any MCP-compatible AI coding assistant. Choose your editor below:
### Claude Desktop / Code
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "codeatlas-enterprise"],
"env": {
"CODEATLAS_API_KEY": "your-api-key",
"ORACLE_CONN_STRING": "...",
"NVIDIA_API_KEY": "nvapi-..."
}
}
}
}
```
Or for remote SSE mode:
```json
{
"mcpServers": {
"codeatlas": {
"type": "sse",
"url": "https://your-server.com/sse?apiKey=YOUR_API_KEY_HERE"
}
}
}
```
### Cursor AI
Create `.cursor/rules/codeatlas.mdc` in your project:
```markdown
---
description: CodeAtlas AI codebase intelligence
globs: *
---
An MCP server named `codeatlas` is available with code analysis tools.
Always use it before manual file searches for faster results.
```
Configure in Cursor Settings → MCP Servers:
```json
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "codeatlas-enterprise"],
"env": {
"CODEATLAS_API_KEY": "your-api-key"
}
```markdown
Use CodeAtlas MCP tools for codebase analysis before making changes.
Tools: list_projects, get_project_structure, search_entities, get_dependencies,
generate_system_flow, trace_feature_flow, sync_system_memory
```
### Custom MCP Clients
Any MCP client can connect directly via stdio:
```bash
npx -y codeatlas-enterprise
```
Or via SSE:
```bash
curl -N https://your-server.com/sse?apiKey=YOUR_API_KEY
```
---
## 🛠️ MCP Tools Reference
CodeAtlas AI exposes **14 MCP tools** for comprehensive codebase intelligence. Run `list_projects` first to discover analyzed projects, then use the rest.
### 📂 Code Analysis & Discovery
| Tool | Description | Parameters |
|------|-------------|------------|
| `list_projects` | List all analyzed projects with names, paths, and last analysis timestamps | _None_ |
| `get_project_structure` | Get all entities (modules, classes, functions, variables) in a project | `project`, `type` (all/module/class/function/variable), `limit` |
| `get_file_entities` | Get all entities defined in a specific file | `project`, `filePath` (partial match) |
| `search_entities` | Fuzzy search for functions, classes, modules, or variables by name | `project`, `query`, `type` |
| `get_insights` | AI-generated code quality insights (refactoring, security, maintainability) | _None_ |
### 🔗 Dependency & Flow Visualization
| Tool | Description | Parameters |
|------|-------------|------------|
| `get_dependencies` | Get import/call/containment/implements relationships between entities | `project`, `source`, `target`, `relationship`, `limit` |
| `generate_system_flow` | Generate a **Mermaid flowchart** showing system architecture (module imports) | `project`, `scope` (full/modules-only/feature), `feature`, `maxNodes` |
| `generate_feature_flow_diagram` | Generate a **Mermaid diagram** of feature execution flow (call chains: entry point → controller → service → model → database) | `project`, `keyword`, `diagramType` (flowchart/sequence), `depth`, `maxNodes` |
| `trace_feature_flow` | Trace the complete execution flow of a feature through the codebase, ordered by dependency chain | `project`, `keyword`, `depth` |
### 🧠 AI Memory & Knowledge Graph
| Tool | Description | Parameters |
|------|-------------|------------|
| `sync_system_memory` | Sync code entities & relationships to Oracle 26ai Knowledge Graph. Creates auto-generated system documentation with business rules and change logs | `project`, `businessRule`, `changeDescription`, `enableEnterpriseSync` |
| `get_system_memory` | Retrieve episodic memories (business rules, change logs) from Oracle 26ai | `project`, `eventType` (all/BUSINESS_RULE/CHANGE_LOG) |
| `save_dream_memory` | Save a learned pattern, mistake, preference, or knowledge to the Dreaming Memory system | `memory_type`, `content`, `importance` (1–10), `session_id`, `project` |
| `query_dream_memories` | Search Dream Memories by semantic similarity using vector search | `query`, `project`, `limit` |
| `detect_architectural_smells` | Use Oracle 26ai Property Graph to detect circular dependencies, God objects, and dead code | `project` |
### 🛡️ Security & Architecture Scanning
| Tool | Description | Parameters |
|------|-------------|------------|
| `scan_enterprise_vulnerabilities` | Enterprise vulnerability scanner — auto-scans all projects for hardcoded secrets, unsafe functions, SQL injection risks, and architectural issues with security scoring | `maxProjects` |
---
🌐 REST API 参考
除了 MCP 之外Atlas AI 还提供了一个完整的 REST API,用于远程访问和仪表。
| 方法 | 端点 | 描述 | 需要认证 |
|--------|----------|-------------|:---:|
| `GET` | `/api/projects` | 列出所有已发现的项目 | ✅ |
| `DELETE` | `/api/projects` | 删除一个项目及其数据 | ✅ |
| `GET` | `/api/projects/memory` | 获取一个项目的记忆 | ✅ |
| `GET` | `/api/projects/settings` | 获取索引设置 | ✅ |
POST` | `/api/projects/settings` | 更新索引设置 | ✅ |
| `POST` | `/api/dreams/save` | 保存一个梦境记忆 | ✅ |
| `GET` | `/api/dreams/query` | 查询梦境记忆 | ✅ |
| `DELETE` | `/api/delete` | 删除一个梦境记忆 | ✅ |
| `GET` | `/api/docs/quick-setup` | 获取快速设置指南(markdown) | ✅ |
| `GET` | `/api/docs/memory-setup` | 获取 AI 记忆设置指南(markdown) | ✅ |
**认证**: API 请求需要以下认证之一:
- **Firebase ID Token**: `Authorization:firebase-id-token>` (用户)
- **API `x-api-keyyour-api-key>` (适用于程序化访问)
**速率限制**: 每个租户/IP 每分钟 60 次请求。
## 📁 项目结构
```
codeatlas-platform/
├── src/
│ ├── index.ts # 组合根目录 — 入口点
│ ├── config/
│ │ └── env.ts # 环境配置
│ ├── presentation/ # 表示层(MCP + HTTP)
│ ├── mcpServer # MCP 服务器实例
│ ├── mcpTools.ts # 所有 14 个 MCP 工具定义
│ │ ├── httpServer.ts # Express HTTP 服务器 + REST API
│ │ └── dreamingRoutes.ts # 梦境记忆 REST 路由
│ ├── services/ #
│ │ ├── authService.ts # API 密钥验证
│ │ ├── projectService.ts # 项目发现和分析加载
│ │ ├── memoryService.ts # Oracle 26层记忆服务
│ │ ├── dreamingService.ts # Oracle 梦境记忆服务
│ │ ├── embeddingService.ts # NVIDIA NIM 嵌入生成
│ │ ├── memoryGenerator.ts # 自动生成的记忆文档
│ │ └── scanner/
│ │ └── security # 静态安全漏洞扫描器
├── middleware/
│ └── auth.ts 认证中间件( API 密钥)
│ database/
│ │ ├── connection.ts # Oracle DB 连接池(厚模式)
│ │ └── schema.sql # Oracle 26ai 数据库模式 + VPD 设置
│ ├── types/
│ │ ├── index.ts # TypeScript 接口(GraphNode、AnalysisResult 等)
│ │ express.d.ts # Express 类型增强
│ ├──│ │ ├── logger.ts # 结构化日志记录
│ │ └── context.ts # 请求上下文LocalStorage
│ .ts # 仓库认证、遥测)
├── dashboard/ # React 仪表盘(Vite + Type│ ├── src │ ├── App.tsx # 根组件
│ │ ├── main.tsx # 入口点
│ │ ├── lib/
│ │ │ └── firebase.ts # Firebase 客户端 SDK │ └── components │ ├── Dashboard.tsx # 主仪表盘(项目管理)
│ │ ├── Auth.tsx # 登录/API认证
│ │ ├── KnowledgeGraphView.tsx #式力导向图
│ │ ├── ControlCenterView.tsx # 设置和控制
│ │ ├── CloudIndexView.tsx # 云同步状态
│ │ └── DocumentationView.tsx # MCP 集成指南
│ ├── index.html
│ ├── vite.config.ts
│ └── package.json
├── scripts/ # 实用脚本
│ db-init.ts # 数据库模式初始化
│ ├── deploy.sh # 部署脚本
│ ├── migrate-user.ts # 用户迁移
│ └── query-firestore.ts # Firestore 调试
├── tests/ # 测试套件 ├── unit/ # 单元测试
│ ├── integration/ # 集成测试
│ └── e2e/ # 端到
├── docs/
│ QUICK_SETUP.md # 快速设置指南
├── AI-MEMORY-SETUP.md # AI 记忆配置
│ └── rules-template/ # IDE 集成模板
│ ├── CLAUDE.md
│ ├── cursor-codeatlas.mdc
│ ├── codeatlas-mcp.md
│ └── windsurfrules.md
├── instantclient/ # Oracle Instant Client 库
├── .github/workflows/
├── ci.yml # CI 管道(构建、类型检查、测试)
│ └── cd.yml # CD 管道(部署到实时服务器)
├──
├── tsconfig.json
├── DESIGN.md # 设计系统规范
├── CHANGELOG.md # 完整版本历史
└── LICENSE 许可证
```
## 🧠 记忆架构
使用 Oracle 26ai 原生数据库功能实现了一个 **三层记忆** 系统### 1. 📝 情景记忆(`ai_episodic_memory`)
存储业务事件为 JSON 文档,使用 Oracle 原生 `JSON` 数据类型。
- **业务规则** — 在代码审查期间捕获(例如,“VIP 用户免费运费”)
- **变更日志** — 在每次 `sync_system_memory` 调用时自动- **查询**: `SELECT event_data FROM ai_ep_memory WHERE project_name = :project AND event_type = 'BUSINESS_RULE'`
### 2. 🧬 语义记忆(`ai_semantic_memory`)
存储代码实体的向量嵌入,以便进行 AI 驱动的相似性搜索 **嵌入模型**: `nvidia/nv-embed-v 4096 FLOAT32 向量
存储**: Oracle 原VECTOR(4096,)` 数据类型
- **搜索**: `SELECT * FROM ai_semantic_memory ORDER BY VECTOR_DISTANCE(embedding, :queryINE) FETCH FIRST ROWS ONLY`
- **批量处理**: 实体嵌入以 50 为块存储,数据库批次为 500 3. 🔗记忆(`ai_relational_memory`)
存储代码依赖关系为属性图,以便进行图遍历。
- **知识**: `CREATE PROPERTY GRAPH ai_knowledge_graph` 通过连接语义实体
图查询**: `_knowledge_graph MATCH (a)-[e]->{1,5}(a))` 用于循环检测
- **关系类型**: `import`, `call`, `contains`, `implements`
### 🔐 Oracle VPD 多租户安全三个记忆表都 虚拟私有数据库(VPD)的保护,具有基于 `tenant_id` 的自动行级安全。每个数据库连接会话通过 `ADMIN.codeatlas_ctx_pkg.set_tenant(:tenantId)` 设置其安全上下文,VPD 策略透明地过滤行。
## 🏠 多租户架构
CodeAtlas AI 在每个层都支持 **SaaS 多租户**:
### 目录
```
tenants tenant-abc│ ├── project-alpha/
│ │ └── .codeatlas/analysis│ └── project-beta/
└── tenant-def456/
└── project-gamma/
```
### 数据库隔离
- **Oracle VPD/RLS**: 基于 `tenant_id` 的行级安全和自动- **Firestore 命名 文档前缀为 `${}_${projectName}`
-限制**: 每个租户的速率限制(60 次/分钟)
### 访问控制
- **标准用户只能查看和管理其租户沙盒内的项目
系统管理员**: 可以查看租户项目
认证**: Firebase ID仪表盘)或 API程序化)
## 📊 仪表交互式仪表盘是一个 React 应用程序,具有优质的orphism** 设计系统:
### 设计规范
主要颜色**: 霓虹青色 `#00FF` — 活动节点、CTA、发光装饰
- **次要颜色**: 电气紫色 `#9D00FF` — AI 洞察、关系
- **背景**: 深空色 `#0A0C10`,带有玻璃表面 `rgba(16, 20, 29, 0.6)`
- **背景模糊**: 20px 磨砂玻璃
- **字体排版**: Space Grotesk(标题)+ Inter(正文)
- **字体排版**: Space Grotesk(标题)+ Inter(正文)
### 仪表盘视图
| 视图 | 描述 |
|------|-------------|
| **控制中心** | 项目管理、API 密钥、设置 |
| **知识图谱** | 交互式力导向 SVG 图,支持缩放、平移和节点拖动 |
| **云索引** | 云同步状态、索引覆盖 |
| **文档** | MCP 集成指南和设置说明 |
### 构建仪表盘
```bash
cd dashboard
pnpm install
pnpm run build # 生产构建
pnpm run dev # 开发服务器
```
## 🧪 测试
CodeAtlas AI 包含一套全面的测试套件,包括单元测试、集成测试和端到端测试。
```bash
# 运行所有测试
pnpm test
# 运行 TypeScript 类型检查
npx tsc --noEmit --skipLibCheck
# 运行仪表盘测试
cd dashboard && pnpm test
```
### 测试结构
```
tests/
├── unit/
│ ├── scanner.test.ts # 安全扫描器逻辑
│ ├── repositories.test.ts # 认证和遥测仓库
│ ├── dreaming-service.test.ts # 梦境服务操作
│ ├── dreaming-routes.test.ts # 梦境记忆 REST 端点
│ └── memory-generator.test.ts # 记忆文档生成器
├── integration/
├── api.test.ts # REST API 端点
│ ├── mcp.test.ts # MCP 工具│ ├── database.test.ts # Oracle DB 操作 ├── multi-tenant.test.ts #
│ ├──letion.test.ts # 项目清理流程
│ ├── discovery.test.ts 发现
│ ├── settings.test.ts # 索引设置 API
│ └── watcher.test.ts # 文件监视器
└── e2e/
└── scan-flow.test.ts 到端分析流程
```
## 🤝 贡献
欢迎贡献!以下是您可以帮助的方式:
1. **Fork** 仓库
**创建功能分支git checkout -b-feature`
3. **提交更改**: `git commit 'Add my feature'`
4. **推送到分支**: `git push origin feature/my-feature`
5. **打开拉取请求**
### 开发指南
- 遵循现有的 **Clean Architecture** 模式
- 使用 **TypeScript** 编写并启用严格类型检查
- 为新功能添加 **测试**
- 根据需要更新 **文档**
- 确保所有测试通过:`pnpm### 代码风格
- 启用严格模式的
- ESLint + 实现一致的格式化 Clean Architecture,基于用例的服务设计
- Async/await 替代原始 Promise
## 📄 许可证
该项目在 **MIT License** 下许可 — 请参阅 [LICENSE](LICENSE) 文件了解详情。
```
MIT License
Copyright (c) 2026 GiauPhan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
...
```
<p align="center">
由 <a href="https://github.com/giauphan">GiauPhan</a> 用 ❤️ 构建<br>
由 <a href="https://www.oracle.com/database/">Oracle 26ai</a> · <a href="https://www.nvidia.com/en-us/ai/">NVIDIA NIM</a> · <a href="https://firebase.google.com/">Firebase</a> 驱动<br>
<a href="https://github.com/giauphan/codeatlas-platform">GitHub</a> · <a href="https://www.npmjs.com/package/codeatlas-enterprise">npm</a> · <a href="https://github.com/giauphan/codeatlas-platform/issues">问题</a>
</p>
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json
连接信息
猜你喜欢
暂无推荐服务器