ArmorCode AI is an advanced, enterprise-grade JavaScript security analysis platform that combines the power of machine learning with rule-based vulnerability detection. Built with a modern tech stack, it provides real-time security analysis, AI-enhanced risk scoring, and comprehensive vulnerability reporting for JavaScript applications.
- ๐ค AI-Powered Analysis: Advanced machine learning model with Random Forest classifier
- โก Real-Time Detection: Instant vulnerability scanning and risk assessment
- ๐ฏ Hybrid Scoring System: Combines ML predictions with rule-based analysis and heuristics
- ๐จ Professional UI: Modern, responsive interface with dark theme and animations
- ๐ Comprehensive Metrics: Detailed code analysis with 35+ feature extraction points
- ๐ 15+ Vulnerability Patterns: Detects XSS, code injection, eval() usage, and more
- ๐ฑ Responsive Design: Works seamlessly across desktop, tablet, and mobile devices
- ๐ช Enterprise Ready: Professional-grade interface suitable for corporate environments
ArmorCode AI/
โโโ Frontend/ # React.js Frontend Application
โโโ ml_API/ # Python Flask ML API
โโโ Backend/ # Node.js Backend (Optional)
โโโ .venv/ # Python Virtual Environment
- React.js 19.1.0 - Modern UI framework with hooks
- Tailwind CSS 4.1.11 - Utility-first CSS framework
- Vite - Fast build tool and development server
- ESLint - Code linting and static analysis
- Python Flask - Lightweight web framework
- scikit-learn - Machine learning library
- joblib - Model persistence and loading
- Flask-CORS - Cross-origin resource sharing
- Random Forest Classifier - Core ML model
- Git - Version control
- Virtual Environment - Python dependency isolation
- Modern JavaScript (ES6+) - Latest language features
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- Git
git clone https://github.com/Rounak87/ArmorCode.git
cd ArmorCodepython -m venv .venv
.venv\Scripts\activate # Windows
cd ml_API
pip install flask flask-cors scikit-learn joblib numpy pandascd ../Frontend
npm installcd ../ml_API
npm install eslintcd ml_API
.venv\Scripts\activate # Windows
python ml_api.pyServer runs on: http://localhost:5000
cd Frontend
npm run devFrontend runs on: http://localhost:5176
- Open your browser and navigate to
http://localhost:5176 - Paste JavaScript code in the code editor
- Click "Analyze Code Security" to get instant results
- Review the results including risk level, vulnerabilities, and metrics
The AI model analyzes 35+ code characteristics:
- Structural metrics: Lines, characters, functions, variables
- Security patterns: eval(), innerHTML, document.write usage
- Risk indicators: Dynamic function creation, unsafe DOM manipulation
- Code complexity: Nested structures, conditional statements
- Instant feedback as you type or paste code
- Loading indicators during analysis
- Error handling for network issues
- Risk assessment with color-coded levels (High/Medium/Low/Minimal)
- Vulnerability list with detailed descriptions and line numbers
- Code metrics showing analysis statistics
- Interactive elements with hover effects and transitions
Create a .env file in the root directory:
# API Configuration
ML_API_URL=http://localhost:5000
FRONTEND_PORT=5176
# Development
NODE_ENV=developmentArmorCode AI/
โโโ Frontend/
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ Header.jsx
โ โ โ โโโ CodeInput.jsx
โ โ โ โโโ RiskAssessment.jsx
โ โ โ โโโ VulnerabilityList.jsx
โ โ โ โโโ CodeMetrics.jsx
โ โ โ โโโ ResultsPanel.jsx
โ โ โโโ App.jsx # Main application
โ โ โโโ main.jsx # Entry point
โ โ โโโ index.css # Global styles
โ โโโ package.json # Frontend dependencies
โ โโโ vite.config.js # Vite configuration
โโโ ml_API/
โ โโโ ml_api.py # Flask API server
โ โโโ rf_vuln_model.pkl # Trained ML model
โ โโโ package.json # API dependencies
โโโ Backend/ # Optional Node.js backend
โโโ .venv/ # Python virtual environment
โโโ .gitignore # Git ignore rules
โโโ README.md # This file
- Analysis Speed: ~100-500ms per code sample
- Accuracy: 85%+ vulnerability detection rate
- Scalability: Handles code samples up to 10,000+ lines
- Memory Usage: ~50MB for ML model in memory
- Input Sanitization: All user inputs are properly sanitized
- CORS Protection: Configured for development and production
- No Code Execution: Analysis is static, no user code is executed
- Data Privacy: Code analysis happens locally, no data sent to external services
- Rounak87 - GitHub
โญ Star this repository if you find it helpful!
