🤖 Automated PR Auditing (Overview)
Think of EightBit AI Reviewer as a senior software engineer who is on call 24/7, ready to review your code the second you save it.
Every time you open a Pull Request (PR) or push updates to GitHub, EightBit instantly reads your changes, spots logic bugs, highlights security vulnerabilities, and suggests performance improvements.
Unlike other AI tools that charge expensive subscriptions or store your proprietary code on their servers, EightBit empowers developers with a "Bring Your Own Key" (BYOK) model. You plug in your own Google Gemini API key, giving you total ownership of your data, complete privacy, and direct control over AI costs.
⚙️ The Review Lifecycle (How It Works)
Here is a simple visual flow of what happens behind the scenes from the moment you save your code to getting feedback:
- The Webhook Trigger: The moment you create a Pull Request or push a commit, GitHub fires a secure webhook notification to EightBit's FastAPI server.
- Signature Verification: The server verifies the signature of the webhook to ensure it is authentic and hasn't been tampered with.
- Background Review Task: Instead of keeping GitHub waiting, the server immediately accepts the event and spawns a background review task.
- Key Decryption: The server retrieves your Gemini API key from the database and decrypts it in-memory. The key is encrypted using AES-256 (Fernet) so it is never stored in plain text.
- Diff Extraction: It pulls the exact code differences (the "diff") from the GitHub API.
- Gemini Analysis: The code diff and your custom persona instructions (like a strict auditor or friendly mentor) are sent to your chosen Gemini model.
- Commenting Back: Gemini produces structured, actionable feedback which is posted directly back to the GitHub PR or commit as comments.
⚡ Deep Integration (Core Features)
- Double-Layered PR Feedback: Receive both a high-level PR Quality Report (highlighting merge readiness, risk levels, complexity, and performance) and granular line-by-line code reviews.
- Bring Your Own Key (BYOK): Use your own Google Gemini API key. Pay only for the tokens you actually consume, with zero markup or hidden platform fees.
- Bank-Grade Encryption: Your API keys are encrypted with AES-256. The server-edge environment handles decryption, meaning your raw credentials never touch the database.
- Custom AI Personas: Set custom system prompts to align the AI's tone and rules with your engineering standards. Make it act as a strict reviewer, a helpful mentor, or follow custom guidelines.
- Retro-Tech Dashboard: A beautifully designed 8-bit styling console to monitor logs, manage repository status, and check active reviews in real time.
🛠️ The Automation Stack (Technologies)
- FastAPI (Python): Fast, asynchronous backend that processes webhooks and handles heavy background jobs concurrently.
- React & TypeScript: Renders the responsive, highly stylized retro-tech user interface.
- PostgreSQL: Reliable database storing encrypted credentials and historical logs.
- Google Gemini API: The cognitive core of the app, using advanced Gemini models for code reasoning.
🛡️ Webhook Constraints & Persona Alignment (Challenges)
- Secure Key Storage: Implementing the AES-256 cryptography flow required using Fernet. I learned how to separate the encryption keys from database backups to prevent leaks.
- Asynchronous Flow Control: Webhooks must respond to GitHub within 10 seconds. Spawning background tasks in FastAPI kept the webhook handler extremely responsive under heavy loads.
- Prompt Reliability: Designing system instructions to get Gemini to output consistent, structured Markdown results without generating repetitive reviews.
🎯 Elevating Code Quality (Conclusion)
EightBit AI Reviewer bridges the gap between high-performance automated tools and absolute developer privacy. By utilizing the BYOK model and custom reviewer personalities, teams get deep, cost-effective code analysis on their own terms. It's a secure, future-proof assistant that grows with your codebase.