AI-Powered Code Analysis & Optimization Platform
Frontend Application: CodeCopilot
Note: The backend service needs to be running locally or deployed separately for full functionality.
CodeCopilot is an intelligent code analysis platform that helps developers identify issues, security vulnerabilities, and optimization opportunities in their web projects. With AI-powered insights and comprehensive security scanning, it's your co-pilot for better code quality.
- Dependency Analysis: Detect version mismatches and missing dependencies
- Security Scanning: Comprehensive security vulnerability detection
- Project Structure: Analyze project organization and best practices
- Configuration Validation: Validate project configuration files
- LLM Integration: Get intelligent solutions and explanations
- Root Cause Analysis: Understand why issues occur
- Step-by-Step Solutions: Detailed fix instructions
- Prevention Tips: Learn how to avoid similar issues
- Zip Bomb Protection: Advanced compression ratio detection
- File Type Filtering: Automatic blocking of dangerous file types
- Path Traversal Prevention: Secure file extraction
- Size Limits: Configurable file and extraction size limits
- Health Score: Overall project health assessment
- Priority Issues: Critical, major, and minor issue categorization
- Security Warnings: Detailed security notifications
- Project Statistics: File counts, configuration analysis
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β AI Service β
β (React) βββββΊβ (Flask) βββββΊβ β
β β β β β β
β β’ Project Uploadβ β β’ Security Scan β β β’ Code Analysis β
β β’ Results Displayβ β β’ File Analysis β β β’ Solutions β
β β’ Status Monitor β β β’ LLM Integrationβ β β’ Explanations β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
# Clone the repository
git clone https://github.com/your-username/codecopilot.git
cd codecopilot/frontend
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Start development server
npm run devFrontend Environment Variables:
VITE_BACKEND_URL=http://localhost:5000# Navigate to backend directory
cd ../backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Start Flask server
python app.pyBackend Environment Variables:
SECRET_KEY=your-secret-key-here
GEMINI_API_KEY=your-gemini-api-key-here
FLASK_DEBUG=false
PORT=5000src/
βββ components/ # React components
β βββ ProjectUpload.jsx
β βββ ResultsDashboard.jsx
β βββ BackendStatus.jsx
β βββ Logo.jsx
βββ hooks/ # Custom React hooks
βββ styles/ # Tailwind CSS styles
βββ main.jsx # Application entry point
backend/
βββ app.py # Flask application
βββ security_scanner.py # Security & zip bomb protection
βββ project_analyzer.py # Code analysis logic
βββ llm_analyzer.py # Gemini AI integration
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template
- Max Upload Size: 400MB
- Max Extracted Size: 800MB
- Max File Count: 50,000 files
- Max Compression Ratio: 50:1
- Blocked Extensions:
.bat,.cmd,.ps1,.sh,.jar, etc. - Max Directory Depth: 20 levels
- Path Traversal Protection: Enabled
- Zip your entire project folder (including
node_modulesif desired) - Drag and drop or click to upload
- Supports projects up to 400MB
- Security scanning and validation
- Dependency and configuration analysis
- AI-powered issue detection
- Health score and project statistics
- Categorized issues with severity levels
- Detailed solutions and prevention tips
- Copy-paste commands for quick fixes
- Step-by-step solution guides
- AI-enhanced explanations
GET /api/healthResponse:
{
"status": "healthy",
"llm_available": true,
"security": {
"max_file_size_mb": 400,
"max_extracted_size_mb": 800
}
}POST /api/analyze
Content-Type: multipart/form-dataBody: file (ZIP archive)
# Run in development mode
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview# Run with auto-reload
flask run --debug
# Run with custom port
python app.py --port 5000- Push code to GitHub
- Connect repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on git push
- Connect GitHub repository to Render
- Set build command:
pip install -r requirements.txt - Set start command:
python app.py - Configure environment variables
# Frontend
VITE_BACKEND_URL=https://your-backend-url.render.com
# Backend
SECRET_KEY=your-production-secret-key
GEMINI_API_KEY=your-gemini-api-key
FLASK_DEBUG=falseWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Frontend: Optimized React with Vite build system
- Backend: Flask with async processing for large files
- Security: Multi-layered protection against malicious uploads
- AI: Efficient Gemini API integration with fallback handling
Backend Connection Failed
- Check if backend server is running on port 5000
- Verify
VITE_BACKEND_URLenvironment variable - Check CORS configuration
File Upload Fails
- Ensure file is a valid ZIP archive
- Check file size (max 400MB)
- Verify network connectivity
AI Features Not Working
- Check Gemini API key configuration
- Verify API quota and limits
- Check backend logs for errors
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini for AI-powered code analysis
- React & Vite for frontend framework
- Flask for backend API
- Tailwind CSS for styling
- Vercel & Render for deployment platforms