6 Commits

Author SHA1 Message Date
a287d26b93 fix gitignore and install bat 2026-06-17 18:06:29 +05:00
259f8d4b8f update gitignore 2026-05-23 22:46:09 +05:00
82bb456103 Run dev on host Node 16 and add deploy patch script
Switch make install/run/build/db-* off docker compose onto the host's
Node (via nvm + .nvmrc). better-sqlite3 7.6.2 doesn't build against
Node 20, and the Dockerfile was still pinned to node:20 while the
rest of the project was downgraded to Node 16 in the Win7 bundle
commit; host execution avoids that mismatch.

Also adds scripts/make-patch.sh (make patch) to produce a small
build-only update zip for an already-installed Win7 target, ignores
dist/, and points start.bat at the installed Chrome PWA shortcut
instead of opening a normal browser tab.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:34:41 +05:00
f65fca09e4 Add automatic backups and an admin restore page
Scheduler ticks every 5 minutes and snapshots data/avtoambor.db (via
better-sqlite3's online backup API) when the DB file's mtime has advanced.
After each new backup, prune older snapshots: keep everything from the last
7 days, then one per calendar day. New /admin page lists backups with
Download and Restore actions, plus a Back-up-now button. Restore takes a
safety snapshot first, closes the live connection, swaps the .db file, and
lets the next request reopen.

Also: TZ=Asia/Dushanbe in the container so backup filenames use local time,
and tzdata added to the image so TZ takes effect.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 07:25:18 +05:00
2bb51940f0 ignore things 2026-05-16 07:06:36 +05:00
05be5b03aa Initial scaffold for AvtoAmbor parts inventory
SvelteKit 2 + Svelte 4 + adapter-node, SQLite via better-sqlite3 (WAL,
foreign keys on). Bilingual EN/Тоҷикӣ throughout, locale persisted in
localStorage.

Pages: dashboard (totals, low stock, recent movements), parts list with
search and sort, part create/edit, record movement (in/out/adjust with
smart unit-price and adjust-quantity prefill), suppliers list with
inline add.

Schema: categories, suppliers, parts (with _en/_tg name+description
columns, dirams for money), stock_movements with check on movement_type.
On-hand updates are done in JS inside a transaction with the movement
insert.

Dockerized dev: docker compose, named project, bind-mounted data/ for
DB persistence. Seed contains 6 categories, 4 suppliers, 31 realistic
parts (Lada / Nexia / Opel / Toyota bias).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 07:05:24 +05:00