An AI-powered code review assistant that uses locally hosted Ollama LLM to analyze source code and provide automated code reviews.
- 🤖 AI-Powered Reviews: Uses locally hosted Ollama LLM for privacy and performance
- ⚡ Fast Analysis: Get comprehensive code reviews in seconds
- 🔒 Privacy-First: Your code stays on your machine - no cloud uploads
- 📝 Multiple Languages: Supports JavaScript, TypeScript, Python, Java, C++, Go, Rust, and more
- 💬 Comment System: Add comments and replies to review findings
- 🔍 Incremental Review: Review only changed code segments (stretch goal)
- 🎯 Pre-commit Hooks: Integrate with git hooks for automatic reviews
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js + Express
- Database: MongoDB
- LLM: Ollama (local)
- Deployment: AWS (optional)
- Linux distribution (Arch Linux or Ubuntu/Debian)
- Node.js 18+ and npm 9+
- MongoDB
- Ollama with a code model (codellama recommended)
Run the setup script to automatically install all dependencies:
npm run setupRun the Ubuntu setup script to automatically install all dependencies:
npm run setup:ubuntuBoth scripts will install:
- Node.js and npm
- MongoDB
- Ollama
- Pull the default codellama model
-
Install Node.js and npm:
sudo pacman -S nodejs npm
-
Install MongoDB:
sudo pacman -S mongodb sudo systemctl start mongodb.service sudo systemctl enable mongodb.service -
Install Ollama:
# Using yay (AUR helper) yay -S ollama # Or download from https://ollama.ai curl -fsSL https://ollama.ai/install.sh | sh
-
Install Node.js and npm:
# Using NodeSource repository (recommended for Node.js 18+) curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs # Or use apt (may have older version) sudo apt-get update sudo apt-get install -y nodejs npm
-
Install MongoDB:
# Install dependencies sudo apt-get install -y wget curl gnupg # Add MongoDB GPG key wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add - # Add MongoDB repository echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list # Install MongoDB sudo apt-get update sudo apt-get install -y mongodb-org # Start MongoDB service sudo systemctl start mongod sudo systemctl enable mongod
-
Install Ollama:
curl -fsSL https://ollama.ai/install.sh | sh
-
Pull a code model:
ollama pull codellama # or ollama pull llama2 -
Install project dependencies:
npm run install:all
-
Configure environment variables:
cp .env.example backend/.env cp .env.example frontend/.env
Edit
backend/.envandfrontend/.envwith your configuration.
For NVIDIA GPU acceleration on Ubuntu/Debian:
bash scripts/install-ollama-gpu-ubuntu.shFor Arch Linux with GPU support:
bash scripts/install-ollama-gpu-arch.shNote: GPU acceleration requires NVIDIA GPU with CUDA toolkit installed.
Start both frontend and backend in development mode:
npm run devOr start them separately:
# Backend only
npm run dev:backend
# Frontend only
npm run dev:frontendCheck if all dependencies are installed and running:
npm run verifyPOST /api/reviews- Upload code file and create reviewGET /api/reviews/:id- Get a specific reviewGET /api/reviews- Get all reviewsPUT /api/reviews/:id- Update a reviewGET /api/health- Health check
hackaton/
├── frontend/ # React application
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ └── utils/
│ └── package.json
├── backend/ # Node.js API
│ ├── src/
│ │ ├── routes/
│ │ ├── controllers/
│ │ ├── services/
│ │ ├── models/
│ │ └── middleware/
│ └── package.json
├── scripts/ # Setup and utility scripts
└── README.md
The backend uses Express.js with MongoDB. Key files:
backend/src/server.js- Express server entry pointbackend/src/routes/reviewRoutes.js- API routesbackend/src/services/ollamaService.js- Ollama integrationbackend/src/models/Review.js- MongoDB schema
The frontend uses React with Vite. Key files:
frontend/src/pages/UploadPage.jsx- File upload interfacefrontend/src/pages/ReviewPage.jsx- Review results displayfrontend/src/components/CodeViewer.jsx- Code display component
- Incremental review (git diff parsing)
- Comment/Reply handling
- Pre-commit evaluation
- Guideline awareness (PEP8, Google Style)
- Automatic fixes
- Modular evaluation (linting, security, architecture)
- Effort estimation for fixes
- Review history per file
ISC