This project was implemented for the Software Engineering Internship assignment, built with Codex using GPT-5.5 (Medium).
The prompts used can be found in PROMPTS.md.
- Structured AI code review with actionable feedback
- Covers multiple aspects of code quality (correctness, security, maintainability, performance, style, documentation, and other)
- Each issue is annotated with an explanation, suggestion, severity, confidence level, and source code position
- Overall rating and summary of the review
- Persistent review storage
- Follow-up chat for follow-up questions and iterative review
- User submits code
- Backend sends code and system prompt to the LLM
- LLM returns structured review in a JSON schema
- Review is stored and displayed
- User can use the chat to ask follow-up questions or provide additional context
Example of the structured review feedback returned by the LLM:
{
"summary": "...",
"rating": 7.5,
"issues": [
{
"type": "correctness",
"severity": "high",
"message": "...",
"suggestion": "...",
"confidence": "high",
"location": { "line": 12, "column": 5 }
}
]
}- Frontend (React, Vite, Worker Static Assets): user interface to paste code, view review results, manage sessions, and chat about a review
- Backend (Cloudflare Worker): handles API requests, validates payloads, calls the LLM, and stores/retrieves sessions
- LLM (Workers AI, Llama 3.3): performs code analysis and generates structured feedback
- Database (Cloudflare KV): stores reviews
- Client Storage (Local Storage): stores session id (for indexing in KV) and user preferences
flowchart LR
Start(( )) --> Frontend
Frontend --> CW["Cloudflare Worker"]
CW --> WAI["Workers AI"]
WAI --> Llama["Llama 3.3"]
CW --> KV["Cloudflare KV"]
Frontend --> LS["Local Storage"]
This app is deployed on Cloudflare Workers and can be accessed at:
https://ai-code-reviewer.r1c4rdco5t4-f9d.workers.dev
Requirements:
- Node.js
- npm
- A Cloudflare account
Clone and install dependencies:
git clone https://github.com/rcosta358/cf_ai_code_reviewer
cd cf_ai_code_reviewer/app
npm installYou can set the VITE_USE_MOCK_REVIEW variable in .env.development to true to use a mock review response without calling Workers AI, which is useful for development without consuming AI credits.
Then, login to your Cloudflare account and create a new Cloudflare KV namespace:
npx wrangler login
npx wrangler kv namespace create SESSIONS_KVThen, update wrangler.jsonc with the generated KV namespace id.
Finally, run the development server and open the app in your browser at http://localhost:5173:
npm run devTo deploy the app to Cloudflare Workers, run:
npm run deploy