CodeGuard AI is a full-stack static code analysis platform designed to help developers identify security vulnerabilities and code quality issues in Python applications. It combines a modern React frontend with a FastAPI backend to perform static analysis, generate security scores, classify vulnerabilities by severity, and produce professional audit reports.
The platform provides an intuitive browser-based development experience through an integrated Monaco Editor while delivering detailed analysis results and downloadable PDF reports.
- Monaco-powered code editor
- Write, paste, upload, or drag-and-drop Python files
- Static code analysis using 26 security and quality rules
- AST-based analysis for advanced code inspection
- Security score and letter grade generation
- Severity-wise issue classification
- Detailed findings dashboard with recommendations
- Professional downloadable PDF audit reports
- Scan history
- Responsive user interface
- Dark IDE-inspired design
- FastAPI-powered backend
- React + Vite frontend
CodeGuard AI performs analysis for:
- Hardcoded credentials
- Unsafe deserialization
- Mutable default arguments
- Bare exception handling
- Duplicate function definitions
- Unreachable code
- Unused imports
- Unused variables
- Infinite loops
- Weak coding practices
- General code quality issues
The analysis combines pattern-based rule checking with Python Abstract Syntax Tree (AST) inspection for improved accuracy.
- React
- Vite
- React Router
- Tailwind CSS
- Monaco Editor
- Framer Motion
- jsPDF
- jspdf-autotable
- Lucide React
- FastAPI
- Python
- Uvicorn
- Python AST Module
CodeGuard-AI
│
├── frontend
│ ├── public
│ ├── src
│ │ ├── components
│ │ ├── pages
│ │ ├── utils
│ │ └── ...
│ ├── package.json
│ └── ...
│
├── backend
│ ├── main.py
│ ├── analyzer.py
│ ├── rules.py
│ ├── ast_rules.py
│ ├── requirements.txt
│ └── ...
│
└── README.md
git clone https://github.com/Ritish363/codeguard-ai.git
cd codeguard-aicd backend
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reloadBackend will run at:
http://127.0.0.1:8000
cd frontend
npm install
npm run devFrontend will run at:
http://localhost:5173
Create a .env file inside the frontend directory.
VITE_API_URL=http://127.0.0.1:8000For production deployment, replace the value with the deployed backend URL.
- Launch both frontend and backend.
- Enter or upload a Python source file.
- Click Analyze Code.
- Review the generated security score, grade, and detected issues.
- Generate and download the audit report.
Screenshots will be added after deployment.
- Home Page
- Code Workspace
- Analysis Dashboard
- Audit Report
Vercel
Render
- Support for additional programming languages
- AI-powered code fix suggestions
- GitHub repository scanning
- User authentication
- Persistent cloud-based scan history
- Database integration
- Docker deployment
- CI/CD pipeline
Ritish Oswal
B.Tech – Artificial Intelligence & Data Science
GitHub: https://github.com/Ritish363
This project is intended for educational, portfolio, and demonstration purposes.
Frontend: https://codeguard-ai-umber.vercel.app
Backend API: https://codeguard-ai-backend-iy6j.onrender.com
The backend is hosted on Render Free Tier. The first request after inactivity may take around 30–60 seconds.