Full-stack AI developer assistant using Gemini API to perform automated security audits, code refactoring, and unit test generation.
Tick off requirements as you build to track real-time completion.
Follow this chronological guide to build the project from scratch.
Initialize @google/genai SDK in app/api/review/route.ts to output audited code findings strictly in JSON format.
import { GoogleGenAI } from '@google/genai';
import { NextRequest, NextResponse } from 'next/server';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const SYSTEM_INSTRUCTION = `
You are an expert security auditor. Analyze the submitted code snippet.
You MUST output a valid JSON object matching this schema:
{
"rating": "A" | "B" | "C" | "D" | "F",
"vulnerabilities": [{"line": number, "severity": "high"|"medium"|"low", "desc": string}],
"refactoredCode": string
}
`;
export async function POST(req: NextRequest) {
const { code, language } = await req.json();
const response = await ai.models.generateContent({
model: 'gemini-2.5-pro',
contents: `Code (${language}):\n${code}`,
config: {
systemInstruction: SYSTEM_INSTRUCTION,
responseMimeType: 'application/json',
}
});
return NextResponse.json(JSON.parse(response.text || '{}'));
}Real issues students hit during development and how to troubleshoot them fast.
Continue building your skills with similar projects.
Analytics dashboard with KPI cards, Recharts visualizations, data tables, and dark theme.
Node.js & Express REST API with MongoDB, nanoid key generation, and rate limiting.
Secure auth backend with JWT access/refresh tokens, bcrypt hashing, and role guard middleware.