AI-powered developer assistant with code generation, syntax highlighting, and live prompt history.
Tick off requirements as you build to track real-time completion.
Follow this chronological guide to build the project from scratch.
Obtain API key from Google AI Studio and configure Gemini generateContent Stream in a server-side Next.js route.
import { GoogleGenAI } from '@google/genai';
import { NextRequest } from 'next/server';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
export async function POST(req: NextRequest) {
const { messages, model } = await req.json();
// Create a text stream chunk response
const responseStream = await ai.models.generateContentStream({
model: model || 'gemini-2.5-flash',
contents: messages,
config: {
systemInstruction: "You are CodeCompanion, an elite software architect. Output clear code block tags."
}
});
const encoder = new TextEncoder();
const readable = new ReadableStream({
async start(controller) {
for await (const chunk of responseStream) {
const text = chunk.text;
controller.enqueue(encoder.encode(text));
}
controller.close();
}
});
return new Response(readable, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' }
});
}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.