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>
This commit is contained in:
42
README.md
Normal file
42
README.md
Normal file
@ -0,0 +1,42 @@
|
||||
# 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
|
||||
|
||||
```sh
|
||||
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:
|
||||
|
||||
```sh
|
||||
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).
|
||||
Reference in New Issue
Block a user