docs+data: refresh demo dumps (clean seeded state) + restore/seeder docs

- backups/procurement.dump regenerated from the clean seeded state (was the
  junk test data); README documents both the app seeder and the restore path
- docs/casdoor-auth.md: later-batch changelog (fulfillment split, demo
  seeder, API-driven topics, hub-and-spoke, count modal, FOUND ceiling,
  semantic colors)
This commit is contained in:
ali_mohaghegh
2026-09-02 18:15:57 +03:30
parent ac76af2ffe
commit acb9958059
3 changed files with 53 additions and 10 deletions
+20 -10
View File
@@ -201,7 +201,7 @@ docker exec -it procurement-postgres psql -U postgres -d procurement
The databases are **not** in git — Docker volumes hold the data. To let
everyone see the same system state, the repo ships exact database dumps in
`backups/` (taken 2026-09-02). After a fresh boot:
`backups/`. After a fresh boot:
```powershell
powershell -ExecutionPolicy Bypass -File .\backups\restore.ps1 # Windows
@@ -209,16 +209,26 @@ bash backups/restore.sh # Linux / Git
```
This **replaces all data** in the `procurement` and `casdoor` databases with
the committed state (users + roles, projects, warehouses, quotes with
receipts, inventory rows, Casdoor org/app/users). To create a fresh dump of
your own current state:
the committed state — a clean, realistic demo: 3 projects × 2 warehouses,
4 suppliers, 12 materials across all 8 categories, and 4 quotes covering
every lifecycle state (offered / in-transit / partially received /
completed) with matching stock.
```powershell
docker compose stop api casdoor
docker exec procurement-postgres pg_dump -U postgres -d procurement -Fc > backups/procurement.dump # (Git Bash: use -f inside the container + docker cp)
docker exec procurement-postgres pg_dump -U postgres -d casdoor -Fc > backups/casdoor.dump
docker compose start casdoor api
```
Two alternative ways to get a clean state:
1. **App seeder** (realistic demo data, keeps the Casdoor org as-is):
```powershell
docker exec procurement-api sh -c "cd /srv/backend && python -m tools.seed"
```
2. **Casdoor seeder** (creates org `inventory` + app + users razaei /
mousavi / mohaghegh / tester — run once after a fresh volume):
```powershell
python backend/tools/seed_casdoor.py # from the host, or from the api container
```
To create a fresh dump of your own current state: stop `api` + `casdoor`,
`docker exec procurement-postgres pg_dump -U postgres -d procurement -Fc`
(+ the `casdoor` DB) into `backups/`, then start them again.
## Common operations