# InvenTree Stock Tool — Web (SvelteKit) SvelteKit rewrite of the Flask/Alpine web app. ## Stack - SvelteKit 2 + Svelte 5 (runes) + adapter-node - Tailwind CSS v4 - In-process scan-session store (no database) - Server-Sent Events for live session/import updates - Shell-out to `inventree-part-import` for unknown-part creation ## Dev ```bash cd web npm install cp .env.example .env # edit .env to point at your InvenTree server npm run dev ``` Open http://localhost:5173. ## Build ```bash npm run build node build ``` ## Feature: Scan Session - A session groups a run of scans. Every scan goes through `/api/session/scan` and is recorded in the session's stats. - Unknown parts in "Add Stock" mode are enqueued for `inventree-part-import`; workers run in parallel (tunable via `IMPORT_CONCURRENCY`, default 3). - Failures (unknown parts outside import mode, missing qty, invalid location, API errors, and imports that exhaust 3 retries) land in the Failures panel. - Each failure has a **Fix** dialog — override the part code / quantity / location, or search for an existing part and link it instead. Retry feeds back through the same code path. - Export CSV of failures for offline follow-up. ## Layout ``` web/ ├── src/ │ ├── app.css, app.html, app.d.ts │ ├── lib/ │ │ ├── barcode.ts shared parse_scan + commands │ │ ├── client.ts fetch wrappers for API routes │ │ ├── types.ts shared types │ │ ├── server/ ← imported only from +server.ts / hooks │ │ │ ├── env.ts typed env config │ │ │ ├── inventree.ts 8 API helpers │ │ │ ├── events.ts SSE pubsub │ │ │ ├── importQueue.ts N-worker pool → inventree-part-import │ │ │ └── sessions.ts in-memory scan sessions │ │ ├── stores/app.svelte.ts │ │ └── components/… │ └── routes/ │ ├── +layout.svelte, +page.svelte │ └── api/ │ ├── config, locations, proxy/image, part/search, events │ └── session/{start,end,mode,location,scan,retry,failures} └── deploy/ systemd unit, nginx example, deploy README ``` ## Deployment See [`deploy/README.md`](deploy/README.md).