XCodeReviewer is a modern code audit platform powered by Large Language Models (LLM), designed to provide developers with intelligent, comprehensive, and in-depth code quality analysis and review services.
No deployment needed, access the online demo directly (data stored locally in browser, all core features supported):
https://xcodereviewer-preview.vercel.app
In the fast-paced world of software development, ensuring code quality is crucial. Traditional code audit tools are rigid and inefficient, while manual audits are time-consuming and labor-intensive. XCodeReviewer leverages the powerful capabilities of LLM to revolutionize the way code reviews are conducted:
Real-time display of project statistics, quality trends, and system performance, providing comprehensive code audit overview
Support for quick code snippet analysis with detailed What-Why-How explanations and fix suggestions
Integrated GitHub/GitLab repositories, supporting multi-language project audits and batch code analysis
Perfect for quick deployment and testing without a server, with global CDN acceleration.
Click the button below to deploy directly to Vercel:
# 1. Install Vercel CLI
npm i -g vercel
# 2. Login to Vercel
vercel login
# 3. Deploy project
vercel
# 4. Deploy to production
vercel --prod
VITE_LLM_PROVIDER=your_llm_provider VITE_LLM_API_KEY=your_api_key_here VITE_USE_LOCAL_DB=true
✨ Vercel Deployment Advantages:
✨ Database Mode:
⚠️ Important Notes:
/admin pageDirectly use the latest published Docker image, supports x86, ARM64 (Mac M-series), and ARMv7 architectures:
# 1. Pull the latest image
docker pull ghcr.io/lintsinghua/xcodereviewer:latest
# 2. Run container
docker run -d \
-p 8888:80 \
--name xcodereviewer \
--restart unless-stopped \
ghcr.io/lintsinghua/xcodereviewer:latest
# 3. Access the application
# Open http://localhost:8888 in your browser
Use specific version:
# Pull specific version (e.g., v1.1.0)
docker pull ghcr.io/lintsinghua/xcodereviewer:v1.1.0
# Run
docker run -d -p 8888:80 --name xcodereviewer ghcr.io/lintsinghua/xcodereviewer:v1.1.0
If you need custom build:
# 1. Clone the project
git clone https://github.com/lintsinghua/XCodeReviewer.git
cd XCodeReviewer
# 2. Build and start with Docker Compose
docker-compose up -d
# 3. Access the application
# Open http://localhost:8888 in your browser
✨ Runtime Configuration (Recommended)
After Docker deployment, you can configure all settings directly in the browser without rebuilding the image:
http://localhost:8888/admin (System Management page)📖 For detailed configuration instructions, see: System Configuration Guide
Suitable for development or custom modifications.
# 1. Clone the project
git clone https://github.com/lintsinghua/XCodeReviewer.git
cd XCodeReviewer
# 2. Install dependencies
pnpm install # or npm install / yarn install
# 3. Configure environment variables
cp .env.example .env
# Edit .env file, configure required parameters (see configuration guide below)
# 4. Start development server
pnpm dev
# 5. Access the application
# Open http://localhost:5173 in your browser
Edit .env file and configure the following required parameters:
# ========== Required Configuration ========== # LLM Provider (gemini|openai|claude|qwen|deepseek|zhipu|moonshot|baidu|minimax|doubao|ollama) VITE_LLM_PROVIDER=gemini # Corresponding API Key VITE_LLM_API_KEY=your_api_key_here # ========== Database Configuration (Choose One) ========== # Option 1: Local Database (Recommended, ready to use) VITE_USE_LOCAL_DB=true # Option 2: Supabase Cloud Database (Multi-device sync) # VITE_SUPABASE_URL=https://your-project.supabase.co # VITE_SUPABASE_ANON_KEY=your_anon_key # Option 3: Demo Mode (No database, data not persistent) # ========== Optional Configuration ========== # GitHub Integration (for repository analysis) # VITE_GITHUB_TOKEN=your_github_token # Output Language (zh-CN: Chinese | en-US: English) VITE_OUTPUT_LANGUAGE=en-US # Analysis Parameters VITE_MAX_ANALYZE_FILES=40 # Max files per analysis VITE_LLM_CONCURRENCY=2 # Concurrent requests VITE_LLM_GAP_MS=500 # Request interval (ms)
For timeout or connection issues, adjust these parameters:
VITE_LLM_TIMEOUT=300000 # Increase timeout VITE_LLM_BASE_URL=https://your-proxy.com/v1 # Use proxy or relay service VITE_LLM_CONCURRENCY=1 # Reduce concurrency VITE_LLM_GAP_MS=1000 # Increase request interval
Custom Headers Example (for special relay services):
# JSON format string VITE_LLM_CUSTOM_HEADERS='{"X-API-Version":"v1","X-Custom-Auth":"token123"}'
Method 1: Browser Configuration (Recommended)
http://localhost:8888/admin System Management pageMethod 2: Environment Variable Configuration
Modify configuration in .env:
# Switch to OpenAI VITE_LLM_PROVIDER=openai VITE_OPENAI_API_KEY=your_key # Switch to Qwen VITE_LLM_PROVIDER=qwen VITE_QWEN_API_KEY=your_key
VITE_LLM_TIMEOUT=300000VITE_LLM_BASE_URLVITE_LLM_CONCURRENCY=1Local Mode (Recommended): Data stored in browser IndexedDB, ready to use, privacy-secure
VITE_USE_LOCAL_DB=true
Cloud Mode: Data stored in Supabase, multi-device sync
VITE_SUPABASE_URL=https://your-project.supabase.co VITE_SUPABASE_ANON_KEY=your_key
Demo Mode: No database configuration, data not persistent
# 1. Install Ollama
curl -fsSL https://ollama.com/install.sh | sh # macOS/Linux
# Windows: Visit https://ollama.com/download
# 2. Pull model
ollama pull llama3 # or codellama, qwen2.5, deepseek-coder
# 3. Configure XCodeReviewer
# In .env:
VITE_LLM_PROVIDER=ollama
VITE_LLM_MODEL=llama3
VITE_LLM_BASE_URL=http://localhost:11434/v1
Recommended models: llama3 (general), codellama (code-specific), qwen2.5 (Chinese)
Baidu requires both API Key and Secret Key, separated by colon:
VITE_LLM_PROVIDER=baidu VITE_BAIDU_API_KEY=your_api_key:your_secret_key
Get from: https://console.bce.baidu.com/qianfan/
Many users use API relay services to access LLMs (more stable and cheaper). Configuration method:
/admin)https://your-proxy.com/v1)Notes:
/v1 (OpenAI-compatible format)Local data is stored in browser IndexedDB:
VITE_OUTPUT_LANGUAGE=zh-CN # Chinese (default) VITE_OUTPUT_LANGUAGE=en-US # English
Pre-configure all platform keys in .env, then just modify VITE_LLM_PROVIDER to switch:
VITE_LLM_PROVIDER=gemini # Currently active platform # Pre-configure all platforms VITE_GEMINI_API_KEY=key1 VITE_OPENAI_API_KEY=key2 VITE_QWEN_API_KEY=key3
XCodeReviewer has a built-in logging system that records core operations and errors:
View Logs:
http://localhost:5173/logs (dev) / http://localhost:8888/logs (prod)Recorded Content:
Features:
Manual Logging:
import { logger, LogCategory } from '@/shared/utils/logger';
// Log user actions
logger.logUserAction('Create Project', { projectName, projectType });
logger.logUserAction('Start Audit', { taskId, fileCount });
XCodeReviewer supports 10+ mainstream LLM platforms, choose freely based on your needs:
| Platform Type | Platform Name | Features | Get API Key |
|---|---|---|---|
| International | Google Gemini | Generous free tier, recommended | Get |
| OpenAI GPT | Stable, best performance | Get | |
| Anthropic Claude | Strong code understanding | Get | |
| DeepSeek | Cost-effective | Get | |
| Chinese | Alibaba Qwen | Fast domestic access | Get |
| Zhipu AI (GLM) | Good Chinese support | Get | |
| Moonshot (Kimi) | Long context | Get | |
| Baidu ERNIE | Enterprise service | Get | |
| MiniMax | Multimodal | Get | |
| Bytedance Doubao | Cost-effective | Get | |
| Local | Ollama | Fully local, privacy-secure | Install |
# Universal configuration (recommended) VITE_LLM_PROVIDER=gemini VITE_LLM_API_KEY=your_api_key_here # Or use platform-specific configuration VITE_GEMINI_API_KEY=your_gemini_key VITE_OPENAI_API_KEY=your_openai_key # ... More platforms in .env.example
For cloud data sync:
supabase/migrations/full_schema.sql in Supabase SQL Editor.envVisit /admin page for complete system configuration and data management features:
🔧 Visual Configuration Management (Runtime Configuration):
💾 Database Management:
📈 Data Overview:
| Category | Technology | Description |
|---|---|---|
| Frontend Framework | React 18 TypeScript Vite | Modern frontend development stack with hot reload and type safety |
| UI Components | Tailwind CSS Radix UI Lucide React | Responsive design, accessibility, rich icon library |
| Data Visualization | Recharts | Professional chart library supporting multiple chart types |
| Routing | React Router v6 | Single-page application routing solution |
| State Management | React Hooks Sonner | Lightweight state management and notification system |
| AI Engine | Multi-Platform LLM | Supports 10+ mainstream platforms including Gemini, OpenAI, Claude, Qwen, DeepSeek |
| Data Storage | IndexedDB Supabase PostgreSQL | Dual-mode support for local database + cloud database |
| Backend Service | Supabase PostgreSQL | Full-stack backend-as-a-service with real-time database |
| HTTP Client | Axios Ky | Modern HTTP request libraries |
| Code Quality | Biome Ast-grep TypeScript | Code formatting, static analysis, and type checking |
| Build Tools | Vite PostCSS Autoprefixer | Fast build tools and CSS processing |
XCodeReviewer/ ├── src/ │ ├── app/ # Application configuration │ │ ├── App.tsx # Main application component │ │ ├── main.tsx # Application entry point │ │ └── routes.tsx # Route configuration │ ├── components/ # React components │ │ ├── layout/ # Layout components (Header, Footer, PageMeta) │ │ ├── ui/ # UI component library (based on Radix UI) │ │ ├── system/ # System configuration components │ │ ├── database/ # Database management components │ │ └── debug/ # Debug components │ ├── pages/ # Page components │ │ ├── Dashboard.tsx # Dashboard │ │ ├── Projects.tsx # Project management │ │ ├── InstantAnalysis.tsx # Instant analysis │ │ ├── AuditTasks.tsx # Audit tasks │ │ └── AdminDashboard.tsx # System management │ ├── features/ # Feature modules │ │ ├── analysis/ # Analysis related services │ │ │ └── services/ # AI code analysis engine │ │ └── projects/ # Project related services │ │ └── services/ # Repository scanning, ZIP file scanning │ ├── shared/ # Shared utilities │ │ ├── config/ # Configuration files │ │ │ ├── database.ts # Unified database interface │ │ │ ├── localDatabase.ts # IndexedDB implementation │ │ │ └── env.ts # Environment variable configuration │ │ ├── types/ # TypeScript type definitions │ │ ├── hooks/ # Custom React Hooks │ │ ├── utils/ # Utility functions │ │ │ └── initLocalDB.ts # Local database initialization │ │ └── constants/ # Constants definition │ └── assets/ # Static assets │ └── styles/ # Style files ├── supabase/ │ └── migrations/ # Database migration files ├── public/ │ └── images/ # Image resources ├── scripts/ # Build and setup scripts └── rules/ # Code rules configuration
Visit /admin System Management page and configure in the "System Configuration" tab:
https://your-proxy.com/v1)After configuration, click "Save All Changes" and refresh the page to use.
/instant-analysis page/projects pagePDF Export Tips:
# Development mode
pnpm dev
# Build production version
pnpm build
# Preview build results
pnpm preview
# Code linting
pnpm lint
| Variable | Required | Default | Description |
|---|---|---|---|
VITE_LLM_PROVIDER | ✅ | gemini | LLM provider: gemini|openai|claude|qwen|deepseek|zhipu|moonshot|baidu|minimax|doubao|ollama |
VITE_LLM_API_KEY | ✅ | - | Universal API Key (higher priority than platform-specific config) |
VITE_LLM_MODEL | ❌ | Auto | Model name (uses platform default if not specified) |
VITE_LLM_BASE_URL | ❌ | - | Custom API endpoint (supports relay services for all platforms, proxy, or private deployment) |
VITE_LLM_TIMEOUT | ❌ | 150000 | Request timeout (milliseconds) |
VITE_LLM_TEMPERATURE | ❌ | 0.2 | Temperature parameter (0.0-2.0), controls output randomness |
VITE_LLM_MAX_TOKENS | ❌ | 4096 | Maximum output tokens |
VITE_LLM_CUSTOM_HEADERS | ❌ | - | Custom HTTP headers (JSON string format), for special relay services or self-hosted instances |
💡 API Format Support: XCodeReviewer supports 3 mainstream API formats:
- OpenAI-Compatible Format (Most Common): Works with most relay services and OpenRouter
- Gemini Format: Google Gemini official and compatible services
- Claude Format: Anthropic Claude official and compatible services
Simply select the corresponding LLM provider, enter the relay service address and Key. The custom headers feature can meet additional requirements of special relay services.
| Variable | Description | Special Requirements |
|---|---|---|
VITE_GEMINI_API_KEY | Google Gemini API Key | - |
VITE_GEMINI_MODEL | Gemini model (default: gemini-1.5-flash) | - |
VITE_OPENAI_API_KEY | OpenAI API Key | - |
VITE_OPENAI_MODEL | OpenAI model (default: gpt-4o-mini) | - |
VITE_OPENAI_BASE_URL | OpenAI custom endpoint | For relay services |
VITE_CLAUDE_API_KEY | Anthropic Claude API Key | - |
VITE_CLAUDE_MODEL | Claude model (default: claude-3-5-sonnet-20241022) | - |
VITE_QWEN_API_KEY | Alibaba Qwen API Key | - |
VITE_QWEN_MODEL | Qwen model (default: qwen-turbo) | - |
VITE_DEEPSEEK_API_KEY | DeepSeek API Key | - |
VITE_DEEPSEEK_MODEL | DeepSeek model (default: deepseek-chat) | - |
VITE_ZHIPU_API_KEY | Zhipu AI API Key | - |
VITE_ZHIPU_MODEL | Zhipu model (default: glm-4-flash) | - |
VITE_MOONSHOT_API_KEY | Moonshot Kimi API Key | - |
VITE_MOONSHOT_MODEL | Kimi model (default: moonshot-v1-8k) | - |
VITE_BAIDU_API_KEY | Baidu ERNIE API Key | ⚠️ Format: API_KEY:SECRET_KEY |
VITE_BAIDU_MODEL | ERNIE model (default: ERNIE-3.5-8K) | - |
VITE_MINIMAX_API_KEY | MiniMax API Key | - |
VITE_MINIMAX_MODEL | MiniMax model (default: abab6.5-chat) | - |
VITE_DOUBAO_API_KEY | Bytedance Doubao API Key | - |
VITE_DOUBAO_MODEL | Doubao model (default: doubao-pro-32k) | - |
| Variable | Required | Description |
|---|---|---|
VITE_SUPABASE_URL | ❌ | Supabase project URL (for data persistence) |
VITE_SUPABASE_ANON_KEY | ❌ | Supabase anonymous key |
💡 Note: Without Supabase config, system runs in demo mode without data persistence
| Variable | Required | Description |
|---|---|---|
VITE_GITHUB_TOKEN | ✅ | GitHub Personal Access Token |
VITE_GITLAB_TOKEN | ✅ | GitLab Personal Access Token |
| Variable | Default | Description |
|---|---|---|
VITE_MAX_ANALYZE_FILES | 40 | Maximum files per analysis |
VITE_LLM_CONCURRENCY | 2 | LLM concurrent requests (reduce to avoid rate limiting) |
VITE_LLM_GAP_MS | 500 | Gap between LLM requests (milliseconds, increase to avoid rate limiting) |
| Variable | Default | Description |
|---|---|---|
VITE_APP_ID | xcodereviewer | Application identifier |
We warmly welcome all forms of contributions! Whether it's submitting issues, creating PRs, or improving documentation, every contribution is important to us. Please contact us for detailed information.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Thanks to these amazing contributors who make XCodeReviewer better!
Currently, XCodeReviewer is in rapid prototype validation stage. Based on project development and community feedback, our roadmap includes:
⭐ If this project helps you, please give us a Star! Your support is our motivation to keep moving forward!
This disclaimer is intended to clarify the responsibilities and risks associated with the use of this open source project and to protect the legitimate rights and interests of project authors, contributors and maintainers. The code, tools and related content provided by this open source project are for reference and learning purposes only.
For questions, please contact maintainers via GitHub Issues. This disclaimer is governed by the laws of the project's jurisdiction.