parseFloat('0') is falsy in JS so `|| 0.18` silently discarded the user's
explicit 0% selection. Replaced with an explicit empty-string guard.
Adds e2e spec gst-rate.spec.ts covering all five GST rates (0/5/12/18/28%).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4.4 KiB
4.4 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| project-services | All managed services, ports, startup commands, health checks, and env var notes for the Pelagia Portal dev environment |
|
Services
| Service | Port | Startup Command | Directory |
|---|---|---|---|
| pelagia-portal (Next.js) | 3000 | node node_modules\next\dist\bin\next dev --turbopack |
App/ |
| GstService (Express + Playwright) | 3003 | npm run dev (runs tsx watch src/index.ts) |
GstService/ |
| PostgreSQL 18 | 5432 | Windows service / already running | — |
Directory Structure (verified 2026-05-26)
- Portal source:
App/(contains package.json, next.config.ts, prisma/, app/, etc.) - GstService source:
GstService/(contains src/index.ts) App/pelagia-portal/— built artifact / deployed copy, NOT the source; has node_modules + .env.local but no package.json at root- Project root (
C:\Users\shad0w\Documents\src\Peliagia_Portal) has no package.json — the portal source is inApp/
Startup Order
- Verify PostgreSQL is up on port 5432 (
pg_isready -U postgres) - Install App/ deps if missing:
cd App && pnpm install --frozen-lockfile(pnpm v10 — allowBuilds in pnpm-workspace.yaml handles build scripts cleanly) - Ensure
App/.envexists withDATABASE_URL(Prisma reads.env, not.env.local) - Run
prisma migrate deployfromApp/using.\node_modules\.bin\prisma.cmd migrate deploy - Run
prisma generatefromApp/using.\node_modules\.bin\prisma.cmd generate - Start GstService:
cd GstService && npm run dev > logfile 2>&1(background) - Start pelagia-portal:
cd App && node node_modules\next\dist\bin\next dev --turbopack > logfile 2>&1(background)- DO NOT use
pnpm dev— pnpm 10 still runs pre-install hooks that may interfere; calling next directly is safer and consistent
- DO NOT use
- Health check both services
Health Checks
- pelagia-portal:
http://localhost:3000— expect 200 or 307 (auth redirect to /login) - GstService:
http://localhost:3003/health— expect{"ok":true,...} - PostgreSQL:
pg_isready -U postgres—:5432 - accepting connections
Environment
- Portal
.env.locallocation:App/.env.local(copy fromApp/pelagia-portal/.env.localif App/ is a fresh checkout) - Portal
.envlocation:App/.env— must containDATABASE_URLfor Prisma CLI (Prisma only reads.env, not.env.local) - Required dev vars:
NEXTAUTH_SECRET,NEXTAUTH_URL,DATABASE_URL - R2 and Resend vars not needed in dev (files go to
.dev-uploads/, emails log to console) - DATABASE_URL:
postgresql://postgres:postgres@localhost:5432/pelagia_portal - NEXTAUTH_URL:
http://localhost:3000
Node / Package Manager Setup
- Node.js:
C:\Program Files\nodejs(must prepend to PATH) - pnpm: v10.33.2, installed at
C:\Users\shad0w\AppData\Roaming\npm\node_modules\pnpm$env:PATHmust include$env:APPDATA\npmto find pnpm
- PostgreSQL 18 bin:
C:\Program Files\PostgreSQL\18\bin - Set PATH at start of each session:
$env:PATH = "C:\Program Files\nodejs;C:\Program Files\PostgreSQL\18\bin;$env:APPDATA\npm;$env:PATH" - PGPASSWORD=postgres for psql/createdb commands
Prisma Notes
- Use
.\node_modules\.bin\prisma.cmd(notnode node_modules\.bin\prisma) — the.bin\prismashim is a bash script and fails on Windows/PowerShell - Prisma reads
App/.envfor DATABASE_URL;.env.localis NOT read by Prisma CLI prisma generateEPERM on Windows = DLL locked by running Node process — normal- 14 migrations as of 2026-05-26 (latest:
20260521000000_remove_vessel_imo_number)
Log Files (when started as background processes)
- GstService:
C:\Users\shad0w\AppData\Local\Temp\gstservice.log - pelagia-portal:
C:\Users\shad0w\AppData\Local\Temp\portal.log
pnpm workspace
App/pnpm-workspace.yamlusesallowBuilds:field (pnpm v10 syntax) to allow build scripts for @prisma/client, @prisma/engines, esbuild, prisma, sharp, unrs-resolver- This resolves the ERR_PNPM_IGNORED_BUILDS issue from pnpm v11 era
Notes
- pelagia-portal 307 response = auth redirect to /login — healthy, not an error
- GstService
browserConnected: falseat startup is normal — Playwright browser connects on first session - Prisma migration scripts:
pnpm db:migrate(dev),pnpm db:migrate:deploy(CI/prod) — run from App/ App/pelagia-portal/is a deployed artifact directory (has .next/, node_modules, .env.local) — do not confuse with source