Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Code Review SaaS - Documentation

AI-powered code review platform with public and authenticated modes.

πŸ“š Documentation Index

Getting Started

Technical Documentation

Guides

πŸš€ Quick Start

# 1. Setup environment
make setup

# 2. Configure AI provider
cp .env.example .env
# Add your DIGITALOCEAN_AI_API_KEY

# 3. Start development
make dev

# 4. Visit application
open http://localhost:8080

πŸ“– Project Structure

ai-companion/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Models/              # Eloquent models
β”‚   β”œβ”€β”€ Services/            # Business logic
β”‚   β”‚   β”œβ”€β”€ AI/             # AI provider integration
β”‚   β”‚   β”œβ”€β”€ CodeReview/     # Review processing
β”‚   β”‚   └── Analytics/      # Usage tracking
β”‚   β”œβ”€β”€ Jobs/               # Queue jobs
β”‚   β”œβ”€β”€ Http/Controllers/   # Route handlers
β”‚   └── Actions/            # Reusable actions
β”œβ”€β”€ database/
β”‚   └── migrations/         # Database schema
β”œβ”€β”€ resources/
β”‚   └── js/
β”‚       β”œβ”€β”€ components/     # Vue components
β”‚       β”‚   β”œβ”€β”€ review/    # Code review UI
β”‚       β”‚   β”œβ”€β”€ project/   # Project management
β”‚       β”‚   └── ui/        # shadcn/ui components
β”‚       └── pages/         # Inertia pages
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ web.php            # Web routes
β”‚   └── api.php            # API routes
β”œβ”€β”€ config/
β”‚   └── ai.php             # AI configuration
└── docs/                  # Documentation (this folder)

🎯 Features

Public Mode (MVP - Phase 1)

  • βœ… Anonymous code review submission
  • βœ… Real-time token/cost estimation
  • βœ… AI-powered analysis
  • βœ… Inline comments with severity levels
  • βœ… Security vulnerability detection
  • βœ… Shareable review URLs (7-day expiry)
  • βœ… Rate limiting (5/hour, 10/day)

Authenticated Mode (Phase 2)

  • πŸ”² User registration & authentication
  • πŸ”² Project management (create, organize reviews)
  • πŸ”² Permanent review storage
  • πŸ”² Review history with search
  • πŸ”² Project dashboard with statistics
  • πŸ”² Higher rate limits (50/hour, 200/day)

API & Integration (Phase 3)

  • πŸ”² REST API for CI/CD
  • πŸ”² API token management
  • πŸ”² GitHub Action integration
  • πŸ”² Webhook support

Future Enhancements (Phase 4+)

  • πŸ”² Multiple AI providers (OpenAI, Claude, Gemini)
  • πŸ”² Code suggestions with diff view
  • πŸ”² Export reviews (PDF, Markdown)
  • πŸ”² Advanced analytics
  • πŸ”² Team collaboration
  • πŸ”² Payment integration

πŸ›  Technology Stack

  • Backend: Laravel 12, PHP 8.5
  • Frontend: Vue 3, Inertia.js, TypeScript
  • UI: shadcn/ui, Tailwind CSS 4
  • Database: PostgreSQL 18
  • Cache/Queue: Redis, Horizon
  • Authentication: Laravel Fortify (session + 2FA)
  • AI: Flexible provider system (DigitalOcean, OpenAI, Claude, Gemini)

πŸ“‹ Implementation Phases

Phase Timeline Status Description
Phase 1 Weeks 1-3 🟑 In Progress MVP: Public anonymous reviews
Phase 2 Weeks 4-5 βšͺ Planned Authentication & projects
Phase 3 Weeks 6-7 βšͺ Planned API & GitHub integration
Phase 4 Week 8+ βšͺ Future Enhancements & scaling

πŸ” Security

  • Rate Limiting: IP-based for public, user-based for authenticated
  • Code Sanitization: Input validation, length limits
  • XSS Prevention: Vue auto-escapes output
  • CSRF Protection: Laravel default tokens
  • SQL Injection: Eloquent ORM prevents attacks
  • API Authentication: Laravel Sanctum token-based

πŸ§ͺ Testing

# Run all tests
make test

# Unit tests only
make test --testsuite=Unit

# Feature tests only
make test --testsuite=Feature

# Specific test
make test --filter=PublicReviewTest

# Code formatting
make pint

# Code style check
make pint-test

πŸ“Š Monitoring

Horizon Dashboard

http://localhost:8082/horizon

  • Queue status
  • Job throughput
  • Failed jobs
  • Metrics

Key Metrics

  • Average review processing time
  • Token usage per review
  • Cost per review
  • Error rates by AI provider
  • Queue wait times

🀝 Contributing

Development Workflow

  1. Create feature branch
  2. Implement changes
  3. Write tests
  4. Run code formatter: make pint
  5. Run tests: make test
  6. Create pull request

Code Style

  • Follow PSR-12 for PHP
  • Use Laravel Pint for formatting
  • TypeScript strict mode enabled
  • Vue 3 Composition API preferred

πŸ“ Environment Variables

See .env.example for all available options.

Required:

DIGITALOCEAN_AI_API_KEY=your_api_key
DIGITALOCEAN_AI_BASE_URL=https://api.digitalocean.com/v2/ai
DIGITALOCEAN_AI_MODEL=gpt-oss-120b

Optional:

AI_MAX_CODE_LENGTH=50000
AI_MAX_TOKENS=50000
PUBLIC_REVIEW_EXPIRY_DAYS=7

πŸ› Troubleshooting

Queue not processing

make horizon-status
make queue-restart
make logs-horizon

AI provider errors

# Check logs
docker exec -it ai-companion tail -f storage/logs/laravel.log

# Test connection
docker exec -it ai-companion php artisan tinker
>>> app(\App\Services\AI\AIProviderManager::class)->driver()->isAvailable()

Database issues

make migrate-fresh
make db-cli

πŸ“ž Support

πŸ“„ License

This project is open-sourced software licensed under the MIT license.


Documentation Version: 1.0 (MVP Phase) Last Updated: 2026-02-15 Status: Under Active Development

About

ai review tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages