Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
afae79b
Customizable ports
N2D4 Oct 17, 2025
8a76453
Update
N2D4 Oct 17, 2025
4433317
fix types
N2D4 Oct 17, 2025
915252d
fix lint
N2D4 Oct 17, 2025
f4e3b9a
Merge branch 'dev' into customizable-ports
N2D4 Oct 17, 2025
eb5662c
Update title
N2D4 Oct 17, 2025
a20ccaa
fix tests
N2D4 Oct 17, 2025
8e880cc
more fixes
N2D4 Oct 17, 2025
4caefb1
more fixes
N2D4 Oct 17, 2025
0550e2f
fix
N2D4 Oct 17, 2025
60410a3
fix
N2D4 Oct 17, 2025
f441c50
better
N2D4 Oct 17, 2025
2c04b0a
fix
N2D4 Oct 17, 2025
abdad07
No more config twiddling
N2D4 Oct 17, 2025
faf2157
chore(docs): update TOC
N2D4 Oct 17, 2025
184e9e6
Rename envvar
N2D4 Oct 17, 2025
d6ed716
fixes
N2D4 Oct 17, 2025
7c4c8ba
Merge branch 'dev' into customizable-ports
N2D4 Oct 17, 2025
8400777
more
N2D4 Oct 17, 2025
5c2a55c
fixes
N2D4 Oct 17, 2025
51860cc
fixes
N2D4 Oct 17, 2025
3774341
fixes
N2D4 Oct 17, 2025
14eafbb
fix
N2D4 Oct 17, 2025
f1d479a
more test fixes
N2D4 Oct 17, 2025
30f5592
fix
N2D4 Oct 17, 2025
52c398d
fix
N2D4 Oct 17, 2025
7ccc830
fix wildcard domains test
N2D4 Oct 17, 2025
cab12f0
stuff
N2D4 Oct 17, 2025
434d1bf
fix emulator
N2D4 Oct 17, 2025
c796ebf
Customizable ports docs
N2D4 Oct 17, 2025
0f5c776
disable emulator workflow
N2D4 Oct 17, 2025
7c699a5
improve process names
N2D4 Oct 17, 2025
8e4574e
Merge dev into customizable-ports
N2D4 Oct 18, 2025
f42efeb
Merge dev into customizable-ports
N2D4 Oct 19, 2025
75c2595
Merge branch 'dev' into customizable-ports
N2D4 Oct 20, 2025
76ef55f
REmove ppr
N2D4 Oct 20, 2025
ba0ec30
Merge branch 'dev' into customizable-ports
N2D4 Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"hooks": [
{
"type": "command",
"command": "if ! curl -s --connect-timeout 1 http://localhost:8102 >/dev/null 2>&1; then echo -e '\\n\\n\\033[1;31mCannot reach backend on port 8102! Please run `pnpm run dev` before querying Claude Code\\033[0m\\n\\n' >&2; exit 2; fi"
"command": "PORT=${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02; if ! curl -s --connect-timeout 1 \"http://localhost:$PORT\" >/dev/null 2>&1; then echo -e \"\\n\\n\\033[1;31mCannot reach backend on port $PORT! Please run \\`pnpm run dev\\` before querying Claude Code\\033[0m\\n\\n\" >&2; exit 2; fi"
}
]
}
Expand Down
4 changes: 0 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
"memory": "16gb"
},
"forwardPorts": [
5432, // PostgreSQL
2500, // Inbucket SMTP
1100, // Inbucket POP3
4318, // OTel collector
8100, 8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109,
8110, 8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119,
8120, 8121, 8122, 8123, 8124, 8125, 8126, 8127, 8128, 8129,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-prisma-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ jobs:
- name: Remove auto-migration metadata
run: |
cd apps/backend
pnpm run prisma db execute --url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe --stdin <<'SQL'
pnpm run prisma db execute --url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe --stdin <<'SQL'
DROP TABLE IF EXISTS "SchemaMigration";
SQL

- name: Check for differences in Prisma schema and current DB
run: cd apps/backend && pnpm run prisma migrate diff --from-url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe --to-schema-datamodel ./prisma/schema.prisma --shadow-database-url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/shadow_db --exit-code
run: cd apps/backend && pnpm run prisma migrate diff --from-url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe --to-schema-datamodel ./prisma/schema.prisma --shadow-database-url postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/shadow_db --exit-code
11 changes: 6 additions & 5 deletions .github/workflows/docker-emulator-test.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Docker Emulator Test

on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch # skip this workflow for now, unless manually triggered
# push:
# branches:
# - main
# - dev
# pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-server-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Setup postgres
run: |
docker run -d --name db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=stackframe -p 5432:5432 postgres:latest
docker run -d --name db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=stackframe -p 8128:5432 postgres:latest
sleep 5
docker logs db

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
env:
NODE_ENV: test
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe"
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"

strategy:
matrix:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
run: pnpm run wait-until-postgres-is-ready:pg_isready

- name: Wait on Inbucket
run: npx wait-on tcp:localhost:2500
run: npx wait-on tcp:localhost:8129

- name: Wait on Svix
run: npx wait-on tcp:localhost:8113
Expand Down
150 changes: 150 additions & 0 deletions .github/workflows/e2e-custom-base-port-api-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Runs E2E API Tests with custom port prefix

on:
push:
branches:
- main
- dev
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}

jobs:
build:
runs-on: ubicloud-standard-8
env:
NODE_ENV: test
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:6728/stackframe"
Comment thread
N2D4 marked this conversation as resolved.
NEXT_PUBLIC_STACK_PORT_PREFIX: "67"

strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2

# Even just starting the Docker Compose as a daemon is slow because we have to download and build the images
# so, we run it in the background
- name: Start Docker Compose in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: docker compose -f docker/dependencies/docker.compose.yaml up -d &
# we don't need to wait on anything, just need to start the daemon
wait-on: /dev/null
tail: true
wait-for: 3s
log-output-if: true

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create .env.test.local file for apps/backend
run: cp apps/backend/.env.development apps/backend/.env.test.local

- name: Create .env.test.local file for apps/dashboard
run: cp apps/dashboard/.env.development apps/dashboard/.env.test.local

- name: Create .env.test.local file for apps/e2e
run: cp apps/e2e/.env.development apps/e2e/.env.test.local

- name: Create .env.test.local file for docs
run: cp docs/.env.development docs/.env.test.local

- name: Create .env.test.local file for examples/cjs-test
run: cp examples/cjs-test/.env.development examples/cjs-test/.env.test.local

- name: Create .env.test.local file for examples/demo
run: cp examples/demo/.env.development examples/demo/.env.test.local

- name: Create .env.test.local file for examples/docs-examples
run: cp examples/docs-examples/.env.development examples/docs-examples/.env.test.local

- name: Create .env.test.local file for examples/e-commerce
run: cp examples/e-commerce/.env.development examples/e-commerce/.env.test.local

- name: Create .env.test.local file for examples/middleware
run: cp examples/middleware/.env.development examples/middleware/.env.test.local

- name: Create .env.test.local file for examples/supabase
run: cp examples/supabase/.env.development examples/supabase/.env.test.local

- name: Create .env.test.local file for examples/convex
run: cp examples/convex/.env.development examples/convex/.env.test.local

- name: Build
run: pnpm build

- name: Wait on Postgres
run: pnpm run wait-until-postgres-is-ready:pg_isready

- name: Wait on Inbucket
run: npx wait-on tcp:localhost:6729

- name: Wait on Svix
run: npx wait-on tcp:localhost:6713

- name: Initialize database
run: pnpm run db:init

- name: Start stack-backend in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: pnpm run start:backend --log-order=stream &
wait-on: |
http://localhost:6702
tail: true
wait-for: 30s
log-output-if: true
- name: Start stack-dashboard in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: pnpm run start:dashboard --log-order=stream &
wait-on: |
http://localhost:6702
tail: true
wait-for: 30s
log-output-if: true
- name: Start mock-oauth-server in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: pnpm run start:mock-oauth-server --log-order=stream &
wait-on: |
http://localhost:6702
tail: true
wait-for: 30s
log-output-if: true

- name: Wait 10 seconds
run: sleep 10

- name: Run tests
run: pnpm test

- name: Run tests again, to make sure they are stable (attempt 1)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test

- name: Run tests again, to make sure they are stable (attempt 2)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test

- name: Verify data integrity
run: pnpm run verify-data-integrity

