# Kerf Engine — Project Status

## Overview
Kerf Engine is a raster-to-vector conversion tool with a React design canvas, purpose-built for producing laser/CNC-ready SVG and DXF output from raster images.

## Completed Milestones

### ✅ M001: Kerf Engine — Raster-to-Vector Pipeline & API
OpenCV preprocessing → potrace/vtracer vectorization → post-processing → multi-format output (SVG/DXF/JSON) exposed via FastAPI REST API with preset-driven pipeline configuration. Dockerized with multi-stage build.

### ✅ M002: React Frontend — Import & Convert UI + Design Canvas
Built the complete React frontend:
- **View 1 (Import & Convert):** File upload, preset selection, debounced live vectorization preview with parameter sliders, output stats bar, Use This button
- **View 2 (Design Canvas):** Konva.js-powered 2D environment with artboard shapes (rect, circle, ellipse, shield, pennant), basic shapes, text objects with opentype.js font loading and text-to-path conversion, layers panel, alignment tools, property editing, keyboard shortcuts, undo/redo
- **95 tests, zero TypeScript errors**, 54 source files, 10,721 lines of code

## Queued Milestones

### ⬜ M003: Export, Deployment & Embedding
Export pipeline (SVG/DXF download from canvas), production deployment, embeddable widget.

## Tech Stack
- **Engine:** Python 3.11, FastAPI, OpenCV, pypotrace, vtracer, ezdxf
- **App:** Vite, React 18, TypeScript (strict), Konva.js, opentype.js
- **Testing:** pytest (engine), Vitest + testing-library (app)
- **Infrastructure:** Docker multi-stage build, GHCR

## Key Architecture Decisions
- D001: Engine is standalone module, App consumes via HTTP API only
- D005: Vite + React + TS with plain CSS modules, minimal dependency surface
- D007: Canvas state uses useReducer + useRef pattern for undo/redo
- D008: Canvas objects use TypeScript discriminated union on `type` field
