39422a43486d8644983c8c1d4fb15ebc16d9db86
Root cause: layers.id is TEXT PRIMARY KEY (global unique across all drawings).
Hardcoded IDs layer-0..layer-4 collided when multiple projects tried to create
the same layer IDs. Second project got UNIQUE constraint failed on POST /layers.
Without layers, elements had dangling layer_id refs causing FOREIGN KEY errors.
Fix: makeInitialLayers() generates unique IDs: layer-{timestamp}-{index}.
activeLayerId initialized from first layer, not hardcoded.
activeLayerName uses activeLayerId variable, not hardcoded layer-0.
On project load with existing layers, activeLayerId set from first DB layer.
Web CAD Neu
Web-basiertes 2D-CAD für Event-Bestuhlungspläne.
Stack
- Frontend: React + TypeScript + Vite + HTML Canvas
- Backend: Node.js + TypeScript + Fastify + SQLite
- Collaboration: Yjs CRDT
Entwicklung
npm install
npm run dev
- Frontend: http://localhost:5173
- Backend: http://localhost:3001
Docker
docker-compose up --build
Description
Languages
TypeScript
80.1%
CSS
10.4%
HTML
8.1%
JavaScript
1.1%
Python
0.2%