Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoReview Hub

Production-oriented hackathon project named AutoReview Hub.
It accepts a GitHub repository URL, runs multi-engine code review, and returns structured findings plus a markdown report through both API and browser UI.

Why This Project

Developers lose time in manual first-pass reviews for recurring issues (logging, exception handling, risky patterns, unfinished TODOs, etc.). This project automates that first pass and aggregates model perspectives into one actionable report.

What It Does

  • Reviews a public GitHub repository directly from URL
  • Uses multiple reviewer engines:
    • heuristic-baseline (always on)
    • openai (enabled when OPENAI_API_KEY is present)
    • anthropic (enabled when ANTHROPIC_API_KEY is present)
  • Produces:
    • Per-model findings
    • Cross-model consensus findings
    • Export-ready markdown summary
  • Includes browser dashboard at / with:
    • Severity filtering
    • Text search across findings
    • Top 5 critical findings
    • Export buttons (JSON, Markdown)

Tech Stack

  • Python 3.12+
  • FastAPI + Uvicorn
  • Pydantic / Pydantic Settings
  • OpenAI Python SDK
  • Anthropic Python SDK
  • Vanilla HTML/CSS/JS frontend
  • Pytest

Project Structure

Hackathon/
  app/
    api/routes/review.py
    core/config.py
    llm/
      base.py
      heuristic_reviewer.py
      openai_reviewer.py
      anthropic_reviewer.py
    models/
      domain.py
      schemas.py
    prompts/templates.py
    services/
      provider_factory.py
      repository_service.py
      review_orchestrator.py
      report_builder.py
    static/
      css/app.css
      js/app.js
    web/index.html
    utils/json_parser.py
    main.py
  tests/
    test_heuristic_reviewer.py
    test_openai_reviewer.py
    test_report_builder.py
    test_web_ui.py
  requirements.txt
  .env.example
  .env
  README.md
  DESIGNDOC.md

Quick Start

  1. Create and activate virtual environment:
cd /home/turtle-hermit/Hackathon
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
python -m pip install -r requirements.txt
  1. Prepare env file:
cp .env.example .env
  1. Add keys in .env (optional for cloud reviewers):
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-3.5-turbo

ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-3-5-sonnet-latest
  1. Run server:
python -m uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

How To Test

1) Health Check

python -c "import urllib.request;print(urllib.request.urlopen('http://127.0.0.1:8000/health').read().decode())"

Expected:

{"status":"ok"}

2) API Test

python -c "import json,urllib.request;data=json.dumps({'repository_url':'https://github.com/tiangolo/fastapi','max_files':8}).encode();req=urllib.request.Request('http://127.0.0.1:8000/api/v1/review',data=data,headers={'Content-Type':'application/json'});print(urllib.request.urlopen(req,timeout=300).read().decode())"

3) UI Test

Open:

http://127.0.0.1:8000/

Submit repository URL and inspect:

  • Run Summary
  • Top 5 Critical Findings
  • Consensus Findings
  • Model Reviews
  • Markdown Report

4) Unit Tests

python -m pytest -q

API Reference

POST /api/v1/review

Request body:

{
  "repository_url": "https://github.com/owner/repo",
  "branch": "main",
  "max_files": 12
}

Response fields:

  • repository_url
  • branch
  • analyzed_files
  • analyzed_models
  • model_reviews[]
  • consensus_issues[]
  • markdown_report

Model Behavior Notes

  • If no API keys are configured, app still works via heuristic-baseline.
  • OpenAI reviewer includes fallback model strategy for account compatibility.
  • Unsupported or inaccessible models degrade gracefully and return structured errors per file.

Troubleshooting

  • ModuleNotFoundError: fastapi:
    • Ensure virtual env is active and run with python -m uvicorn ...
  • Models used: 1:
    • Verify API key exists in .env
    • Restart server after env edits
  • OpenAI model invocation errors:
    • Ensure key has API access and billing enabled
    • Use OPENAI_MODEL=gpt-3.5-turbo if unsure

Security Notes

  • Never commit .env with real keys.
  • Rotate any key that was accidentally shared or pasted publicly.
  • Treat repository content as sensitive when reviewing private code.

Design Document

Full architecture and engineering decisions:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages