Skip to content

ahmadmustafa02/CodePulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

50 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ CodePulse

AI code review that learns your team's mistakes β€” and helps them stop repeating them.

Live App GitHub License

TypeScript React Node.js PostgreSQL Prisma Groq Azure Vercel


codepulse2 codepulsedashboard digest

🎯 The pitch

CodeRabbit reviews your PR. CodePulse reviews your habits.

Install once on GitHub, pick your repos, and open a pull request. CodePulse reviews the diff inline like a senior engineer would β€” pinned to exact lines, with severity labels β€” then quietly remembers every issue against the developer who wrote it.

Every Week, each developer gets a personalized digest: "You introduced 3 SQL injection patterns this week. Here's how to stop."


✨ What it does

πŸ€– Automatic PR reviews Triggered on opened, synchronize, and reopened. Inline comments pinned to exact lines with Critical / High / Medium / Low severity labels.
🧠 Two-pass AI analysis File triage first, then chunked deep review. Groq + Llama 3.3 70B with structured tool-calling returns typed JSON per issue.
πŸ“Š Per-developer pattern tracking Every issue is stored against the developer who wrote it, across every PR, forever. The longer you use it, the sharper it gets.
πŸ“¬ Weekly personalized digests Weekly emails surface recurring mistakes per developer with concrete fixes. Powered by Resend.
πŸ“ˆ Team dashboard PR volume, review latency, connected repos, severity trends, category breakdown, file-level hotspots.
πŸ”’ Multi-tenant isolation Scoped per GitHub App installation β€” each org's data is fully isolated.
πŸ›‘οΈ Signed webhooks HMAC-SHA256 verification on every event. Lockfiles, minified assets, and generated files are skipped automatically.

πŸ—οΈ Architecture

                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚      GitHub PR opened        β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                      β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚  Webhook (HMAC-SHA256 βœ“)     β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                      β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚  Express Β· Fetch diff        β”‚
                       β”‚  Parse unified diff format   β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                      β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚  Groq Β· Llama 3.3 70B        β”‚
                       β”‚  Structured tool-calling     β”‚
                       β”‚  β†’ typed JSON per issue      β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β–Ό                                       β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  GitHub REST API         β”‚          β”‚  PostgreSQL (Neon)       β”‚
   β”‚  Inline review comments  β”‚          β”‚  Per dev Β· per repo Β· PR β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                        β”‚
                                                        β–Ό
                                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                         β”‚ GitHub Actions (schedule)β”‚
                                         β”‚ Weekly trigger           β”‚
                                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       β”‚
                                                       β–Ό
                                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                         β”‚ Digest API endpoint      β”‚
                                         β”‚ Aggregate β†’ Build digest β”‚
                                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       β”‚
                                                       β–Ό
                                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                         β”‚ Email pipeline (Resend)  β”‚
                                         β”‚                          β”‚
                                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Webhooks hit the API on Azure directly. The Vercel frontend proxies /api/v1/* to the backend, keeping session cookies same-origin so sign-in works without third-party cookie headaches.


πŸ› οΈ Tech stack

Backend

  • Node.js Β· Express Β· TypeScript
  • Prisma ORM
  • PostgreSQL (Neon serverless)
  • Groq API (Llama 3.3 70B)
  • Octokit
  • Resend
  • Azure App Service

Frontend

  • React Β· TypeScript
  • Tailwind CSS
  • Recharts
  • Vercel

Infrastructure

  • GitHub App (webhook + bot)
  • GitHub OAuth (sign-in)
  • Scheduled digest trigger via GitHub Actions
  • HMAC-SHA256 signature verify

βš™οΈ Key Engineering Challenges

  • Mapping GitHub diff hunks to absolute file line numbers reliably across multi-commit PR updates
  • Structuring LLM outputs into strict JSON to eliminate parsing ambiguity
  • Preventing duplicate or noisy review comments across webhook retries
  • Designing per-developer attribution logic from Git commit metadata across forks and rebases

πŸš€ Getting started

Prerequisites

1 Β· Clone & install

git clone https://github.com/ahmadmustafa02/CodePulse
cd CodePulse

cd server && npm install
cd ../web && npm install

2 Β· Configure the server

cd server
cp .env.example .env
# Fill in your values (see env vars table below)
npx prisma migrate deploy
npm run dev

Server runs at http://localhost:3001

3 Β· Configure the web app

cd web
cp .env.example .env.local
npm run dev

Dashboard runs at http://localhost:3000

4 Β· GitHub setup

Local Production
OAuth callback http://localhost:3001/api/v1/auth/github/callback https://your-api-host/api/v1/auth/github/callback
Webhook URL ngrok β†’ /api/v1/webhooks/github https://your-api-host/api/v1/webhooks/github
Webhook events Pull request Pull request

Minimum GitHub App permissions

Permission Access
Repository metadata Read
Contents Read
Pull requests Read & write

5 Β· Verify the full pipeline

  1. Sign in with GitHub at localhost:3000
  2. Install the GitHub App on a test repository
  3. Confirm the repo appears under Connected Repositories
  4. Open a PR with a real code change (not just lockfiles)
  5. Watch for inline review comments within 1–3 minutes
  6. Refresh the dashboard β€” the PR appears under Recent Reviews

πŸ’‘ Debugging tip: Check GitHub β†’ App β†’ Advanced β†’ Recent Deliveries for 202 responses to confirm webhooks are reaching the server.


πŸ” Environment variables

Server Β· server/.env
Variable Description
DATABASE_URL Neon / PostgreSQL connection string
GITHUB_APP_ID GitHub App ID
GITHUB_PRIVATE_KEY App private key (PEM, \n escaped)
GITHUB_WEBHOOK_SECRET Webhook secret (min 20 chars)
GITHUB_OAUTH_CLIENT_ID OAuth App client ID
GITHUB_OAUTH_CLIENT_SECRET OAuth App client secret
GITHUB_OAUTH_CALLBACK_URL Must match OAuth app settings exactly
GROQ_API_KEY Groq API key
AUTH_SECRET Session JWT signing secret (min 32 chars)
WEB_APP_URL Frontend origin for CORS and redirects
RESEND_API_KEY Resend API key
DIGEST_FROM_EMAIL Sender address for digest emails
DIGEST_CRON_SECRET Protects the digest trigger endpoint
Web Β· web/.env.local
Variable Description
AUTH_SECRET Must match server AUTH_SECRET
AUTH_GITHUB_ID OAuth App client ID
AUTH_GITHUB_SECRET OAuth App client secret
VITE API base URL (http://localhost:3001/api/v1 locally)

πŸ“œ Scripts

# ── Server ────────────────────────────────
npm run dev         # nodemon + ts-node
npm run build       # compile TypeScript
npm run start       # node dist/index.js
npm run lint
npm run typecheck

# ── Web ───────────────────────────────────
npm run dev         # react dev server
npm run build       # production build
npm run lint

☁️ Deployment

Layer Host
Frontend Vercel
API Azure App Service
Database Neon PostgreSQL
Cron Github Actions

⚠️ Webhooks must point to the API host directly β€” never the Vercel frontend URL.


Built for teams who want code review that compounds.

Not another noisy bot.


⭐ If CodePulse is useful to you, star the repo β€” it helps a lot.

Live App Β· Report a bug Β· Request a feature

About

automatic PR reviews on GitHub, inline feedback, per-developer mistake patterns, and weekly learning digests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors