AI-powered code analysis tool that detects your programming language, evaluates time & space complexity, catches syntax errors, and delivers optimization suggestions — all inside a VS Code–style Monaco editor.
- 🔍 Automatic Language Detection — just paste code, no manual language selection needed
- ⏱️ Time & Space Complexity Analysis — Big-O breakdown powered by real parsing (tree-sitter), not guesswork
- 🐞 Syntax Error Detection — pinpoints issues with line-level detail
- 💡 AI Optimization Suggestions — actionable, categorized recommendations with severity indicators
- 🤖 AI Explanation Panel — plain-language breakdown of what your code does and why it performs the way it does
- 🔁 Optimized Code Rewrite — view a suggested, more efficient version of your code side-by-side
- 🕘 Analysis History — past runs are saved locally so you can revisit or reload them anytime
- 🌗 Light / Dark Theme — full theme toggle with a custom Monaco color scheme for both modes
- 🔎 Editor Zoom — pinch-to-zoom (trackpad & touchscreen) and Ctrl/Cmd + scroll support on all code panels
- 📱 Fully Responsive — optimized layouts and a native mobile hamburger menu down to small phone screens
- ⚡ Fast, Modern Stack — built with Vite + React on the frontend, Express + tree-sitter on the backend
| Layer | Technology |
|---|---|
| Frontend | React, Vite, React Router, Monaco Editor |
| Backend | Node.js, Express, Tree-sitter (multi-language parsing) |
| Styling | Custom CSS design system (no framework) |
| State/Storage | React state, localStorage for history persistence |
Add screenshots or a demo GIF here once available, e.g.:
 
- Node.js v18 or higher
- npm (comes bundled with Node.js)
git clone https://github.com/rsemwal1711/CodeInsight-AI.git
cd CodeInsight-AIcd backend
npm installCreate a .env file inside backend/ (see Environment Variables below), then start the server:
node server.jsBy default, the backend runs on http://localhost:8000.
Open a new terminal window:
cd frontend
npm installCreate a .env file inside frontend/ with your API base URL:
VITE_API_BASE_URL=http://localhost:8000Then start the dev server:
npm run devThe app will be available at http://localhost:5173 (or whichever port Vite assigns).
Neither .env file is committed to this repository — create them locally using the templates below.
backend/.env
PORT=8000
# Add any AI provider keys, database URLs, or other secrets herefrontend/.env
VITE_API_BASE_URL=http://localhost:8000
⚠️ Never commit real.envfiles. This repo's.gitignorealready excludes them — if you're forking or setting this up fresh, double check.envisn't tracked before pushing.
CodeInsight-AI/
├── backend/ # Express API + tree-sitter analysis engine
│ ├── server.js
│ └── ...
├── frontend/ # React + Vite client
│ ├── src/
│ │ ├── pages/ # HomePage, AnalyzePage, ExamplesPage, About
│ │ ├── components/ # Header (NavBar), Footer, shared UI
│ │ └── context/ # ThemeContext (light/dark mode)
│ └── ...
├── .gitignore
└── README.md
- Open the Analyze page
- Paste or write code directly into the editor
- Click Analyze (or press
Ctrl/Cmd+Enter) - Review detected language, complexity ratings, syntax errors, and suggestions in the results panel
- Expand the Optimized Code block for a full-screen, copyable rewrite
- Revisit past analyses anytime from the History panel
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m "Add your feature") - Push to your branch (
git push origin feature/your-feature) - Open a Pull Request
Built by rsemwal1711
For questions, issues, or feature requests, please open an issue.