AI-Powered Intelligent Code Analysis Platform
Automated Code Review • Refactoring • Test Generation • Observability • Analytics
CodeLens AI is a production-style full-stack platform that leverages Large Language Models (LLMs) to provide intelligent code analysis capabilities for developers.
The platform enables automated code review, code explanation, refactoring suggestions, and unit test generation through OpenRouter-powered AI integration while maintaining enterprise-grade observability, caching, authentication, and monitoring infrastructure.
- AI Analysis: Automated code review, natural language explanations, and refactoring suggestions.
- Test Generation: Instant AI-generated unit tests for multiple programming languages.
- Security: Secure JWT-based authentication and user authorization.
- Performance: Redis caching layer for optimized API response times and LLM costs.
- Persistence: MongoDB-based storage for analysis history and user data.
- Observability: Real-time Prometheus metrics and interactive Grafana dashboards.
- Deployment: Fully Dockerized multi-service environment for easy setup.
Frontend (React.js)
│
▼
Backend API (Express.js)
│
┌──────┴──────┐
▼ ▼
MongoDB Redis
(Storage) (Caching)
│
▼
OpenRouter API
(LLM Integration)
│
▼
Prometheus + Grafana
(Monitoring & Analytics)
- Framework: React.js
- State/Data: Axios, Recharts
- UI/UX: React Hot Toast
- Runtime: Node.js (Express.js)
- Database: MongoDB
- Cache: Redis
- Security: JWT Authentication
- Logging: Winston
- LLM Provider: OpenRouter API
- Containerization: Docker, Docker Compose
- Monitoring: Prometheus, Grafana
git clone [https://github.com/sandeep7348/ai-code-analysis-platform.git](https://github.com/sandeep7348/ai-code-analysis-platform.git)
cd ai-code-analysis-platform
Create a .env file in the backend/ directory:
OR_API_KEY=your_openrouter_api_key
OR_BASE=[https://openrouter.ai/api/v1](https://openrouter.ai/api/v1)
OR_MODEL=meta-llama/llama-3.3-8b-instruct:free
PORT=5000
JWT_SECRET=your_secure_jwt_secret
CORS_ORIGIN=http://localhost:3000
MONGO_URI=mongodb://mongodb:27017/codelens
REDIS_URL=redis://redis:6379
docker-compose up --build
| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| Backend API | http://localhost:5000 |
| Grafana Dashboard | http://localhost:3001 |
| Prometheus Metrics | http://localhost:9090 |
POST /api/analyze
Payload:
{
"code": "function add(a, b) { return a + b }",
"language": "javascript",
"mode": "review"
}
*Supported Modes: review, explain, refactor, test*
The platform includes integrated monitoring for performance analysis:
- API request rates and duration analytics.
- AI Model response latency.
- Redis cache hit/miss ratio.
- Grafana Credentials:
admin/grafana123
Sandeep Choudhary GitHub Profile


