Skip to content

krishna9358/inspectra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Inspectra

AI-Powered Code Review & Repository Intelligence Platform

Features β€’ Tech Stack β€’ Architecture β€’ Getting Started β€’ Documentation

Next.js 16 React 19 TypeScript Tailwind 4

πŸ“– Overview

Inspectra is an intelligent, AI-powered code review assistant and repository management platform designed to streamline your development workflow. By leveraging advanced LLMs (Google Gemini) and RAG (Retrieval-Augmented Generation) technology with Pinecone vector database, Inspectra provides deep, context-aware insights into your code, automates reviews, and offers comprehensive analytics for your GitHub repositories.

Why Inspectra?

  • πŸ€– Context-Aware AI Reviews: Unlike generic code reviewers, Inspectra indexes your entire codebase to understand project patterns and conventions
  • πŸ”— Deep GitHub Integration: Seamless webhook-based automation for real-time PR reviews
  • πŸ’¬ Automated PR Comments: AI-generated reviews posted directly to your Pull Requests
  • πŸ“Š Rich Analytics: Comprehensive dashboards with contribution graphs and activity metrics
  • ⚑ Background Processing: Inngest-powered async jobs for reliable, scalable operations

✨ Features

πŸ” AI-Powered Code Reviews

  • Automated review generation for Pull Requests using Google Gemini AI
  • RAG-based context retrieval from your indexed codebase via Pinecone
  • Rich feedback including walkthroughs, summaries, issue identification, and suggestions

πŸ”— GitHub Integration

  • OAuth-based authentication via GitHub
  • Multi-repository management with connect/disconnect workflow
  • Webhook automation for real-time PR handling
  • Direct comments and reviews posted to GitHub PRs

🧠 RAG Implementation

  • Automatic codebase indexing using vector embeddings
  • Semantic search across your entire project
  • Context-aware code understanding for accurate reviews

πŸ“Š Dashboard & Analytics

  • Real-time statistics on repositories, commits, and PRs
  • Interactive contribution graphs (GitHub-style activity calendar)
  • Monthly activity breakdowns and trend analysis

πŸ” Authentication & User Management

  • Secure GitHub OAuth via Better Auth
  • Profile management and customization
  • Session handling with automatic token refresh

βš™οΈ Background Processing

  • Inngest-powered async job processing
  • Repository indexing workflows
  • Reliable webhook event handling

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
Next.js 16 React framework with App Router
React 19 UI library with latest features
TypeScript Type-safe development
Tailwind CSS 4 Utility-first styling
shadcn/ui Pre-built accessible components
Radix UI Headless UI primitives
TanStack Query Server state management
Recharts Data visualization
Framer Motion Animations

Backend

Technology Purpose
Next.js API Routes RESTful API endpoints
Server Actions Type-safe server mutations
Prisma ORM Database access layer
PostgreSQL Primary database
Pinecone Vector database for RAG
Inngest Background job processing
Better Auth Authentication system

AI & Machine Learning

Technology Purpose
OpenRouter AI model gateway
Qwen3 Coder LLM for code analysis
Google Gemini Embedding generation
Vercel AI SDK AI integration framework
Pinecone Vector similarity search

Integrations

Technology Purpose
Octokit GitHub API client
GitHub Webhooks Real-time event handling
Zod Schema validation
React Hook Form Form handling