- name: Print Docker Compose logs
if: always()
run: docker compose -f docker/dependencies/docker.compose.yaml logs
10 changes: 5 additions & 5 deletions .github/workflows/e2e-source-of-truth-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
env:
NODE_ENV: test
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
STACK_OVERRIDE_SOURCE_OF_TRUTH: '{"type": "postgres", "connectionString": "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/source-of-truth-db?schema=sot-schema"}'
STACK_OVERRIDE_SOURCE_OF_TRUTH: '{"type": "postgres", "connectionString": "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/source-of-truth-db?schema=sot-schema"}'
STACK_TEST_SOURCE_OF_TRUTH: true
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe"
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"
Comment thread
N2D4 marked this conversation as resolved.

strategy:
matrix:
Expand Down Expand Up @@ -93,15 +93,15 @@ jobs:
run: pnpm run wait-until-postgres-is-ready:pg_isready

- name: Wait on Inbucket
run: npx wait-on tcp:localhost:2500
run: npx wait-on tcp:localhost:8129

- name: Wait on Svix
run: npx wait-on tcp:localhost:8113

- name: Create source-of-truth database and schema
run: |
psql postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/postgres -c "CREATE DATABASE \"source-of-truth-db\";"
psql postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/source-of-truth-db -c "CREATE SCHEMA \"sot-schema\";"
psql postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/postgres -c "CREATE DATABASE \"source-of-truth-db\";"
psql postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/source-of-truth-db -c "CREATE SCHEMA \"sot-schema\";"

- name: Initialize database
run: pnpm run db:init
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/restart-dev-and-test-with-custom-base-port.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Dev Environment Test With Custom Base Port"

on:
push:
branches:
- main
- dev
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}

env:
SHELL: /usr/bin/bash

jobs:
restart-dev-and-test-with-custom-base-port:
runs-on: ubicloud-standard-8
env:
NEXT_PUBLIC_STACK_PORT_PREFIX: "69"

steps:
- uses: actions/checkout@v3

- name: Setup Node.js v20
uses: actions/setup-node@v3
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2
Comment on lines +24 to +34
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Bump core actions to v4.

actions/checkout and actions/setup-node v3 are outdated and may be flagged by linters. Upgrade to v4.

-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
...
-        uses: actions/setup-node@v3
+        uses: actions/setup-node@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v3
- name: Setup Node.js v20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2
- uses: actions/checkout@v4
- name: Setup Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2
🧰 Tools
🪛 actionlint (1.7.8)

25-25: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


28-28: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/restart-dev-and-test-with-custom-base-port.yaml around
lines 25 to 35, update the GitHub Actions core actions to v4 by changing uses:
actions/checkout@v3 to actions/checkout@v4 and uses: actions/setup-node@v3 to
actions/setup-node@v4 (keep the existing with: node-version: 20 block); leave
the pnpm/action-setup entry as-is unless you want to bump it separately. Ensure
the workflow syntax remains valid after the version changes.


- name: Install packages
run: pnpm install

- name: Start dev environment
run: pnpm run restart-dev-environment

- name: Run tests
run: pnpm run test --reporter=verbose

- name: Print dev server logs
run: cat dev-server.log.untracked.txt
if: always()
2 changes: 0 additions & 2 deletions .github/workflows/restart-dev-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ env:
jobs:
restart-dev-and-test:
runs-on: ubicloud-standard-8
env:
STACK_DIRECT_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe"

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.untracked
*.untracked.*
node-compile-cache/
.envrc


*.cpuprofile
Expand Down
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"YoavBls.pretty-ts-errors",
"mxsdev.typescript-explorer",
"github.vscode-github-actions",
"fabiospampinato.vscode-highlight",
"Prisma.prisma"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ You should ALWAYS add new E2E tests when you change the API or SDK interface. Ge
Stack Auth is a monorepo using Turbo for build orchestration. The main components are:

### Apps (`/apps`)
- **backend** (`/apps/backend`): Next.js API backend running on port 8102
- **backend** (`/apps/backend`): Next.js API backend running on port `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02` (defaults to 8102)
- Main API routes in `/apps/backend/src/app/api/latest`
- Database models using Prisma
- **dashboard** (`/apps/dashboard`): Admin dashboard on port 8101
- **dev-launchpad**: Development portal on port 8100
- **dashboard** (`/apps/dashboard`): Admin dashboard on port `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}01` (defaults to 8101)
- **dev-launchpad**: Development portal on port `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}00` (defaults to 8100)
- **e2e**: End-to-end tests

### Packages (`/packages`)
Expand Down
Loading
Loading