--- description: Default to dev for all changes; prod only when explicitly requested alwaysApply: true --- # Development-first workflow **Default target is always development** unless the user explicitly names **prod** / **production**. ## What "dev" means | Layer | Dev default | |-------|-------------| | Code | Edit in this repo; run `npm run dev:web` on the dev PC | | Database | `gallery_dev` via root `.env` (`DB_NAME=gallery_dev`) | | Data / images | `data/images/` in the repo | | Public URL | https://devgallery.mysuperlab.netcraze.pro | | Migrations / seeds / scripts | `npm run dev:migrate`, `npm run dev:seed`, etc. against **dev** | ## Production is scheduled, not daily Prod (`gallery_prod`, TrueNAS Docker, https://gallery.mysuperlab.netcraze.pro) is updated **roughly weekly** (or when the user explicitly asks for prod): 1. Validate on dev 2. `npm run dev:db:backup` → `npm run devtoprod:db:restore` (if DB/data changed) 3. `npm run devtoprod:images` (if images changed) 4. `npm run prod:docker:publish` (if code changed) 5. Restart **gallery-web** on TrueNAS Do **not** edit `infra/docker/.env.prod`, run `db:restore:prod`, `images:sync-to-prod`, or `docker:publish` unless the user clearly targets prod. ## When the user says "fix", "change", or "modify" - Assume **dev** code, **dev** DB, and **dev** data paths - Test against devgallery or localhost - Mention prod steps only as optional follow-up for the next release ## When the user says "prod" or "production" - Use `gallery_prod`, `infra/docker/.env.prod`, TrueNAS compose, and prod deploy docs - Require explicit confirmation before destructive prod operations (`db:restore:prod`, etc.) Full operator guide: `Documentation/environments.md`