CodeCanvas
Turning a hand-drawn UI wireframe into working front-end code is slow and manual. CodeCanvas converts a sketch into React + Tailwind code through a detection-to-generation pipeline. I built the FastAPI backend and most of the Next.js frontend. The detection model is hosted and was trained by a teammate.
- Role
- Backend + frontend · Final Year Project
- Timeframe
- 2026
Stack
Architecture
Key decisions
A two-stage pipeline: a hosted detection model finds and bounds UI elements first, then Gemini generates code from those structured detections.
Feeding the raw sketch image straight into a vision LLM and asking it to output code in one shot.
Detection produces deterministic element types and coordinates, so the model synthesizes from a structured layout instead of guessing pixels. The detector is a separate hosted service, so it can be swapped without touching the generator, and a bad box is debuggable in a way a hallucinated layout is not.
Try it
export default function Generated() {
return (
<div className="flex flex-col gap-4 p-6">
<h2 className="text-2xl font-semibold">Heading</h2>
<p className="text-sm text-gray-500">Body copy goes here.</p>
<input className="rounded-lg border px-3 py-2" />
<button className="rounded-lg bg-black px-4 py-2 text-white">Action</button>
<img className="rounded-lg" alt="" />
</div>
);
}Screens


