An AI-powered SaaS platform that automates Pull Request (PR) reviews using static code analysis + LLM-based insights, built with a production-grade architecture.
- β Static Code Analysis (AST + Complexity)
- π€ AI Code Review (LLM suggestions)
- π GitHub PR Integration (auto comments)
- π Dashboard for PR analytics
- π JWT Authentication & API Keys
- π Usage Limits (Free / Pro tiers)
- β‘ Async Processing with Celery
- FastAPI
- Celery + Redis
- MongoDB
- Next.js
- Tailwind CSS
- OpenAI API
- Radon (Cyclomatic Complexity)
- Python AST
- Docker & Docker Compose
- Ngrok (Webhook testing)
backend/
βββ analysis_engine/
βββ auth/
βββ celery_apps/
βββ config/
βββ db_services/
βββ github_service/
βββ schemas/
βββ main.py
frontend/
docker-compose.yml
git clone https://github.com/YOUR_USERNAME/ai-code-reviewer.git
cd ai-code-reviewercd backend
python -m venv .venv
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windowspip install -r requirements.txtIf no requirements file:
pip install fastapi uvicorn pymongo python-dotenv celery redis passlib[bcrypt] python-jose requests PyGithub radon openaiCreate .env inside backend/:
OPENAI_API_KEY=your_openai_key
GITHUB_TOKEN=your_github_token
SECRET_KEY=your_secret_keyFrom project root:
docker compose up -dThis starts:
- MongoDB
- Redis
cd backend
uvicorn main:app --reloadAccess API:
http://127.0.0.1:8000/docs
Open new terminal:
cd backend
celery -A celery_apps.celery_app worker --loglevel=infocd frontend
npm install
npm run devAccess frontend:
http://localhost:3000
ngrok http 8000Copy URL like:
https://abcd1234.ngrok-free.app
Go to:
Repo β Settings β Webhooks β Add Webhook
Set:
Payload URL:
https://YOUR_NGROK_URL/webhook/github
Content type:
application/json
Events:
Pull Request (opened)
Match this in backend:
GITHUB_SECRET = "webhook_secret"GitHub PR Created
β
Webhook Triggered
β
FastAPI Receives Event
β
Celery Task Queued (Redis)
β
Fetch PR Files
β
Static Analysis (AST + Radon)
β
AI Review (LLM)
β
Store Results (MongoDB)
β
Post Comment to GitHub PR
β
Display in Dashboard
βββββββββββββββββ
β GitHub PR β
ββββββββ¬βββββββββ
β Webhook
βΌ
ββββββββββββββββββββ
β FastAPI API β
ββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββ
β Celery β
β Worker β
ββββββββ¬βββββββββ
β
βββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
Static AI Review GitHub API
Analysis (LLM) (Comments)
β β β
ββββββββ¬βββββ΄βββββββββββββ
βΌ
MongoDB
βΌ
Dashboard (Next.js)
- Swagger UI β
/docs
- Signup β Login β Use JWT
- Use Ngrok
- Create PR β see logs + comments
| Endpoint | Description |
|---|---|
| POST /auth/signup | Register user |
| POST /auth/login | Login |
| POST /auth/register-repo | Add repo |
| GET /dashboard/my-prs | User PRs |
| GET /dashboard/analytics | Usage stats |
| POST /webhook/github | GitHub webhook |
- Multi-tenant support
- CI/CD pipeline
- Kubernetes deployment
- Advanced ML risk scoring
- Team collaboration features
Bishal Bhandari
Give it a star β and share feedback!