Files
Art-gallery/.cursor/rules/dev-first-workflow.mdc
T
Danila Khodjaef bdddadc4d6 Document development-first workflow with weekly prod releases.
Default all day-to-day work to gallery_dev and devgallery; add Cursor rule and update docs, env examples, and deploy guide for scheduled prod promotion.
2026-07-06 09:58:01 +03:00

44 lines
1.7 KiB
Plaintext

---
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 migrate`, `npm run 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 db:backup` → `npm run db:restore:prod` (if DB/data changed)
3. `npm run images:sync-to-prod` (if images changed)
4. `npm run 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`