Reference
Commands
Every npm script, the Docker commands, single tests and the ports.
npm scripts
All run in the root of the project.
| Command | What it does |
|---|---|
npm run dev | development server with Turbopack on port 3370, reads .env.local |
npm run build | production build into .next, with standalone output |
npm start | starts the build with next start on port 3370 |
npm test | Vitest, once |
npm run test:watch | Vitest, at every change |
npm run test:e2e | Playwright: builds, starts on port 3371 with a fresh .data-e2e, checks desktop and mobile |
npm run lint | ESLint |
npm run typecheck | creates the route types (next typegen), then tsc --noEmit |
npm run format | Prettier writes all files |
npm run format:check | Prettier only checks |
npm run check | format:check, lint, typecheck, test one after another |
npm run rename -- <Name> <Port> [<prefix_>] | scripts/rename.mjs: name, port and API key prefix of a project from the template |
Besides:
| Command | What it does |
|---|---|
npm ci | installs exactly what package-lock.json lists |
npx next build | the build, as "Check" runs it after check |
npx playwright install chromium | the Chromium for the browser tests |
npx prettier --write <files> | formats single files |
Single tests
npx vitest run tests/env.test.ts
npx vitest run -t "the first admin"
npx playwright test e2e/docs.spec.ts --project=desktop
Docker
| Command | What it does |
|---|---|
docker/build.sh -t henniokf | builds the image, with commit and build time. Further arguments go to docker buildx build |
docker/build.sh --platform linux/amd64 -t ghcr.io/arpablo/henniokf:latest | builds for a VPS with amd64 |
docker build -f docker/Dockerfile -t henniokf . | without the script, without version |
docker compose -f docker/compose.local.yml up -d --build | builds and starts locally, requires LOCAL_ROOT_DIR, optionally LOCAL_PORT |
docker compose -f docker/compose.vps.yml up -d | pulls and starts on the VPS, reads docker/.env |
docker/backup.sh | backs up the root directory on the VPS |
GitHub
| Command | What it does |
|---|---|
gh run list --limit 5 | the last runs |
gh run list --workflow Image --limit 3 | the last runs of "Image" |
gh workflow run Image | starts "Image" by hand |
Ports
| Port | What for |
|---|---|
| 3370 | development, npm start, container |
| 3371 | browser tests |