stack/apps/backend/package.json
Konsti Wohlwend 3d4c608187
Customizable ports (#962)
<!--
ONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- RECURSEML_SUMMARY:START -->

## High-level PR Summary

This PR changes the default development ports for several background
services to avoid conflicts. PostgreSQL moves from port `5432` to
`8128`, Inbucket SMTP from `2500` to `8129`, Inbucket POP3 from `1100`
to `8130`, and the OpenTelemetry collector from `4318` to `8131`. All
references across configuration files, Docker Compose setups,
environment files, CI/CD workflows, test files, and documentation have
been updated to reflect these new port assignments. A knowledge base
document has been added to document the new port mappings.

⏱️ Estimated Review Time: 15-30 minutes

<details>
<summary>💡 Review Order Suggestion</summary>

| Order | File Path |
| --- | --- |
| 1 | `claude/CLAUDE-KNOWLEDGE.md` |
| 2 | `apps/dev-launchpad/public/index.html` |
| 3 | `docker/dependencies/docker.compose.yaml` |
| 4 | `docker/emulator/docker.compose.yaml` |
| 5 | `apps/backend/.env` |
| 6 | `apps/backend/.env.development` |
| 7 | `docker/server/.env.example` |
| 8 | `package.json` |
| 9 | `.devcontainer/devcontainer.json` |
| 10 | `apps/e2e/.env.development` |
| 11 | `.github/workflows/check-prisma-migrations.yaml` |
| 12 | `.github/workflows/docker-server-test.yaml` |
| 13 | `.github/workflows/e2e-api-tests.yaml` |
| 14 | `.github/workflows/e2e-source-of-truth-api-tests.yaml` |
| 15 | `.github/workflows/restart-dev-and-test.yaml` |
| 16 |
`apps/e2e/tests/backend/endpoints/api/v1/internal/email-drafts.test.ts`
|
| 17 | `apps/e2e/tests/backend/endpoints/api/v1/internal/email.test.ts`
|
| 18 | `apps/e2e/tests/backend/endpoints/api/v1/send-email.test.ts` |
| 19 |
`apps/e2e/tests/backend/endpoints/api/v1/unsubscribe-link.test.ts` |
| 20 | `apps/e2e/tests/backend/workflows.test.ts` |
| 21 | `docs/templates/others/self-host.mdx` |

</details>

[![Need help? Join our
Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U)

[![Analyze latest
changes](21c3d5c362/?repo_owner=stack-auth&repo_name=stack-auth&pr_number=962)

<!-- RECURSEML_SUMMARY:END -->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> This PR introduces customizable development ports using
`NEXT_PUBLIC_STACK_PORT_PREFIX`, updating configurations, documentation,
and tests accordingly.
> 
>   - **Behavior**:
> - Default development ports for services are now customizable via
`NEXT_PUBLIC_STACK_PORT_PREFIX`.
> - PostgreSQL port changed from `5432` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}28`.
> - Inbucket SMTP port changed from `2500` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}29`.
> - Inbucket POP3 port changed from `1100` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}30`.
> - OpenTelemetry collector port changed from `4318` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}31`.
>   - **Configuration**:
> - Updated `docker.compose.yaml` to use new port variables for services
like PostgreSQL, Inbucket, and OpenTelemetry.
> - Environment files in `apps/backend`, `apps/dashboard`, and
`apps/e2e` updated to use `NEXT_PUBLIC_STACK_PORT_PREFIX`.
> - `package.json` scripts updated to reflect new port configurations.
>   - **Documentation**:
>     - Added `CLAUDE-KNOWLEDGE.md` to document new port mappings.
>     - Updated `self-host.mdx` to reflect new port configurations.
>   - **Testing**:
> - Updated test files in `apps/e2e/tests` to use new port
configurations.
>     - Added `helpers/ports.ts` for port-related utilities in tests.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 76ef55f58f. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

----


<!-- ELLIPSIS_HIDDEN -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enable configurable development ports via a
NEXT_PUBLIC_STACK_PORT_PREFIX, allowing parallel local environments with
custom port prefixes.

- **Bug Fixes**
- Updated local service port mappings and CI/workflow settings so
tooling and tests use the new prefixed ports consistently.

- **Documentation**
- Added docs and contributor guidance for running multiple parallel
workspaces with custom port prefixes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: N2D4 <N2D4@users.noreply.github.com>
2025-10-20 15:24:47 -07:00

124 lines
5.4 KiB
JSON

{
"name": "@stackframe/stack-backend",
"version": "2.8.44",
"private": true,
"scripts": {
"clean": "rimraf src/generated && rimraf .next && rimraf node_modules",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -c development --",
"with-env:prod": "dotenv -c --",
"dev": "concurrently -n \"dev,codegen,prisma-studio\" -k \"next dev --turbopack --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02\" \"pnpm run codegen:watch\" \"pnpm run prisma-studio\"",
"build": "pnpm run codegen && next build",
"docker-build": "pnpm run codegen && next build --experimental-build-mode compile",
"build-self-host-migration-script": "tsup --config scripts/db-migrations.tsup.config.ts",
"analyze-bundle": "ANALYZE_BUNDLE=1 pnpm run build",
"start": "next start --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02",
"codegen-prisma": "pnpm run prisma generate",
"codegen-prisma:watch": "pnpm run prisma generate --watch",
"codegen-route-info": "pnpm run with-env tsx scripts/generate-route-info.ts",
"codegen-route-info:watch": "pnpm run with-env tsx watch --clear-screen=false scripts/generate-route-info.ts",
"codegen": "pnpm run with-env pnpm run generate-migration-imports && pnpm run with-env bash -c 'if [ \"$STACK_ACCELERATE_ENABLED\" = \"true\" ]; then pnpm run prisma generate --no-engine; else pnpm run codegen-prisma; fi' && pnpm run codegen-route-info",
"codegen:watch": "concurrently -n \"prisma,docs,route-info,migration-imports\" -k \"pnpm run codegen-prisma:watch\" \"pnpm run watch-docs\" \"pnpm run codegen-route-info:watch\" \"pnpm run generate-migration-imports:watch\"",
"psql-inner": "psql $(echo $STACK_DATABASE_CONNECTION_STRING | sed 's/\\?.*$//')",
"psql": "pnpm run with-env pnpm run psql-inner",
"prisma-studio": "pnpm run with-env prisma studio --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}06 --browser none",
"prisma": "pnpm run with-env prisma",
"db:migration-gen": "pnpm run with-env tsx scripts/db-migrations.ts generate-migration-file",
"db:reset": "pnpm run with-env tsx scripts/db-migrations.ts reset",
"db:seed": "pnpm run with-env tsx scripts/db-migrations.ts seed",
"db:init": "pnpm run with-env tsx scripts/db-migrations.ts init",
"db:migrate": "pnpm run with-env tsx scripts/db-migrations.ts migrate",
"generate-migration-imports": "pnpm run with-env tsx scripts/generate-migration-imports.ts",
"generate-migration-imports:watch": "chokidar 'prisma/migrations/**/*.sql' -c 'pnpm run generate-migration-imports'",
"lint": "next lint",
"watch-docs": "pnpm run with-env bash -c 'tsx watch --clear-screen=false scripts/generate-openapi-fumadocs.ts && pnpm run --filter=@stackframe/stack-docs generate-openapi-docs'",
"generate-openapi-fumadocs": "pnpm run with-env tsx scripts/generate-openapi-fumadocs.ts",
"generate-keys": "pnpm run with-env tsx scripts/generate-keys.ts",
"db-seed-script": "pnpm run db:seed",
"verify-data-integrity": "pnpm run with-env tsx scripts/verify-data-integrity.ts"
},
"prisma": {
"seed": "pnpm run db-seed-script"
},
"dependencies": {
"@ai-sdk/openai": "^1.3.23",
"@aws-sdk/client-s3": "^3.855.0",
"@next/bundle-analyzer": "15.2.3",
"@node-oauth/oauth2-server": "^5.1.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.53.0",
"@opentelemetry/context-async-hooks": "^1.26.0",
"@opentelemetry/core": "^1.26.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.53.0",
"@opentelemetry/instrumentation": "^0.53.0",
"@opentelemetry/resources": "^1.26.0",
"@opentelemetry/sdk-logs": "^0.53.0",
"@opentelemetry/sdk-trace-base": "^1.26.0",
"@opentelemetry/sdk-trace-node": "^1.26.0",
"@opentelemetry/semantic-conventions": "^1.27.0",
"@oslojs/otp": "^1.1.0",
"@prisma/adapter-neon": "^6.12.0",
"@prisma/adapter-pg": "^6.12.0",
"@prisma/client": "^6.12.0",
"@prisma/instrumentation": "^6.12.0",
"@react-email/render": "^1.2.1",
"@sentry/nextjs": "^10.11.0",
"@simplewebauthn/server": "^11.0.0",
"@stackframe/stack": "workspace:*",
"@stackframe/stack-shared": "workspace:*",
"@upstash/qstash": "^2.8.2",
"@vercel/functions": "^2.0.0",
"@vercel/otel": "^1.10.4",
"ai": "^4.3.17",
"bcrypt": "^5.1.1",
"chokidar-cli": "^3.0.0",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.3.0",
"freestyle-sandboxes": "^0.0.92",
"jose": "^5.2.2",
"json-diff": "^1.0.6",
"next": "15.4.1",
"nodemailer": "^6.9.10",
"oidc-provider": "^8.5.1",
"openid-client": "5.6.4",
"pg": "^8.16.3",
"postgres": "^3.4.5",
"posthog-node": "^4.1.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"resend": "^6.0.1",
"semver": "^7.6.3",
"sharp": "^0.32.6",
"stripe": "^18.3.0",
"svix": "^1.25.0",
"vite": "^6.1.0",
"yaml": "^2.4.5",
"yup": "^1.4.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@simplewebauthn/types": "^11.0.0",
"@types/json-diff": "^1.0.3",
"@types/node": "20.17.6",
"@types/nodemailer": "^6.4.14",
"@types/oidc-provider": "^8.5.1",
"@types/react": "19.0.12",
"@types/react-dom": "19.0.4",
"@types/semver": "^7.5.8",
"concurrently": "^8.2.2",
"glob": "^10.4.1",
"import-in-the-middle": "1.14.2",
"prisma": "^6.12.0",
"require-in-the-middle": "^7.4.0",
"rimraf": "^5.0.5",
"tsup": "^8.3.0",
"tsx": "^4.7.2"
},
"pnpm": {
"overrides": {
"@types/react": "19.0.12",
"@types/react-dom": "19.0.4"
}
}
}