AI-powered code analysis with multi-tier intelligence β Gemini β AWS Bedrock β Offline fallback.
Tip
The app auto-warms all backend services on first load β no manual steps needed. Just click and wait ~30s on first visit (Render free tier cold start).
| Feature | Description |
|---|---|
| π€ Multi-Tier AI Router | Gemini β AWS Bedrock β Offline fallback for 100% uptime |
| β‘ Request Caching | SHA-256 hash lookup in MongoDB β cache hits respond in ~5ms |
| π Complexity Analysis | Big-O time & space complexity, warnings, and improvement tips |
| π¬ AI Chat Assistant | Ask follow-up questions about your code in real time |
| π₯ Warmup Screen | Auto-pings all services on load β no more cold start failures |
| 𦴠Skeleton Loaders | Shimmer placeholders while AI analysis runs |
| π‘οΈ Robust Error Handling | Standardized error responses with graceful degradation |
| π§ͺ Unit Test Coverage | 12 Pytest cases covering all offline analysis branches |
| π Full CI/CD Pipeline | GitHub Actions: test β build β deploy to Render automatically |
| π Keep-Alive Cron | Pings all 3 Render services every 10 min β prevents cold starts |
CodeMind AI/
βββ .github/
β βββ workflows/
β βββ frontend.yml β CI: React build check
β βββ backend.yml β CI: Node.js syntax check
β βββ ml-service.yml β CI: Pytest suite (12 tests)
β βββ deploy.yml β CD: Auto-deploy all 3 to Render
β βββ keep-alive.yml β Cron: ping services every 10 min
βββ frontend/ β React 19 + Vanilla CSS dark theme
β βββ src/
β βββ components/
β β βββ WarmupScreen.js # Cold-start handler
β β βββ CodeEditor.js # Code input area
β β βββ ResultPanel.js # Analysis report
β β βββ SkeletonLoader.js # Shimmer placeholders
β β βββ AiAssistant.js # Chat interface
β β βββ ComplexityGraph.js # Big-O visualizer
β β βββ Header.js
β β βββ Sidebar.js # History panel
β βββ index.css
βββ backend/ β Node.js/Express β API gateway + cache
β βββ server.js # MD5 cache, MongoDB, proxy to ML service
βββ ml-service/ β Python Flask β AI orchestration
β βββ app.py # 3-tier router + offline engine
β βββ pytest.ini
β βββ tests/
β βββ test_analyze_offline.py
βββ README.md
User Request
β
βΌ
βββββββββββββββ β
success ββββββββββββββββ
β Google ββββββββββββββββΊ β Response β
β Gemini β ββββββββββββββββ
βββββββββββββββ
β β timeout / 429
βΌ
βββββββββββββββ β
success ββββββββββββββββ
β AWS ββββββββββββββββΊ β Response β
β Bedrock β ββββββββββββββββ
βββββββββββββββ
β β error
βΌ
βββββββββββββββ
β Offline ββββββββββββββββΊ Static heuristic analysis
β Analyzer β
βββββββββββββββ
- Node.js v18+
- Python 3.10+
- MongoDB (local or Atlas)
- Git
git clone https://github.com/Meenbudha/code-complexity-reviewer.git
cd code-complexity-reviewercd backend
npm installCreate backend/.env:
PORT=5000
MONGO_URL=mongodb://localhost:27017/codemind
ML_SERVICE_URL=http://localhost:8000node server.jscd ml-service
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txtCreate ml-service/.env:
GEMINI_API_KEY=your_gemini_api_key_here
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1python app.pycd frontend
npm install --legacy-peer-depsCreate frontend/.env:
REACT_APP_BACKEND_URL=http://localhost:5000
REACT_APP_ML_URL=http://localhost:8000npm startOpen http://localhost:3000 in your browser.
cd ml-service
python -m pytest tests/ -vExpected output: 12 passed covering O(1), O(n), O(nΒ²), O(log n), O(n log n), O(2^n), recursion, hashmap, string concat, deep nesting, Java syntax.
All 3 services are deployed on Render free tier.
| Service | Render Config |
|---|---|
| Frontend | Root: frontend Β· Build: npm install --legacy-peer-deps && npm run build Β· Publish: build/ |
| Backend | Root: backend Β· Build: npm install Β· Start: node server.js |
| ML Service | Root: ml-service Β· Build: pip install -r requirements.txt Β· Start: gunicorn app:app --workers 2 --timeout 60 --bind 0.0.0.0:$PORT |
Frontend service:
REACT_APP_BACKEND_URL = https://your-backend.onrender.com
REACT_APP_ML_URL = https://your-ml-service.onrender.com
Important
REACT_APP_* variables must be set in Render before building. React bakes them into the static bundle at build time β they are not runtime variables.
Backend service:
MONGO_URL = mongodb+srv://... (MongoDB Atlas)
ML_SERVICE_URL = https://your-ml-service.onrender.com
PORT = 5000
ML service:
GEMINI_API_KEY = ...
AWS_ACCESS_KEY_ID = ...
AWS_SECRET_ACCESS_KEY= ...
AWS_REGION = us-east-1
FLASK_ENV = production
Every git push to main triggers a full automated pipeline:
Push to main
β
βββ βοΈ Frontend CI (npm build)
βββ π‘ Backend CI (node --check)
βββ π ML Service CI (pytest 12 tests)
β all pass β
βΌ
βββ π Deploy Frontend β Render
βββ π‘ Deploy Backend β Render
βββ π€ Deploy ML β Render
β
βΌ
β
Deployment Summary printed
Keep-Alive: A separate cron workflow pings all 3 services every 10 minutes to prevent Render free-tier spin-down.
Important
All sensitive values must go in the Secrets tab β NOT the Variables tab.
| Secret | Purpose |
|---|---|
GEMINI_API_KEY |
Gemini AI provider |
AWS_ACCESS_KEY_ID |
AWS Bedrock fallback |
AWS_SECRET_ACCESS_KEY |
AWS Bedrock fallback |
RENDER_DEPLOY_HOOK_FRONTEND |
Auto-deploy frontend |
RENDER_DEPLOY_HOOK_BACKEND |
Auto-deploy backend |
RENDER_DEPLOY_HOOK_ML |
Auto-deploy ML service |
RENDER_BACKEND_URL |
Keep-alive ping |
RENDER_ML_URL |
Keep-alive ping |
| Layer | Technology |
|---|---|
| Frontend | React 19, Vanilla CSS, Custom Dark Theme |
| Backend | Node.js 18, Express 5, Mongoose |
| ML Service | Python 3.10, Flask, Gunicorn |
| AI β Primary | Google Gemini 2.0 Flash |
| AI β Fallback | AWS Bedrock (Amazon Nova Micro) |
| AI β Offline | Custom heuristic regex engine |
| Database | MongoDB Atlas (cache + history) |
| Testing | Pytest (12 offline unit tests) |
| CI/CD | GitHub Actions (4 workflows) |
| Hosting | Render (all 3 services) |
- Deploy all 3 services to Render
- Full CI/CD pipeline with GitHub Actions
- Cold start WarmupScreen
- Keep-alive cron job
- Unit tests (12 Pytest cases)
- Add input validation + rate limiting
- Support more languages (JavaScript, Go, Rust)
- Dark/Light mode persistence (localStorage)
- VS Code extension
This project is licensed under the MIT License β see the LICENSE file for details.
Built with β€οΈ by Meenbudha
β Star this repo if you find it useful!