CASE 03Enterprise AI · Distributed Systems · Next.js 16

AI Code Reviewer — Enterprise Git Intelligence Platform

Built with Next.js 16 (App Router + Turbopack), React 19, TypeScript, PostgreSQL (Prisma), BullMQ & Redis, and Tailwind CSS v4. Features automated PR reviews via cryptographic GitHub App webhooks, dual-depth engineering perspectives (Balanced vs. Maximum DSA/Big-O analysis), two-tier Redis caching, multi-tenant team quality dashboards, and comprehensive enterprise hardening.

RoleFull-Stack Systems Engineer & AI Architect
Timeline / Year2025
Domain / FocusDeveloper Productivity Platform
Core TechnologiesNext.js 16 · React 19 · TypeScript
Project Contributors & Engineering Leadership
Aleksandar KuzmanovicLead Full-Stack Architect & Cloud Systems Lead · Performance, Development, Web Design & SEO/GEO Specialist
Luka StefanovicPrincipal AI & Data Science Lead · Applied Mathematics, AI & Data Science Lead
ai-code-reviewer---enterprise-git-intelligence-platform.sys
CASE 03
AI Code Reviewer interactive review report interface
01 / The Architectural Challenge

Overcoming production bottlenecks and scalability constraints.

Automated linters only catch superficial syntax issues, while human code reviews struggle to consistently detect subtle architectural degradation, algorithmic complexity bottlenecks (O(n²) traps), OWASP security vulnerabilities, and cross-repo anti-patterns under tight delivery deadlines.

02 / The Engineering Solution

Engineered with disciplined primitives and modern runtimes.

Architected a distributed async review engine powered by BullMQ and Redis with PostgreSQL job persistence. Integrated multi-provider Git authentication (GitHub, GitLab, Bitbucket, Google, Argon2id), dual-depth analysis (Balanced ~1 min vs. Maximum ~2–5 min DSA/complexity analysis), signature-verified GitHub App webhooks with Checks API gating, two-tier commit SHA caching, and URL-synchronized interactive report hubs.

03 / Technical Architecture

Decisions made for durability, zero lock-in, and throughput.

FEATURE // 01

Dual-Depth Engineering Perspectives & Algorithmic DSA Analysis

Enables developers to select analysis depth: Balanced Depth (~1 min) for rapid PR architecture, security, and maintainability; Maximum Depth (~2–5 min) for advanced Data Structures & Algorithms, Big-O asymptotic complexity, and low-level performance traps.

FEATURE // 02

Signature-Verified GitHub App & Pull Request Automation

Cryptographic HMAC webhook handler (X-Hub-Signature-256) on POST /api/webhooks/github. Automatically enqueues PR reviews, posts sticky markdown comments, and registers GitHub Check Runs that fail on High/Critical findings.

FEATURE // 03

Distributed BullMQ Queue & Two-Tier Review Caching

Decoupled worker queue on Redis with PostgreSQL job persistence. Byte-identical reviews are cached by commit SHA: Tier-1 (enqueue-time) returns instant HTTP 202 (cost: 0) without hitting the queue, while Tier-2 (worker-time) refunds credits on default branch cache hits.

FEATURE // 04

Teams, Multi-Tenancy & 90-Day Quality Dashboards

Zero data leakage ensures personal reviews never appear on team boards. Features RBAC (owner, admin, member), 7-day expiring email invites, weekly ISO quality trend charts, and team-scoped API keys with automated review stamping.

FEATURE // 05

Enterprise Hardening & Anti-DoS Security Architecture

Enforces strict 2MB raw webhook limits (HTTP 413 anti-DoS), SSRF file path restrictions with origin allowlists, PostgreSQL partial unique index concurrency locks (ReviewJob_one_active_per_user_key), Pino sensitive data redaction, and a public /api/health probe.

Distributed Execution Topology

Architecture & request flows.

Asynchronous BullMQ worker queue on Redis with PostgreSQL idempotency guarantees, two-tier commit SHA caching, and GitHub Checks API gating.

[ Browser / CI / Webhook ]
            │
            ▼
    [ Next.js 16 App Router ] ── (Edge Middleware: Auth / Route Guards)
            │
            ├─► [ lib/server/requestAuth.ts ] ── (Session Cookie OR Bearer API Key)
            ├─► [ lib/server/reviews.ts ] ────── (Idempotency & Concurrency Check)
            │         │
            │         ├─► [ Redis Cache ] (Tier-1 Enqueue Cache Hit ──► Fast 202 cost:0)
            │         └─► [ PostgreSQL / Prisma ] (Reserve Credits & Create Job)
            │                   │
            │                   ▼
            └─► [ BullMQ Queue (Redis) ]
                        │
                        ▼
            [ Worker Process (scripts/worker.ts) ]
                        │
                        ├─► Git Provider API (GitHub / GitLab / Bitbucket)
                        ├─► AI Review Pipeline (LLM Analysis & AST Diffing)
                        ├─► Credit Ledger (Idempotent Settlement / Refund)
                        └─► PostgreSQL (Save Report & summaryScore)
Analysis Modes

Dual-depth engineering perspectives.

PerspectiveSpeed BenchmarkCore FocusRecommended Use Cases
Balanced Depth (Default)~1 minuteArchitecture, security vulnerabilities (OWASP), maintainability, test coverage, and modern best practices.Daily PR reviews, CI check runs, continuous iterations.
Maximum Depth~2–5 minutesAdvanced Data Structures & Algorithms (DSA), Big-O asymptotic complexity, low-level performance traps, and system design flaws.Pre-release security audits, legacy codebase refactors, mission-critical infrastructure.
Visual System Architecture // 09 Production Interfaces

Production interfaces & workflow engine.

Direct high-resolution captures across automated PR reviews, multi-tenant quality dashboards, BullMQ worker queues, and security hardening controls.

ai.sys // landing-image
01 / 09
Landing page & Product Overview
Scroll Capture ↓
Product Overview

Landing page & Product Overview

Landing page with product overview, feature highlights, and call-to-action for enterprise Git intelligence platform.

Raw Asset↗
04 // Quantifiable Impact

Measured by results.

Processes asynchronous multi-file pull request reviews in under 45 seconds with zero timeouts, automated GitHub Checks API gating, two-tier commit caching, and seamless multi-provider Git integration.

<45s
Turnaround
GitHub / GitLab / Bitbucket
Git Hosts
BullMQ + Redis
Queue Engine