A modern, real-time AI code review application with intelligent language detection, built on Cloudflare's edge computing platform. Get instant code analysis, security audits, performance insights, and documentation suggestions powered by Llama 3.1.
-
Intelligent Language Detection - Automatically detects and validates programming languages
-
Real-time Streaming - Watch AI analysis stream in real-time as it's generated
-
Multi-language Support - JavaScript, TypeScript, Python, Java, Go, Rust, C++, C#, PHP, Ruby, Swift, Kotlin
-
Review Categories:
- Quick Review - Overall code quality assessment
- Security Audit - Vulnerability detection & OWASP analysis
- Performance Analysis - Optimization suggestions
- Documentation Review - Comment & documentation improvements
Visit the deployed application: https://ai-code-reviewer-5fq.pages.dev
# Clone the repository
git clone <your-repo-url>
cd ai_code_reviewer
# Install backend dependencies
npm install
# Install frontend dependencies
cd frontend
npm install
cd ..
# Start the backend Worker (in one terminal)
npm run dev
# Start the frontend (in another terminal)
npm run dev:frontendThe frontend will be available at http://localhost:5173 and connects to the local Worker at http://localhost:8787.
Use the REST API directly without the frontend:
# Submit code for review
curl -X POST https://ai-code-reviewer-backend.mohammedfirdousaraoye.workers.dev/api/review \
-H "Content-Type: application/json" \
-d '{
"code": "console.log(\"Hello World\");",
"category": "quick",
"language": "javascript"
}'
# Get all reviews
curl https://ai-code-reviewer-backend.mohammedfirdousaraoye.workers.dev/api/reviews
# Check service status
curl https://ai-code-reviewer-backend.mohammedfirdousaraoye.workers.dev/api/statusSubmit code for AI analysis.
Request:
{
"code": "console.log('Hello World');",
"category": "quick|security|performance|documentation",
"language": "javascript|typescript|python|java|go|rust|cpp|csharp|php|ruby|swift|kotlin|other"
}Response:
{
"success": true,
"review": {
"id": "unique-review-id",
"code": "console.log('Hello World');",
"category": "quick",
"language": "javascript",
"result": "AI analysis result...",
"timestamp": 1760798282676
}
}Retrieve all submitted code reviews.
Check service health and statistics.
Basic health check endpoint.
Interactive API documentation.
The application also supports WebSocket connections for real-time streaming. Connect to /agent endpoint and send:
{
"type": "submit_code",
"code": "your code here",
"category": "quick",
"language": "javascript"
}- Node.js 18+ and npm
- Cloudflare account (for deployment)
- Wrangler CLI (installed via npm)
-
Install dependencies:
# Backend npm install # Frontend cd frontend && npm install && cd ..
-
Configure environment:
npm run setup # Edit .env with your Cloudflare credentials -
Run locally:
# Terminal 1: Backend npm run dev # Terminal 2: Frontend npm run dev:frontend
- Open
http://localhost:5173in your browser - Paste code into the editor
- Select a review category
- Click "Review Code" to see streaming AI analysis
# Configure environment first
npm run setup
# Deploy
npm run deploycd frontend
npm run deployThe deployment script uses API tokens from .env - no OAuth required!
# Check health
curl https://ai-code-reviewer-backend.mohammedfirdousaraoye.workers.dev/health
# View logs
npm run logs
# Verify deployment
npm run verifyThe application intelligently detects programming languages using pattern recognition:
- Automatic Detection - Analyzes code syntax to identify the language
- Validation - Prevents mismatched language selections
- Smart Suggestions - Recommends correct language when mismatch detected
- Non-code Detection - Identifies and rejects plain text submissions
JavaScript, TypeScript, Python, Java, Go, Rust, C++, C#, PHP, Ruby, Swift, Kotlin, and more.
Ctrl/Cmd + K- Focus code inputCtrl/Cmd + Enter- Submit review
- AI Binding: Connects to Workers AI for Llama 3.1
- Durable Object:
CodeReviewerAgentfor stateful sessions - Compatibility: Node.js compatibility enabled
Create a .env file with:
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_API_TOKEN=your-api-token