Files
evig/docs/COMMANDS.md
T
894b203602 docs: sync docs with actual stack (#447)
Docs truth-sweep against ground truth (package.json, CI workflows):
- npm → pnpm across evergreen docs (pnpm 11.25.0 is the package manager;
  npx tsx → pnpm exec tsx, npx ts-prune/jscpd → pnpm dlx, npm ci →
  pnpm install --frozen-lockfile, package-lock.json → pnpm-lock.yaml)
- Jest → Vitest in README, CONTRIBUTING, COMMANDS (vitest 4 is installed)
- Node claims: README 20+ → 22.13+ (engines) with CI/deploy on 24;
  deployment.md "Setup Node 20 (npm cache)" → Node 24 (pnpm cache), and
  the pipeline line now shows `pnpm run verify` as CI actually runs
- TypeScript 5.x claims → 6 (typescript ^6.0.3); Next.js 14 → 16 in
  BLOG_SYSTEM, guides/ARCHITECTURE, AI_BOT_SYSTEM_PROMPT
- COMMANDS.md: dropped nonexistent `dev:cms` script; services list fixed
  to db/meilisearch/listmonk (no redis in compose)
- HR_RUNBOOK: `npm run test -- src/…` → `pnpm run test src/…` (pnpm
  passes args without the `--` separator)

Historical records (docs/archive/**, dated audit reports, UPGRADE_PLAN)
left as-is — they describe what was true when written.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 15:01:39 +00:00

7.7 KiB

created_date, last_modified_date, last_modified_summary
created_date last_modified_date last_modified_summary
2026-01-07 2026-07-04 IT-Hilfe journey E2E (edit + withdraw); local run notes

RevampIT Commands Reference (SSOT)

Single Source of Truth for all package scripts and commands.


Quick Start Commands

pnpm run d              # Start everything (databases + dev server)
pnpm run dev            # Frontend only (port 3000)
pnpm run services:up    # Start Docker services (db, meilisearch, listmonk)
pnpm run services:down  # Stop Docker services
pnpm run setup-admins   # Create admin users

Development Commands

pnpm run dev            # Start Next.js dev server (port 3000)

Docker Services

pnpm run services:up    # Start all services (db, meilisearch, listmonk)
pnpm run services:down  # Stop all services
pnpm run db:up          # Start main database only
pnpm run db:down        # Stop main database
pnpm run setup          # Start database and wait 5 seconds
pnpm run reset          # Stop all, remove volumes, and reset

Build & Production

pnpm run build          # Production build (Next.js + sitemap)
pnpm run start          # Start production server
pnpm run typecheck      # TypeScript validation (run before commits!)
pnpm run lint           # ESLint check
pnpm run i18n:businessplan  # Business plan i18n shape/invariant parity (8 locales)

Monitor-Upcycling content scripts

node scripts/sync-businessplan-locales.mjs   # After editing DE businessPlan block
node scripts/prune-businessplan-archive.mjs  # Remove archived citation keys from all locales

See docs/projects/upcycling.md for mini-site SSOT map.


Testing

pnpm run test           # Vitest unit tests
pnpm run test:watch     # Vitest watch mode
pnpm run test:coverage  # Vitest with coverage
pnpm run test:e2e       # Playwright E2E tests
pnpm run test:e2e:auth  # Auth login smoke (needs AUTH_TEST_EMAIL/PASSWORD)
pnpm run test:e2e:inventory # Dual-persona feature inventory (user + admin)
pnpm run test:e2e:inventory:prod # Same, with prod health wait (CI / post-deploy)
pnpm run test:e2e:user-admin # Legacy quick smoke (subset)
pnpm run test:e2e:it-hilfe    # IT-Hilfe hub/journey specs
pnpm run test:e2e:it-hilfe:journey # Dual-persona lifecycle + edit/withdraw (see E2E section)
pnpm run test:e2e:marketplace:journey # User sells, admin buys (Payrexx when configured)
pnpm run test:e2e:workshops:proposal:journey # User proposes, admin approve/reject
pnpm run test:e2e:timecards:journey          # Staff submit + admin approve (TIME round-trip)
pnpm run test:e2e:intake:journey             # Admin intake create → checklist → publish
pnpm run test:e2e:tasks:journey              # Admin task create → complete
pnpm run test:e2e:protocols:journey          # Admin protocol create → JSON import → finalize
pnpm run test:e2e:decisions:journey          # Admin decision create → vote → close
pnpm run test:e2e:cms:journey                # Admin blog draft → publish → public view
pnpm run test:e2e:it-hilfe:preferred:journey # Request with preferred techniker
pnpm run test:e2e:service:journey # User books repair, admin assigns techniker (dual-persona)
pnpm run test:e2e:ui    # Playwright with UI
pnpm run test:all       # Run all tests

Deployment

Production app: https://revampit.orangecat.ch (Hetzner self-host). Public legacy domain revamp-it.ch is still the old Joomla/Apache site and is not the production app.

Automatic (push-to-deploy)

Trigger What happens
git push origin main (local) Pre-push hook builds + deploys in background → /tmp/push-deploy-revampit.log
git push origin main (GitHub) Actions workflow .github/workflows/deploy-selfhost.yml runs lint + typecheck, then deploys if secrets are set

Requires .env.selfhost.local locally (gitignored). Copy from a teammate or recreate from the prod /opt/revampit/app/.env.

One-time GitHub secrets (Settings → Secrets → Actions) for CI deploy when you push from anywhere:

Secret Value
HETZNER_SSH_PRIVATE_KEY Private key for ubuntu@167.233.22.31
SELFHOST_ENV Full contents of .env.selfhost.local
AUTH_TEST_USER_PASSWORD Non-admin E2E account (butaeff@gmail.com) — post-deploy + CI inventory
AUTH_TEST_ADMIN_PASSWORD Staff E2E account (georgy.butaev@revamp-it.ch) — post-deploy + CI inventory
AUTH_TEST_USER_EMAIL Optional override for user persona (defaults to butaeff)
AUTH_TEST_ADMIN_EMAIL Optional override for admin persona (defaults to georgy)
AUTH_TEST_EMAIL / AUTH_TEST_PASSWORD Legacy single-account auth smoke (test:e2e:auth)
PLAYWRIGHT_CHANNEL chrome or msedge when bundled Chromium cannot install (e.g. Ubuntu 26)

Local marketplace journey (no prod secrets):

pnpm run e2e:seed
PLAYWRIGHT_CHANNEL=chrome \
AUTH_TEST_USER_EMAIL=e2e-user@revampit.test AUTH_TEST_USER_PASSWORD='E2EUser123!' \
AUTH_TEST_ADMIN_EMAIL=e2e-admin@revampit.test AUTH_TEST_ADMIN_PASSWORD='E2EAdmin123!' \
pnpm run test:e2e:marketplace:journey

Local IT-Hilfe dual-persona journey (owner edit + withdraw offer + full lifecycle):

pnpm run e2e:seed
PLAYWRIGHT_CHANNEL=chrome PLAYWRIGHT_BASE_URL=http://localhost:3001 \
AUTH_TEST_USER_EMAIL=e2e-user@revampit.test AUTH_TEST_USER_PASSWORD='E2EUser123!' \
AUTH_TEST_ADMIN_EMAIL=e2e-admin@revampit.test AUTH_TEST_ADMIN_PASSWORD='E2EAdmin123!' \
pnpm run test:e2e:it-hilfe:journey

Use pnpm exec next dev --port 3001 --webpack locally if Turbopack returns 404 on /api/auth/*. Restart the dev server if create-request rate limit (Zu viele Anfragen) trips during repeated runs.

Apply migration 114_listing_questions.sql before first local run (pnpm run db:migrate or direct psql). Prod: applied on Hetzner 2026-07-04 (see docs/FEATURE_INVENTORY.md → Marketplace UX rollout tracker).

After each successful deploy, Dual-persona inventory smoke runs automatically when the two password secrets are set (routes + IT-Hilfe + marketplace + workshops + service journeys). Manual re-run: pnpm run test:e2e:inventory:prod.

Payrexx go-live checklist: docs/operations/PAYREXX_SETUP.md · config SSOT: src/config/payrexx.ts.

Manual

pnpm run deploy          # same as deploy:selfhost
pnpm run deploy:selfhost # build standalone → release backup → activate → /api/health gate → rollback on failure
pnpm run ship            # quality gate (typecheck, lint, build, tests)
pnpm run db:migrate      # apply unrecorded scripts/db/migrations/*.sql (DATABASE_URL / PG* env)

Operational checks:

curl https://revampit.orangecat.ch/api/health  # dependency health
curl https://revampit.orangecat.ch/api/version # deployed version / git SHA

Production dependencies on the Hetzner box:

Service Runtime Binding Notes
revampit-app systemd 127.0.0.1:4004 behind Caddy /opt/revampit/app, restarted by scripts/selfhost-deploy-evig.sh
revampit_meilisearch Docker 127.0.0.1:7700 Required for healthy /api/health; master key is stored only in /opt/revampit/app/.env

The deploy script copies the server-local .env and launch.sh into each release before activation. Do not put those runtime secrets in git.


Database

pnpm run db:migrate-users  # Migrate existing users

Production Docker

pnpm run prod:build     # Build production Docker image
pnpm run prod:up        # Start production containers
pnpm run prod:down      # Stop production containers

Last Updated: 2026-09-04
Last Modified Summary: Post-deploy dual-persona inventory in GitHub Actions; E2E secret docs.
Source: package.json