Skip to content

Lagani21/tapaso

Repository files navigation

Tapaso

Automated PR Quality Verification System

Tapaso analyzes pull requests by running code in isolated Daytona sandboxes and fetching AI code reviews from CodeRabbit.


Features

  • 🔒 Isolated Testing - Run tests safely in Daytona sandboxes
  • 🐰 AI Code Review - Fetch CodeRabbit reviews via GitHub API
  • 📊 Quality Scoring - Combined score from tests + code review
  • 🔍 Error Tracking - Sentry integration for monitoring
  • 🚀 Multi-Project Support - Node.js, Python, HTML projects

Quick Start

Prerequisites

1. Clone & Configure

git clone https://github.com/Lagani21/tapaso.git
cd tapaso
cp .env.example .env

Edit .env:

DAYTONA_API_KEY=your_daytona_key
GITHUB_REPO=owner/repo
GITHUB_TOKEN=github_pat_xxx
SENTRY_DSN=https://xxx@sentry.io/xxx  # Optional

2. Install Dependencies

# Backend
cd backend && npm install && cd ..

# Python
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Frontend
cd frontend && npm install && cd ..

3. Run

# Terminal 1: Backend
cd backend && npm run dev

# Terminal 2: Frontend
cd frontend && npm run dev

Open http://localhost:3000


Project Structure

tapaso/
├── backend/                 # Express.js API (port 4000)
│   ├── server.js
│   └── services/
│       ├── coderabbit.js   # GitHub API integration
│       └── sentry.js       # Error tracking
│
├── frontend/                # Next.js app (port 3000)
│   └── src/
│       ├── app/            # Pages & API routes
│       ├── components/     # React components
│       └── lib/            # Utilities & API client
│
├── daytona-integration/     # Python verification
│   ├── src/
│   │   ├── daytona_client.py
│   │   └── pr_verifier.py
│   └── scripts/
│       └── run_verifications.py
│
├── docs/                    # Documentation
└── data/                    # Sample data

API Endpoints

Method Endpoint Description
GET /api/health Service status
POST /api/check-repo Validate GitHub repo
POST /api/verify-pr Run full verification
GET /api/coderabbit/review/:owner/:repo/:pr Get CodeRabbit review

Example: Verify a PR

curl -X POST http://localhost:4000/api/verify-pr \
  -H "Content-Type: application/json" \
  -d '{
    "owner": "Lagani21",
    "repo": "Sample_website",
    "pr_number": 1,
    "branch": "main",
    "developer_email": "dev@example.com"
  }'

How Scoring Works

Source Weight Calculation
Sandbox Tests 60% 100 - (errors × 10) - (failures × 40)
CodeRabbit 40% 100 - (critical × 25) - (warnings × 10)

Score Badges:

  • 🟢 90-100: Excellent
  • 🔵 75-89: Good
  • 🟡 60-74: Fair
  • 🟠 40-59: Needs Work
  • 🔴 0-39: Critical

Configuration

CodeRabbit Setup

  1. Install CodeRabbit GitHub App
  2. The .coderabbit.yaml file configures review behavior
  3. Reviews are fetched via GitHub API using your GITHUB_TOKEN

Sentry Setup (Optional)

  1. Create project at sentry.io
  2. Add SENTRY_DSN to .env
  3. Errors are automatically tracked

Development

Run Tests

# Test backend
./test-backend.sh

# Test Python directly
source venv/bin/activate
python daytona-integration/scripts/run_verifications.py \
  --pr-number 1 --branch main --repo owner/repo

Add New Project Type

Edit daytona-integration/src/pr_verifier.py:

def _detect_project_type(self, sandbox):
    if sandbox.process.exec("ls your_config").exit_code == 0:
        return "your_type"

def _run_tests(self, sandbox, project_type):
    if project_type == "your_type":
        # Your test logic

Documentation


Tech Stack

  • Frontend: Next.js, TypeScript, Tailwind CSS
  • Backend: Express.js, Node.js
  • Verification: Python, Daytona SDK
  • Integrations: Sentry, CodeRabbit (via GitHub API)

License

MIT


Built with Daytona 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •