Paste code. Get clarity.
Structured reviews, optimized code, and explanation depth that adapts to the developer reading it.
Overview | Sneak Peek | Why It Feels Different | Experience Flow | Quick Start | Project Structure
CodeSage AI is a modern code review experience built with Next.js. It is designed for developers who want feedback that is fast, readable, and actionable instead of noisy or vague.
Drop in a snippet, choose your language, pick the explanation level, and CodeSage AI returns:
- a summary of code quality
- detected issues with severity
- improvements worth making
- an optimized version of the submitted code
- a clear explanation matched to the chosen level
The goal is simple: make code review feel less like a wall of text and more like a guided workspace.
|
The result is organized into clear sections instead of a single messy response block. |
Beginner, intermediate, and advanced modes make the same review readable for different developers. |
If the AI response is weak or incomplete, the backend repairs it or falls back locally. |
Landing Page -> Review Workspace -> AI Review -> Repair Pass if Needed -> Clean Result
\
-> Local Fallback if Provider Fails
- Open the intro page.
- Enter the review workspace.
- Paste a code snippet into the Monaco editor.
- Select a language and explanation level.
- Run the review.
- Inspect issues, improvements, optimized code, and explanation.
- Copy the optimized code directly from its section.
- dedicated intro page on
/ - focused review workspace on
/review - organized result cards for quick scanning
- cleaner UI for summary, issues, improvements, and explanation
- Groq-powered structured code review
- JSON-shaped responses
- explanation completeness checks
- optimized code repair logic for common AI misses
- local fallback review when provider output is unavailable
- Monaco editor integration
- language selection
- explanation depth selection
- copy action for optimized code only
- resilient API route for incomplete AI output
| Level | Style |
|---|---|
beginner |
Foundational guidance and simpler explanations |
intermediate |
Balanced practical feedback |
advanced |
Sharper technical detail and engineering-focused explanation |
{
"summary": "The function has a runtime bug caused by an undefined variable.",
"score": 5,
"issues": [
{
"line": 1,
"message": "Undefined variable 'n'. Expected 'b' but got 'n'.",
"severity": "high"
}
],
"improvements": [
"Fix the incorrect variable reference.",
"Add simple tests for expected inputs."
],
"optimizedCode": "function add(a, b) {\n return a + b;\n}",
"explanation": "The updated function replaces the undefined variable with the intended parameter so the code behaves correctly."
}npm installCreate .env.local in the project root:
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=llama-3.1-8b-instantnpm run devOpen http://localhost:3000.
npm run dev
npm run build
npm run start
npm run lint
npm run format| Layer | Technology |
|---|---|
| Framework | Next.js 16 |
| UI | React 19 |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| Editor | Monaco Editor |
| Validation | Zod |
| AI Provider | Groq API |
src/
app/
page.tsx
review/
page.tsx
api/
review/
route.ts
components/
editor/
CodeEditor.tsx
lib/
ai/
aiClient.ts
fallbackReview.ts
promptBuilder.ts
validators/
reviewResponse.schema.ts
public/
CodeSage-AI.png
codesage-mark.svg
- polished intro page before entering the tool
- dedicated review workspace
- structured and readable review results
- optimized-code copy action inside the relevant section
- improved repair path for incomplete AI outputs
- local fallback behavior that keeps the app usable
- Groq is the current primary provider.
- When the AI response is partial, CodeSage AI attempts to repair weak fields before falling back.
- The fallback layer is designed to protect the UX instead of failing hard.
This project is licensed under the MIT License.