πŸ—οΈ Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              USER BROWSER                                β”‚
β”‚                                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Landing    β”‚  β”‚  Dashboard   β”‚  β”‚ Repository   β”‚  β”‚  Settings   β”‚ β”‚
β”‚  β”‚    Page      β”‚  β”‚    Page      β”‚  β”‚    Page      β”‚  β”‚    Page     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           NEXT.JS APP ROUTER                             β”‚
β”‚                                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚                        API ROUTES                                   β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚ β”‚
β”‚  β”‚  β”‚ /api/auth   β”‚  β”‚/api/webhooksβ”‚  β”‚ /api/inngestβ”‚               β”‚ β”‚
β”‚  β”‚  β”‚ (Better Authβ”‚  β”‚  (GitHub)   β”‚  β”‚  (Jobs)     β”‚               β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚                      SERVER ACTIONS                                β”‚ β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚ β”‚
β”‚  β”‚  β”‚ Repository  β”‚  β”‚  Settings   β”‚  β”‚  Dashboard  β”‚               β”‚ β”‚
β”‚  β”‚  β”‚  Actions    β”‚  β”‚  Actions    β”‚  β”‚  Actions    β”‚               β”‚ β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό               β–Ό               β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚  PostgreSQL  β”‚ β”‚  Pinecone   β”‚ β”‚    Inngest      β”‚
           β”‚  (Prisma)    β”‚ β”‚  (Vectors)  β”‚ β”‚(Background Jobs)β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                    β”‚
                                                    β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚  Google Gemini  β”‚
                                          β”‚   (AI/LLM)      β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow: Repository Connection & Indexing

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  User    │───▢│ Connect    │───▢│  Create     │───▢│   Trigger    β”‚
β”‚  Clicks  β”‚    β”‚ Repository β”‚    β”‚  Webhook    β”‚    β”‚   Inngest    β”‚
β”‚ "Connect"β”‚    β”‚  Action    β”‚    β”‚  on GitHub  β”‚    β”‚    Event     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                            β”‚
                                                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Stored   │◀──│  Upsert    │◀──│  Generate   │◀──│  Fetch All   β”‚
β”‚   in     β”‚    β”‚ to Pineconeβ”‚    β”‚ Embeddings  β”‚    β”‚  Repo Files  β”‚
β”‚ Pinecone β”‚    β”‚  (Batched) β”‚    β”‚ (Google AI) β”‚    β”‚  (Octokit)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow: AI Code Review for Pull Requests

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  GitHub  │───▢│  Webhook   │───▢│ reviewPull- │───▢│  Inngest     β”‚
β”‚    PR    β”‚    β”‚  Handler   β”‚    β”‚  Request()  β”‚    β”‚   Event      β”‚
β”‚  Event   β”‚    β”‚            β”‚    β”‚  Action     β”‚    β”‚ pr.review.*  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                            β”‚
                                                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ fetch-   │───▢│ retrieve-  │───▢│ generate-   │───▢│ post-comment β”‚
β”‚ pr-data  β”‚    β”‚ context    β”‚    β”‚ ai-review   β”‚    β”‚ & save-reviewβ”‚
β”‚ (Octokit)β”‚    β”‚ (Pinecone) β”‚    β”‚ (OpenRouter)β”‚    β”‚ (GitHub/DB)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

inspectra/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/                   # Authentication routes
β”‚   β”‚   └── login/                # Login page
β”‚   β”œβ”€β”€ (dashboard)/              # Protected dashboard routes
β”‚   β”‚   β”œβ”€β”€ dashboard/            # Main dashboard
β”‚   β”‚   β”œβ”€β”€ repository/           # Repository management
β”‚   β”‚   └── settings/             # User settings
β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   β”œβ”€β”€ auth/                 # Better Auth endpoints
β”‚   β”‚   β”œβ”€β”€ inngest/              # Inngest webhook handler
β”‚   β”‚   └── webhooks/github/      # GitHub webhook receiver
β”‚   β”œβ”€β”€ globals.css               # Global styles
β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   └── page.tsx                  # Landing page
β”‚
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ ui/                       # shadcn/ui components
β”‚   └── landing/                  # Landing page components
β”‚
β”œβ”€β”€ inngest/                      # Background job definitions
β”‚   β”œβ”€β”€ client.ts                 # Inngest client
β”‚   └── functions/                # Job functions
β”‚       β”œβ”€β”€ index.ts              # Repository indexing jobs
β”‚       └── review.ts             # AI code review job
β”‚
β”œβ”€β”€ lib/                          # Shared utilities
β”‚   β”œβ”€β”€ auth.ts                   # Better Auth configuration
β”‚   β”œβ”€β”€ db.ts                     # Prisma client
β”‚   β”œβ”€β”€ pinecone.ts               # Pinecone client
β”‚   └── generated/prisma/         # Generated Prisma client
β”‚
β”œβ”€β”€ module/                       # Feature modules
β”‚   β”œβ”€β”€ ai/                       # AI module
β”‚   β”‚   β”œβ”€β”€ actions/              # Server actions
β”‚   β”‚   β”‚   └── index.ts          # reviewPullRequest action
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   β”œβ”€β”€ openrouter.ts     # OpenRouter provider
β”‚   β”‚   β”‚   └── rag.ts            # RAG implementation
β”‚   β”‚   └── prompt.ts             # AI prompt generator
β”‚   β”œβ”€β”€ auth/                     # Auth components & hooks
β”‚   β”œβ”€β”€ dashboard/                # Dashboard components
β”‚   β”œβ”€β”€ github/                   # GitHub integration
β”‚   β”‚   └── lib/
β”‚   β”‚       └── github.ts         # Octokit utilities
β”‚   β”œβ”€β”€ repository/               # Repository management
β”‚   └── settings/                 # Settings management
β”‚
β”œβ”€β”€ prisma/                       # Database schema
β”‚   └── schema.prisma             # Prisma schema definition
β”‚
β”œβ”€β”€ providers/                    # React context providers
β”œβ”€β”€ public/                       # Static assets
└── docs/                         # Documentation

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or later, LTS recommended)
  • Bun (recommended) or npm/pnpm
  • PostgreSQL database
  • GitHub Account with OAuth App credentials
  • Google AI (Gemini) API Key
  • Pinecone API Key and Index

Environment Variables

Create a .env file in the root directory:

# Database
DATABASE_URL="postgresql://user:password@host:5432/database?sslmode=require"

# Better Auth
BETTER_AUTH_SECRET="your-secret-key"
BETTER_AUTH_URL="http://localhost:3000"

# GitHub OAuth
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"

# AI & Vector Database
GOOGLE_API_KEY="your-google-ai-api-key"
OPENROUTER_API_KEY="your-openrouter-api-key"
PINECONE_DB_API_KEY="your-pinecone-api-key"

# Application
NEXT_PUBLIC_APP_BASE_URL="http://localhost:3000"

Installation

  1. Clone the repository

    git clone https://github.com/krishna9358/inspectra.git
    cd inspectra
  2. Install dependencies

    bun install
    # or
    npm install
  3. Set up the database

    npx prisma generate
    npx prisma db push
  4. Start the development server

    bun run dev
  5. Start Inngest Dev Server (in a separate terminal)

    npx --ignore-scripts=false inngest-cli@latest dev
  6. Open http://localhost:3000 to view the application.


πŸ“š Documentation

Detailed documentation is available in the /docs directory:


πŸ§ͺ Development

Available Scripts

Script Description
bun run dev Start development server
bun run build Build for production
bun run start Start production server
bun run lint Run ESLint
bun run test Run tests
bun run prettier Format code

Running Tests

bun run test

🀝 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❀️ by Krishna Mohan

About

Inspectra is an intelligent, AI-powered code review assistant and repository management platform designed to streamline your development workflow.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages