f65fca09e44d15669c4b9fcea643efa504b35820
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>
AvtoAmbor
Simple auto-parts inventory for a single shop. SvelteKit + SQLite. UI is bilingual (English / Тоҷикӣ).
Prerequisites
- Docker + Docker Compose
Everything else (Node, npm, native build tools for better-sqlite3) runs
inside the container.
Quickstart
make install # install dependencies inside the container
make db-init # create data/avtoambor.db with schema + seed
make run # dev server at http://localhost:5173
make help lists every target.
Production
Build with make build, copy the build/ directory plus node_modules and
data/avtoambor.db to the Windows host, then run:
node build/index.js
The server listens on port 3000 by default. Open http://localhost:3000 in
the browser on that machine.
Data
The SQLite database lives at data/avtoambor.db. The data/ directory is
gitignored and bind-mounted into the container, so the DB file persists on
the host.
make db-init— create the DB if it doesn't exist (does nothing otherwise).make db-reset— delete and recreate the DB (asks for confirmation).
Description
Languages
Svelte
41.9%
JavaScript
35.7%
HTML
12.3%
Shell
5.4%
Batchfile
2.3%
Other
2.4%